home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / math / ols / linstats.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-28  |  1.6 KB  |  52 lines

  1.  
  2. /* File olse.c */
  3.  
  4. /* OLS Engine.
  5.  
  6. This module is steeped in a certain notation, and assumptions
  7. about data structures.
  8.  
  9. X is the data matrix.  It is one observation per row.  Each row
  10. is a set of r.h.s. variables.  The last variable on each row is
  11. the l.h.s. variable (commonly called y).
  12.  
  13. beta is the vector of OLS coefficients.  S is the vector of
  14. standard errors about these.
  15. */
  16.  
  17. void MakeXpX (float **data, double **XpX, int K, int ObsNum);
  18. /* Given matrix data ObsNum rows by K cols, computes the
  19.     X'X matrix using the first (K-1) variables. */
  20.  
  21. void MakeXpy (float **data, double **Xpy, int K, int ObsNum);
  22. /* Assuming y is the K'th column of data, computes X'y */
  23.  
  24. void Predict (float **data, double *beta, float *Yhat,
  25.           int K, int ObsNum);
  26. /* Given a matrix data, a vector of OLS coefficients beta,
  27.     computes a vector of predictions Yhat */
  28.  
  29. void ANOVA (float **data, float *Yhat, int K, int ObsNum,
  30.         double *sigma2, double *R2, double *F);
  31. /* Given true y (K'th col of data) and predictions Yhat,
  32.     computes sigma2, R2 and F */
  33.  
  34. int olsengine (int noinference, float **data, int K, int ObsNum,
  35.            double *beta, double *S,
  36.            double *sigma2, double *R2, double *F,
  37.            float *Yhat);
  38.  
  39. /* Blackbox which does OLS.  Computations only, no IO.
  40.     Inputs:
  41.         noinference, data, K, ObsNum
  42.     Outputs:
  43.         beta, S, sigma2, R2, F, Yhat.
  44.  
  45.     If noinference, then beta is computed but no inference is
  46.     done.  sigma2 is MSE.  F is the test that all beta are
  47.     simultaneously 0.  Yhat is vector of predictions.
  48.  
  49.     beta, S and Yhat are vectors.  Caller must allocate!
  50.  
  51.     */
  52.