public class GeneralizedLinearModel extends AbstractStatisticalModel<HierarchicalStatisticalDataStructure>
Modifier and Type | Field and Description |
---|---|
protected IndividualLogLikelihood |
individualLLK |
protected LinkFunction.Type |
linkFunctionType |
protected Matrix |
matrixX |
protected Matrix |
y |
completeLLK
Modifier | Constructor and Description |
---|---|
|
GeneralizedLinearModel(DataSet dataSet,
LinkFunction.Type linkFunctionType,
java.lang.String modelDefinition)
Constructor using a vector of 0s as starting values for the parameters
|
|
GeneralizedLinearModel(DataSet dataSet,
LinkFunction.Type linkFunctionType,
java.lang.String modelDefinition,
Matrix startingBeta)
General constructor
|
protected |
GeneralizedLinearModel(GeneralizedLinearModel glm)
Constructor for derived class.
|
Modifier and Type | Method and Description |
---|---|
protected HierarchicalStatisticalDataStructure |
getDataStructureFromDataSet(DataSet dataSet)
This method returns the appropriate StatisticalDataStructure from the dataSet.
|
Matrix |
getLinearPredictions() |
LinkFunction.Type |
getLinkFunctionType()
This method returns the type of the link function.
|
Matrix |
getParameters() |
Matrix |
getPredicted()
This method returns a vector of predicted values.
|
Matrix |
getResiduals()
This method returns a vector of residuals, that is observed values minus predictions.
|
protected void |
initializeLinkFunction(LinkFunction.Type linkFunctionType) |
protected Estimator |
instantiateDefaultEstimator()
This method defines the default optimizer which is to be specific to the derived classes.
|
protected void |
setCompleteLLK()
This method sets the log-likelihood function of the model.
|
protected void |
setModelDefinition(java.lang.String modelDefinition)
This method sets the model definition and computes the appropriate matrix from the data.
|
void |
setParameters(Matrix beta) |
java.lang.String |
toString() |
doEstimation, getCompleteLogLikelihood, getConvergenceCriterion, getDataStructure, getEstimator, getModelDefinition, getOptimizerParameters, getSummary, setConvergenceCriterion, setOptimizer, setOptimizerParameters
protected LinkFunction.Type linkFunctionType
protected Matrix matrixX
protected Matrix y
protected IndividualLogLikelihood individualLLK
public GeneralizedLinearModel(DataSet dataSet, LinkFunction.Type linkFunctionType, java.lang.String modelDefinition, Matrix startingBeta)
dataSet
- the fitting datalinkFunctionType
- the type of ling function (Logit, CLogLog, ...)modelDefinition
- a String that defines the dependent variable and the effects of the modelstartingBeta
- the starting values of the parameterspublic GeneralizedLinearModel(DataSet dataSet, LinkFunction.Type linkFunctionType, java.lang.String modelDefinition)
dataSet
- the fitting datalinkFunctionType
- the type of ling function (Logit, CLogLog, ...)modelDefinition
- a String that defines the dependent variable and the effects of the modelprotected GeneralizedLinearModel(GeneralizedLinearModel glm)
public LinkFunction.Type getLinkFunctionType()
protected void setModelDefinition(java.lang.String modelDefinition) throws StatisticalDataException
AbstractStatisticalModel
setModelDefinition
in class AbstractStatisticalModel<HierarchicalStatisticalDataStructure>
modelDefinition
- a String that defines the modelStatisticalDataException
protected void initializeLinkFunction(LinkFunction.Type linkFunctionType)
public void setParameters(Matrix beta)
public Matrix getParameters()
protected Estimator instantiateDefaultEstimator()
AbstractStatisticalModel
instantiateDefaultEstimator
in class AbstractStatisticalModel<HierarchicalStatisticalDataStructure>
public java.lang.String toString()
toString
in class java.lang.Object
public Matrix getLinearPredictions()
public Matrix getPredicted()
StatisticalModel
public Matrix getResiduals()
StatisticalModel
protected HierarchicalStatisticalDataStructure getDataStructureFromDataSet(DataSet dataSet)
AbstractStatisticalModel
getDataStructureFromDataSet
in class AbstractStatisticalModel<HierarchicalStatisticalDataStructure>
dataSet
- a DataSet instanceprotected void setCompleteLLK()
AbstractStatisticalModel
setCompleteLLK
in class AbstractStatisticalModel<HierarchicalStatisticalDataStructure>