RegularizedRegressionModel Constructor

Definition

Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2

Overload List

RegularizedRegressionModel(IDataFrame, String)

Constructs a new LinearRegressionModel.
C#
public RegularizedRegressionModel(
	IDataFrame dataFrame,
	string formula
)

Parameters

dataFrame  IDataFrame
A IDataFrame containing the data for the regression.
formula  String
A formula that specifies the variables in the model.

Exceptions

FormatException

The formula is not in the correct format.

RegularizedRegressionModel(Vector<Double>, Vector<Double>[])

Constructs a new RegularizedRegressionModel.
C#
public RegularizedRegressionModel(
	Vector<double> dependentVariable,
	params Vector<double>[] independentVariables
)

Parameters

dependentVariable  Vector<Double>
A vector that specifies the dependent variable.
independentVariables  Vector<Double>[]
An array of vectors that contain the independent variables.

Exceptions

ArgumentNullException

dependentVariable is null.

RegularizedRegressionModel(IDataFrame, String, String[])

Constructs a new RegularizedRegressionModel.
C#
public RegularizedRegressionModel(
	IDataFrame dataFrame,
	string dependentVariable,
	params string[] independentVariables
)

Parameters

dataFrame  IDataFrame
A data frame 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.

RegularizedRegressionModel(Vector<Double>, Matrix<Double>, Boolean, Vector<Double>)

Constructs a new SimpleRegressionModel.
C#
public RegularizedRegressionModel(
	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 variable.
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

ArgumentNullException

dependentData is null.


-or-

independentData is null.

DimensionMismatchException

The number of rows of independentData is not equal to the length of dependentData.

RegularizedRegressionModel(IDataFrame, String, String[], Boolean, String)

Initializes a new instance of the RegularizedRegressionModel class
C#
public RegularizedRegressionModel(
	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

ArgumentNullException

dataFrame is null.

-or-

dependentVariable is null.

-or-

independentVariables is null.

See Also