| setData {yuima} | R 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
|
x |
an object of type |
delta |
If there is the need to redefine on the fly the |
t0 |
the time origin for the internal |
Details
Objects in the yuima.data-class contain two slots:
original.data:The slot
original.datacontains, as the name suggests, a copy of the original data passed to the functionsetData. It is intended for backup purposes.zoo.data:the function
setDatatries to convertoriginal.datainto an object of classzoo. The coercedzoodata are stored in the slotzoo.data. If the conversion fails the function exits with an error. Internally, the yuima package stores and operates onzoo-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 |
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)