Learn R Programming

DLSSM (version 1.1.0)

DLSSM.valid: Dynamical prediction on validation dataset

Description

After we have fitted initial model, we can do validation. It is iteratively doing K-steps ahead prediction and model updating (filtering) when a new batch of data becomes available. The validation include K-steps ahead prediction of state vector and probabilities on validation interval.

Usage

DLSSM.valid(fit0, data.batched, K)

Value

pred.K:K-steps ahead predicted coefficients
pred.var.K:covariance of K-steps ahead predicted coefficients
pred.prob.K:K-steps ahead predicted probabilities

Arguments

fit0

Initial fitted model

data.batched

Batched dataset generated by function Batched()

K

Number of steps for ahead prediction

Author

Jiakun Jiang, Wei Yang and Wensheng Guo

Details

The argument fit could be object of DLSSM or DLSSM.init.

Examples

Run this code
# \donttest{
set.seed(321)
n=8000
beta0=function(t)   0.1*t-1
beta1=function(t)  cos(2*pi*t)
beta2=function(t)  sin(2*pi*t)
alph1=alph2=1
x=matrix(runif(n*4,min=-4,max=4),nrow=n,ncol=4)
t=sort(runif(n))
coef=cbind(beta0(t),beta1(t),beta2(t),rep(alph1,n),rep(alph2,n))
covar=cbind(rep(1,n),x)
linear=apply(coef*covar,1,sum)
prob=exp(linear)/(1+exp(linear))
y=as.numeric(runif(n)

Run the code above in your browser using DataLab