Simulating data series using DLM
Posted: Sat Oct 27, 2007 4:33 am
Hi, I want to simulate a data series of Y that follows a state-space model:
Y=PI*S
S=M*S{1}+G*e,
where e has a identity variance-covariance matrix. I want RATS to start from S(0) as a zero vector, and simulate a Y data series. Here is what my program is and the outcome. But my simulated Y series is full of NA. What's wrong here? Thanks for your help. Best, Martin.
disp PI
0.19936 -0.19936 0.07611 -1.90270 0.00000
0.06879 -0.06879 0.03659 -0.11475 0.00000
0.00947 -0.00947 0.00878 -0.21954 0.00000
1.14430 -0.14433 0.04684 -1.81090 1.00000
0.08000 -0.08000 0.03200 0.00000 0.00000
0.00000 0.00000 0.00000 0.80000 0.00000
1.00000 0.00000 0.00000 0.00000 1.00000
disp M
1.50000 -0.50000 0.00000 0.00000 0.00000
1.00000 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.80000 0.00000 0.00000
0.00000 0.00000 0.00000 0.80000 0.00000
0.00000 0.00000 0.00000 0.00000 0.80000
disp G
1.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 1.00000 0.00000
0.00000 1.00000 0.00000 0.00000
0.00000 0.00000 0.00000 1.00000
disp vm
1.00000 0.00000 0.00000 0.00000
0.00000 1.00000 0.00000 0.00000
0.00000 0.00000 1.00000 0.00000
0.00000 0.00000 0.00000 1.00000
all 200
dlm(c=tr(PI),a=M,f=G,type=simulate,yhat=y,sw=vm)
disp y(50)
NA NA NA NA NA NA NA
Y=PI*S
S=M*S{1}+G*e,
where e has a identity variance-covariance matrix. I want RATS to start from S(0) as a zero vector, and simulate a Y data series. Here is what my program is and the outcome. But my simulated Y series is full of NA. What's wrong here? Thanks for your help. Best, Martin.
disp PI
0.19936 -0.19936 0.07611 -1.90270 0.00000
0.06879 -0.06879 0.03659 -0.11475 0.00000
0.00947 -0.00947 0.00878 -0.21954 0.00000
1.14430 -0.14433 0.04684 -1.81090 1.00000
0.08000 -0.08000 0.03200 0.00000 0.00000
0.00000 0.00000 0.00000 0.80000 0.00000
1.00000 0.00000 0.00000 0.00000 1.00000
disp M
1.50000 -0.50000 0.00000 0.00000 0.00000
1.00000 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.80000 0.00000 0.00000
0.00000 0.00000 0.00000 0.80000 0.00000
0.00000 0.00000 0.00000 0.00000 0.80000
disp G
1.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 1.00000 0.00000
0.00000 1.00000 0.00000 0.00000
0.00000 0.00000 0.00000 1.00000
disp vm
1.00000 0.00000 0.00000 0.00000
0.00000 1.00000 0.00000 0.00000
0.00000 0.00000 1.00000 0.00000
0.00000 0.00000 0.00000 1.00000
all 200
dlm(c=tr(PI),a=M,f=G,type=simulate,yhat=y,sw=vm)
disp y(50)
NA NA NA NA NA NA NA