| estimateL {ACV} | R Documentation | 
Estimate out-of-sample loss
Description
Function estimateL() estimates the out-of-sample loss of a given algorithm on specified time-series. By default, it uses the optimal weighting scheme which exploits also the in-sample performance in order to deliver a more precise estimate than the conventional estimator.
Usage
estimateL(
  y,
  algorithm,
  m,
  h = 1,
  v = 1,
  xreg = NULL,
  lossFunction = function(y, yhat) {     (y - yhat)^2 },
  method = "optimal",
  Phi = NULL,
  bw = NULL,
  rhoLimit = 0.99,
  ...
)
Arguments
| y | Univariate time-series object. | 
| algorithm | Algorithm which is to be applied to the time-series. The object which the algorithm produces should respond to  | 
| m | Length of the window on which the algorithm should be trained. | 
| h | Number of predictions made after a single training of the algorithm. | 
| v | Number of periods by which the estimation window progresses forward once the predictions are generated. | 
| xreg | Matrix of exogenous regressors supplied to the algorithm (if applicable). | 
| lossFunction | Loss function used to compute contrasts (defaults to squared error). | 
| method | Can be set to either  | 
| Phi | User can also directly supply  | 
| bw | Bandwidth for the long run variance estimator. If  | 
| rhoLimit | Parameter  | 
| ... | Other parameters passed to the algorithm. | 
Value
List containing loss estimate and its estimated variance along with some other auxiliary information like the matrix of contrasts Phi and the weights used for computation.
Examples
set.seed(1)
y <- rnorm(40)
m <- 36
h <- 1
v <- 1
estimateL(y, forecast::Arima, m = m, h = h, v = v)