| sum.sqerror {dse1} | R Documentation |
Calculate a weighted sum squared prediction errors for a parameterization.
sum.sqerror(coefficients, model=NULL, data=NULL, error.weights=c(1,1,1,1))
coefficients |
A vector of coefficients (parameters). |
model |
an object of class TSmodel which gives the structure
of the model for which coefficients are used. coef(model) should
be the same length as coefficients. |
data |
an object of class TSdata which gives the data with which the model is to be evaluated. |
error.weights |
a vector of weights to be applied to the squared prediction errors. |
This function is primarily for use in parameter optimization, which requires that an objective function be specified by a vector of parameters.
The value of the sum squared errors for a prediction horizon given by the length of error.weights. Each period ahead is weighted by the corresponding weight in error.weights.
if(is.R()) data("eg1.DSE.data.diff", package="dse1")
model <- est.VARX.ls(eg1.DSE.data.diff)
sum.sqerror(1e-10 + coef(model), model=TSmodel(model),
data=TSdata(model), error.weights=c(1,1,10))