[comp.sys.handhelds] Empirical stocastic distribution of one variable

ele9050@cdc835.cdc.polimi.it (Luca Radice) (06/27/91)

This is a set of programs to compute several information about
empirical stocastic distribution of one variable.
All programs work on a SigmaDAT which you may enter before
any calculation. Each value in SigmaDAT is intended as a single
value of empirical distribution and not a frequency of it.
If you want this program running with empirical frequency
distribution you must delete in each one program " N\GS / ".
Strp comments and cut here above.
------------------------------------------------------------------
%%HP: T(3)A(D)F(.);
    DIR
      @ You must enter SigmaDAT before calculation.
      \GSDAT 0
      KMO
      @ Computes the k-th moment about the origin. 
        \<< \-> k
          \<< \GSDAT OBJ\-> DROP k ^ 1 N\GS 1 -
            START SWAP k ^ +
            NEXT N\GS /
          \>>
        \>>
      KMM
      @ Computes the k-th moment about the mean.
        \<< \-> k
          \<< \GSDAT OBJ\-> DROP MEAN - k ^ 1 N\GS 1 -
            START SWAP MEAN - k ^ +
            NEXT N\GS /
          \>>
        \>>
      @ Computes the standard deviation. 
      Sdev
        \<< 2 KMM \v/ \>>
      @ Computes the Skewness index.
      SKEW
        \<< 3 KMM Sdev 3 ^ /
          "\Gmc\179=E{X\179}+2\Gm\179-3\GmE{X\178}"
          \->TAG
        \>>
      @ Computes the Curtosi index.
      CURT
        \<< 4 KMM 2 KMM SQ / \>>
      @ For a given class number computes the frequencies for
      @ each class boundary. As min value for BINS use MINSigma
      @ and as value for boundary range use 
      @ (MAXSigma-MINSigma)/(Number of class).
      NCLASS
        \<< \-> CL
          \<< MAX\GS MIN\GS - CL / \-> DCL
            \<< MIN\GS DCL CL BINS DROP
              ARRY\-> DROP { 1 CL } \->ARRY DUP DUP SIZE
              N\GS CON ADIVB { \GSPAR } PURGE
            \>>
          \>>
        \>>
      @ Divide each element of an array a for each element of a
      @ same dimension array b. (Used from NCLASS)
      ADIVB
        \<< \-> TMP
          \<< ARRY\-> LIST\-> DROP \-> I
            \<< I
              FOR K I ROLL TMP { 1 K } GET /
              NEXT { 1 I } \->ARRY
            \>>
          \>>
        \>>
    END
------------------------------------------------------------------
Luca Radice Politecnico di Milano ele9050@cdc835.cdc.polimi.it