Learn R Programming

tsfknn (version 0.6.0)

n_training_examples: 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"))

Value

An integer.

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).

Examples

Run this code
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")

Run the code above in your browser using DataLab