createEmbedDS: Creates an embeded data set from an univariate time series

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Function for creating and embeded data set from a univariate time series given an embed size

Usage

1
createEmbedDS(s, emb=4)

Arguments

s

A univariate time series (can be a numeric vector or a xts object)

emb

The size of the embed for creating the data set (defaults to 4)

Details

The function creates a data set corresponding to the embed of a certain size of a given univariate time series.

For instance for an embed of size 3 each row of the data set will contain the value of the series at time t, t-1 and t-2.

Value

Either a matrix or a multivariate xts, depending on whether the input series is a numberic vector or a univariate xts, respectively.

Author(s)

Luis Torgo ltorgo@dcc.fc.up.pt

References

Torgo, L. (2016) Data Mining using R: learning with case studies, second edition, Chapman & Hall/CRC (ISBN-13: 978-1482234893).

http://ltorgo.github.io/DMwR2

See Also

embed

Examples

1
2
3
4
5
## A simple example with a random time series
x <- rnorm(100)
head(x)
dataSet <- createEmbedDS(x,emb=5)
head(dataSet)

ltorgo/DMwR2 documentation built on May 21, 2019, 8:41 a.m.