Overload List
Overload 1: void LogisticRegress(TVec *y, TVec *n, TVec *b, TMtx *A = null, double Offset = 0.0, TVec *YCalc = null, TVec *BStd = null, double Tolerance = 2.220446049250313E-16);
Logistic regression.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | y | TVec * | response vector containing binomial counts. |
| 2 | n | TVec * | number of trials for each count. Y is assumed to be binomial(p,N). |
| 3 | b | TVec * | regression parameter estimates. |
| 4 | A = null | TMtx * | matrix of covariates, including the constant vector if required. |
| 5 | Offset = 0.0 | double | offset if required. |
| 6 | YCalc = null | TVec * | fitted values. |
| 7 | BStd = null | TVec * | Regression parameter estimates errors.This is an estimate of the precision of the B estimates. |
| 8 | Tolerance = 2.220446049250313E-16 | double | Default precision for reweighted LQR. |
Remarks:
Fit logistic regression model.
Declared in Dew::Stats::Units::Regress · Dew.Stats/Units.Regress.h · Cross-compiler
Overload 2: int LogisticRegress(TVec *y, TMtx *A, TVec *B, TVec *Theta, TVec *StdErr, double &FMin, TOptStopReason &StopReason, int MaxIter = 100, double Tolerance = SQRTEPS, bool AutoInitEstimates = true);
Ordinal logistic regression.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | y | TVec * | Response levels. |
| 2 | A | TMtx * | Matrix of independent variables. It is assumed to have full column rank. |
| 3 | B | TVec * | Set it to define initial estimates for B. After the call to LogisticRegress returns regression parameter estimates for B. |
| 4 | Theta | TVec * | Set it to define initial estimates for Theta. After the call to LogisticRegress returns regression parameter estimates for Theta. |
| 5 | StdErr | TVec * | Returns Theta and B coefficients standard error. This is an estimate of the precision of the Theta and B estimates. The covariance matrix is obtained by inverting the observed information matrix evaluated at the maximum likelihood estimates. The standard errors are the square roots of the diagonal elements of this covariance matrix. |
| 6 | FMin | double & | Returns logistic log-likehood function, evaluated at minimum. |
| 7 | StopReason | TOptStopReason & | Returns why the internal Marquardt optimization method stopped. |
| 8 | MaxIter = 100 | int | Maximum number of allowed iterations in main optimisation loop. |
| 9 | Tolerance = SQRTEPS | double | Desired tolerance for optimisation minimum. |
| 10 | AutoInitEstimates = true | bool | If true then B and Theta initial estimates will be calculated. If false then you must specify initial values for B and Theta. |
Returns: number of iterations needed to converge to solution with Tolerance precision.
Remarks:
Performs logistic or ordinal logistic regression. Suppose y takes values in k ordered categories, and let p_ij be the cumulative probability that y(i) falls in the j'th category or higher. The ordinal logistic regression model is defined as:
logit(p_ij) = theta(j) + A_i'B , i = 1,..,length(Y), j = 1,..,k-1,
where A_i is the i'th row of A . The number of ordinal categories k is taken to be the number of distinct values of int)y. If k is 2 the model is ordinary logistic regression[1].
Declared in Dew::Stats::Units::Regress · Dew.Stats/Units.Regress.h · Cross-compiler