Linear Regression Model Constructor
Definition
Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Overload List
Linear | Constructs a new LinearRegressionModel. |
Linear | Constructs a new LinearRegressionModel. |
Linear | Constructs a new LinearRegressionModel. |
Linear | Constructs a new LinearRegressionModel. |
Linear | Constructs a new LinearRegressionModel. |
Linear | Constructs a fitted linear regression model. |
LinearRegressionModel(Vector<Double>, Vector<Double>[])
Constructs a new LinearRegressionModel.
public LinearRegressionModel(
Vector<double> dependentVariable,
params Vector<double>[] independentVariables
)
Parameters
Exceptions
Argument | dependentVariable is null. |
LinearRegressionModel(IDataFrame, String, String)
Constructs a new LinearRegressionModel.
public LinearRegressionModel(
IDataFrame dataFrame,
string formula,
string? weightVariable = null
)
Parameters
- dataFrame IDataFrame
- A IDataFrame containing the data for the regression.
- formula String
- A formula that specifies the variables in the model.
- weightVariable String (Optional)
- (Optional.) The name of the variable that contains the case weights. May be null.
Exceptions
Argument | dataFrame is null. -or- formula is null. |
Format | The formula is not in the correct format. |
LinearRegressionModel(IDataFrame, String, String[])
Constructs a new LinearRegressionModel.
public LinearRegressionModel(
IDataFrame dataFrame,
string dependentVariable,
params string[] independentVariables
)
Parameters
- dataFrame IDataFrame
- A IDataFrame containing the data for the regression.
- dependentVariable String
- The name of the dependent variable.
- independentVariables String[]
- An array containing the names of the independent variables.
LinearRegressionModel(Vector<Double>, Matrix<Double>, Boolean, Vector<Double>)
Constructs a new LinearRegressionModel.
public LinearRegressionModel(
Vector<double> dependentData,
Matrix<double> independentData,
bool noIntercept = false,
Vector<double>? weightData = null
)
Parameters
- dependentData Vector<Double>
- A vector that contains the data for the dependent variable.
- independentData Matrix<Double>
- A matrix that contains the data for the independent variables.
- noIntercept Boolean (Optional)
- Specifies whether the intercept (constant) term should be omitted from the model.
- weightData Vector<Double> (Optional)
- (Optional.) A vector that contains the weight for each observation.
Remarks
Each column of independentData corresponds to an independent variable.
Exceptions
Argument | dependentData is null. -or- independentData is null. |
LinearRegressionModel(IDataFrame, String, String[], Boolean, String)
Constructs a new LinearRegressionModel.
public LinearRegressionModel(
IDataFrame dataFrame,
string dependentVariable,
string[] independentVariables,
bool noIntercept = false,
string? weightVariable = null
)
Parameters
- dataFrame IDataFrame
- A IDataFrame containing the data for the regression.
- dependentVariable String
- The name of the dependent variable.
- independentVariables String[]
- An array containing the names of the independent variables.
- noIntercept Boolean (Optional)
- Indicates whether a constant term should be excluded from the model. The default is false.
- weightVariable String (Optional)
- The name of the variable that contains the case weights. May be null.
Exceptions
Argument | dataFrame is null. -or- dependentVariable is null. -or- independentVariables is null. |
LinearRegressionModel(ModelInput, Vector<Double>, SymmetricMatrix<Double>, Int32, Double)
Constructs a fitted linear regression model.
public LinearRegressionModel(
ModelInput specification,
Vector<double> parameters,
SymmetricMatrix<double> covarianceMatrix,
int degreesOfFreedom,
double standardError
)
Parameters
- specification ModelInput
- parameters Vector<Double>
- covarianceMatrix SymmetricMatrix<Double>
- degreesOfFreedom Int32
- standardError Double
Remarks
Models created with this constructor do not carry any information about the source data or the fit results.