setData: Set and access data of an object of type "yuima.data" or...

View source: R/yuima.data.R

setDataR Documentation

Set and access data of an object of type "yuima.data" or "yuima".

Description

setData constructs an object of yuima.data-class.

get.zoo.data returns the content of the zoo.data slot of a yuima.data-class object. (Note: value is a list of zoo objects).

plot plot method for object of yuima.data-class or yuima-class.

dim returns the dim of the zoo.data slot of a yuima.data-class object.

length returns the length of the time series in zoo.data slot of a yuima.data-class object. cbind.yuima bind yuima.data object.

Usage

  setData(original.data, delta=NULL, t0=0)
  get.zoo.data(x)

Arguments

original.data

some type of data, usually some sort of time series. The function always tries to convert to the input data into an object of zoo-type. See Details.

x

an object of type yuima.data-class or yuima-class.

delta

If there is the need to redefine on the fly the delta increment of the data to make it consistent to statistical theory. See Details.

t0

the time origin for the internal zoo.data slot, defaults to 0.

Details

Objects in the yuima.data-class contain two slots:

original.data:

The slot original.data contains, as the name suggests, a copy of the original data passed to the function setData. It is intended for backup purposes.

zoo.data:

the function setData tries to convert original.data into an object of class zoo. The coerced zoo data are stored in the slot zoo.data. If the conversion fails the function exits with an error. Internally, the yuima package stores and operates on zoo-type objects.

The function get.zoo.data returns the content of the slot zoo.data of x if x is of yuima.data-class or the content of x@data@zoo.data if x is of yuima-class.

Value

value

a list of object(s) of yuima.data-class for setData. The content of the zoo.data slot for get.zoo.data

Author(s)

The YUIMA Project Team

Examples

X <- ts(matrix(rnorm(200),100,2))
mydata <- setData(X)
str(get.zoo.data(mydata))
dim(mydata)
length(mydata)
plot(mydata)

# exactly the same output
mysde <- setYuima(data=setData(X))
str(get.zoo.data(mysde))
plot(mysde)
dim(mysde)
length(mysde)

# changing delta on the fly to 1/252
mysde2 <- setYuima(data=setData(X, delta=1/252))
str(get.zoo.data(mysde2))
plot(mysde2)
dim(mysde2)
length(mysde2)

# changing delta on the fly to 1/252 and shifting time to t0=1
mysde2 <- setYuima(data=setData(X, delta=1/252, t0=1))
str(get.zoo.data(mysde2))
plot(mysde2)
dim(mysde2)
length(mysde2)



yuima documentation built on Nov. 14, 2022, 3:02 p.m.

Related to setData in yuima...