Learn R Programming

dynmix (version 2.1)

convts: Renames Selected Outcomes of mixest and tvpreg Objects.

Description

This function renames rows of selected outcomes stored in mixest and tvpreg objects. It can be useful in generating better looking plots.

Usage

convts(x,ind=NULL, ...)

Value

object of the same class as x but with renamed rownames of selected outcomes

Arguments

x

object of class mixest or tvpreg

ind

optional, character consisting of names of time points, should have the same length as the forecasted time-series

...

optional, alternatively, instead of providing ind, arguments of seq.Date can be specified

Examples

Run this code
# \donttest{
data(oil)
t1 <- tvp.reg(y=oil[,1,drop=FALSE],x=oil[,-1,drop=FALSE],lambda=0.99,V=100,W=100)
plot(t1)

t1a <- convts(x=t1,from=as.Date("1998-02-01"),by="month",length.out=nrow(oil[,1,drop=FALSE]))
plot(t1a)

m1 <- mixest1(y=oil[,1,drop=FALSE],x=oil[,-1,drop=FALSE],ftype=1,V=100,W=100)
plot(m1)

ind <- as.character(seq(from=as.Date("1998-02-01"),by="month",length.out=nrow(oil[,1,drop=FALSE])))
m1a <- convts(x=m1,ind=ind)
plot(m1a)
# }

Run the code above in your browser using DataLab