sum.sqerror {dse1} | R Documentation |
Calculate a weighted sum squared prediction errors for a parameterization.
sum.sqerror(parms, model=NULL, data=NULL, error.weights=c(1,1,1,1))
para |
A vector of parameters. |
model |
An object of class TSmodel which gives the structure of the model to which
para is applied. model$parms should be the same length as para. |
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+parms(model), model=TSmodel(model), data=TSdata(model), error.weights=c(1,1,10))