predict.dma {fDMA} | R Documentation |
Computes Predictions from dma
Model.
Description
The function computes predictions based on the model obtained from fDMA
.
Usage
## S3 method for class 'dma'
predict(object, newdata, type, ...)
Arguments
object |
an object of |
newdata |
a |
type |
|
... |
not used |
Value
vector
of forecasted values
Examples
wti <- crudeoil[-1,1]
drivers <- (lag(crudeoil[,-1],k=1))[-1,]
ld.wti <- (diff(log(wti)))[-1,]
ld.drivers <- (diff(log(drivers)))[-1,]
m1 <- fDMA(y=ld.wti,x=ld.drivers,alpha=0.99,lambda=0.99,initvar=1,model="dma")
p1 <- predict(object=m1,newdata=ld.drivers,type="backward")
p2 <- predict(object=m1,newdata=ld.drivers[1,],type="forward")
p3 <- predict(object=m1,newdata=ld.drivers[1:3,],type="forward")
[Package fDMA version 2.2.7 Index]