n_training_examples: Number of training examples

View source: R/forecasting.R

n_training_examplesR Documentation

Number of training examples

Description

It computes the number of training examples that would have a KNN model with the specified parameters.

Usage

n_training_examples(timeS, h, lags, msas = c("MIMO", "recursive"))

Arguments

timeS

A numeric vector or time series of class ts.

h

A positive integer. Number of values to forecast.

lags

An integer vector in increasing order expressing the lags used as autoregressive variables.

msas

A string indicating the Multiple-Step Ahead Strategy used when more than one value is predicted. It can be "recursive" or "MIMO" (the default).

Value

An integer.

Examples

n_training_examples(ts(1:10), h = 2, lags = 1:3, msas = "MIMO")
n_training_examples(ts(1:10), h = 2, lags = 1:3, msas = "recursive")

tsfknn documentation built on Sept. 4, 2023, 9:06 a.m.