cross_validation: Cross-Validation

View source: R/ic_r.R

cross_validationR Documentation

Cross-Validation

Description

Computes the cross-validation statistic of a moving-average on a time series

Usage

cross_validation(x, coef, ...)

Arguments

x

input time series.

coef

vector of coefficients or a moving-average (moving_average()).

...

other arguments passed to the function moving_average() to convert coef to a "moving_average" object.

Details

The cross-validation statistics of a moving average (\theta_i)_{-p\leq i \leq p} on a time series (y_i)_{1\leq i \leq n} is:

\frac{1}{n-(p+q)} \sum_{t=p+1}^{n-q} \left( \frac{y_t - \sum_{i=-p}^q \theta_i y_{t+i}}{ 1-\theta_0 } \right)^2.

The function cross_validation() returns the time series (x_t)) with

x_t = \frac{y_t - \sum_{i=-p}^q \theta_i y_{t+i}}{ 1-\theta_0 }.


palatej/rjdfilters documentation built on May 8, 2023, 6:28 a.m.