sum.sqerror
Calculate sum of squared prediction errors
Description
Calculate a weighted sum squared prediction errors for a parameterization.
Usage
sum.sqerror(para, model=NULL, data=NULL, error.weights=c(1,1,1,1))
Required Arguments
- para
-
A vector of parameters.
Optional Arguments
- 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. If model is not
supplied sum.sqerror looks for a globally defined object Obj.Func.ARGS with an
element named model, which should be a TSmodel.
- data
-
An object of class TSdata which gives the data with which the model is
to be evaluated. If data is not
supplied sum.sqerror looks for a globally defined object Obj.Func.ARGS with an
element named data, which should be TSdata.
- error.weights
-
A vector of weights to be applied to the squared prediction errors. If
error.weights is not
supplied sum.sqerror looks for a globally defined object Obj.Func.ARGS with an
element named error.weights.
Value
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.
Details
This function is primarily for use in parameter optimization,
which requires that an objective function be specified by a vector
of parameters. The default usage relies on a globally defined list.
See Also
Examples
return to Table of Contents