public class LMProblem extends Object
Constructor and Description |
---|
LMProblem(LMProblem that)
Copy constructor.
|
LMProblem(Vector y,
Matrix X)
Constructs a linear regression problem, assuming
a constant term (the intercept)
equal weights assigned to all observations
|
LMProblem(Vector y,
Matrix X,
boolean intercept)
Constructs a linear regression problem, assuming equal weights to all observations.
|
LMProblem(Vector y,
Matrix X,
boolean intercept,
Vector weights)
Constructs a linear regression problem.
|
LMProblem(Vector y,
Matrix X,
Vector weights)
Constructs a linear regression problem, assuming a constant term (the intercept).
|
Modifier and Type | Method and Description |
---|---|
ImmutableMatrix |
A()
Gets the regressor matrix.
|
protected void |
checkInputs()
Checks whether this
LMProblem instance is valid. |
boolean |
intercept()
Checks if an intercept term is added to the linear regression.
|
ImmutableMatrix |
invOfwAtwA()
(wA' * wA)-1
|
int |
nExogenousFactors()
Gets the number of factors, excluding the intercept.
|
int |
nFactors()
Gets the number of factors, including the intercept if any.
|
int |
nObs()
Gets the number of observations.
|
ImmutableMatrix |
wA()
Gets the weighted regressor matrix.
|
ImmutableVector |
weights()
Gets the weights assigned to each observation.
|
ImmutableVector |
wy()
Gets the weighted response vector.
|
ImmutableMatrix |
X()
Gets the factor matrix.
|
ImmutableVector |
y()
Gets the response vector, the regressands, the dependent variables.
|
public LMProblem(Vector y, Matrix X, boolean intercept, Vector weights)
y
- the dependent variablesX
- the factorsintercept
- true
if to additionally add an intercept term to the linear
regressionweights
- the weights assigned to each observationpublic LMProblem(Vector y, Matrix X, Vector weights)
y
- the dependent variablesX
- the factorsweights
- the weights assigned to each observationpublic LMProblem(Vector y, Matrix X, boolean intercept)
y
- the dependent variablesX
- the factorsintercept
- true
if to additionally add an intercept term to the linear
regressionpublic LMProblem(Vector y, Matrix X)
y
- the dependent variablesX
- the factorspublic LMProblem(LMProblem that)
that
- another LMProblem
public int nObs()
public int nFactors()
public ImmutableVector y()
public ImmutableVector wy()
public ImmutableMatrix A()
public ImmutableMatrix wA()
public boolean intercept()
true
if an intercept term is addedpublic ImmutableVector weights()
public int nExogenousFactors()
public ImmutableMatrix X()
public ImmutableMatrix invOfwAtwA()
protected void checkInputs()
LMProblem
instance is valid.IllegalArgumentException
- if this problem is invalidCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.