-
Notifications
You must be signed in to change notification settings - Fork 0
regobj
Rafat Hussain edited this page Apr 22, 2015
·
8 revisions
reg_object obj = reg_init(N,p); // Initialize REG object
// N - Size of Data Vectors (All vectors are assumed to have same length)
// p - Number of Regression Variables (>= 2). In the simple Univariate case( Y ~ b0 + b1 * X + u) , p = 2
For multiple regressions p > 2
int N;// Size of Data vectors
int p;// Total Number of Parameters (>= 2)
double alpha;// Confidence Interval For Parameters And Residual Variance (1.0 - obj->alpha) * 100
double sigma;// Residual variance
double sigma_lower;// Residual variance Lower Limit
double sigma_upper;// Residual variance Upper Limit
double r2;// R-Squared
double r2adj;// Adjusted R-Squared
double R2[2];// R2[0] = r2, R2[1] = r2adj
int df;// degree of freedom
double TSS;// Total Sum Of Squares
double ESS;// Expected Sum Of Squares
double RSS;// Residual Sum Of Squares
int df_ESS;// df due to Regression
int df_RSS;// df due to Residuals
double FStat;// F Statistics
double PVal;// P Values (F)
bparam beta[1]; // Regression Parameters object beta ( p Parameters) . See below
double value;// Parameter Value. ith Parameter value can be accessed by [ (obj->beta+i)->value ]
double lower;// Parameter Lower Limit [ (obj->beta+i)->lower ]
double upper;// Parameter Upper Limit [ (obj->beta+i)->upper ]
double stdErr;// Parameter Standard Error. [ (obj->beta+i)->stdErr ]
void regress(reg_object obj, double *x, double *y, double *res, double *varcovar, double alpha);
// Performs Regression Y = b0 + b1 * X1 + b2 * X2 + ... + b(p-1) * X(p-1) + u
// obj - created using reg_init
// x - Independent Variables Vector of size (p-1) * N arranged as x = [x1,x2,....x(p-1)]
// y - Dependent Variable of size N
// res - residual vector of size N
// varcovar - Variance-Covariance Matrix of Size p*p
// alpha - Determines Confidence interval (1-alpha) * 100%
void regress_poly(reg_object obj, double *x, double *y, double *res, double *varcovar, double alpha);
// Performs Regression Y = b0 + b1 * X + b2 * X^2 + ... + b(p-1) * X^(p-1) + u
// obj - created using reg_init
// x - Independent Variables Vector of size N
// y - Dependent Variable of size N
// res - residual vector of size N
// varcovar - Variance-Covariance Matrix of Size p*p
// alpha - Determines Confidence interval (1-alpha) * 100%