class TMtxLogistReg : public TMtxComponent;
Performs logistic regression.
Use TMtxLogistReg component to perform ordinary or ordinal logistic regression on dataset.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 (two categories) the model is ordinary logistic regression.
How to use TMtxLogistReg component?
- Drop a TMtxLogistReg component on the form.
- Define TMtxLogistReg::A, the matrix of independent variables.
- Define TMtxLogistReg::Y, grouping (categories) vector. Note: All values have to be integers.
- Define initial estimates for TMtxLogistReg::Theta and TMtxLogistReg::B coefficients. Alternatively you can also set TMtxLogistReg::AutoInitEstimates to true and let the algorithm calculate initial estimates for Theta and B.
- (Optionally) Set TMtxLogistReg::Tolerance to define desired B, Theta estimates precision. Set TMtxLogistReg::MaxIteration to define maximum number of iterations in main calculation loop.
- Call the TMtxLogistReg::Recalc method to trigger calculation.
Results:
- TMtxLogistReg::B : B coefficients estimates.
- TMtxLogistReg::Theta : Theta coefficients estimates.
- TMtxLogistReg::TBStdErr : Theta and B coefficients estimates standard errors.
Constructors
| Name | Description |
|---|---|
| TMtxLogistReg (2) |
Destructors
| Name | Description |
|---|---|
| ~TMtxLogistReg |
Properties
| Name | Type | Description |
|---|---|---|
| A | TMtx* | Independent variables. |
| Alpha | double | Desired significant value for the statistical tests. |
| AutoInitEstimates | bool | Automatically calculate initial estimates for regression coefficients. |
| AutoUpdate | bool | If true then changing any of the TMtxLogistReg properties will trigger the TMtxLogistReg::Recalc method. |
| B | TVec* | B coefficients estimates. |
| BlockAssign | bool | Block streaming of specific properties when storing only a "template". |
| Dirty | bool | When any of the TMtxLogistReg properties changes, this property is automatically set to true. |
| EditorActive | bool | Returns True, if the component editor is displayed. |
| MaxIteration | int | Defines one of the conditions for terminating the regression coefficient calculation. |
| Name | DewString | |
| Reference | TReferenceList* | Stores a list of components that have to be notified, when this component is destroyed. |
| TBStdErr | TVec* | Standard errors of Theta, B estimates. |
| Theta | TVec* | Theta coefficients estimates. |
| Tolerance | double | Defines one of the conditions for terminating the regression coefficient calculation. |
| Y | TVec* | Grouping variable. |
Methods
| Name | Description |
|---|---|
| AllowStreaming | Returns the negatated value of BlockAssign. |
| Assign | Assign values of all published properties from Source. |
| AssignTemplate | Assign values of "template-like" published properties from Source. |
| EditorClass | To be overriden in descendanr classses. |
| LoadFromStream | Load the component from Src stream. |
| LoadTemplateFromFile | Load a template from file. |
| LoadTemplateFromStream | Load a template from stream. |
| Recalc | Triggers logistic regression recalculation. |
| ReferenceRemoved | |
| Reset | Reset is called after loading the data from stream or file. |
| SaveTemplateToFile | Save template to file. |
| SaveTemplateToStream | Save template to stream. |
| SaveToStream | Save the component to Dst stream. |
Fields
| Name | Type | Description |
|---|---|---|
| FMin | double | |
| Iterations | int | |
| StopReason | TOptStopReason | |
| Tag | intptr_t |