Forecasting of univariate time series using the PSF algorithm

Share:

Description

Takes an univariate time series and the prediction horizon as inputs.

Usage

1
psf(data, n.ahead, k = seq(2, 10), w = seq(1, 10), cycle = 24)

Arguments

data

Input univariate time series, in any format (time series (ts), vector, matrix, list, data frame).

n.ahead

The number of predicted values to be obtained.

k

The number of clusters, or a vector of candidate values to search for the optimum automatically.

w

The window size, or a vector of candidate values to search for the optimum automatically.

cycle

The number of values that conform a cycle in the time series (e.g. 24 hours per day). Only used when input data is not in time series format.

Value

A list with 3 elements:

predictions

Vector with the resulting predictions

k

Number of clusters used

w

Window size used

Examples

1
2
3
4
5
## Forecast the next 12 values of the univariate time series: nottem (package:datasets).
psf(nottem, 12)

## Forecast the next 48 values of the univariate time series: sunspots (package:datasets).
psf(sunspots, 48)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.