Page 2 of 2

Re: Dynamic Latent Factor Model

PostPosted: Sat Aug 20, 2011 7:56 am
by TomDoan
econometrics wrote:Hi Tom,

I have a problem with the estimated betas. I’ve run the program on my data and plotted the estimated factors with the empirical ones and it didn’t look good, the gap is too big especially the level. I thought to plot also the Diebold estimated betas with the empirical ones and see if are ok, the same behaviour. I must be doing something wrong and I can’t figure it out. The estimated level should be positive and starts at 5-6 percent in Diebold’s paper and the level that I’ve estimated is negative. I will attach the excel file just to see what betas I’ve got.
Thank you Tom.
Regards,
Rosa


Have you allowed for the fact that the model includes a separate mean parameter. The data is modelled as Y(t)=mu+Lambda F(t) + noise. The factors are supposed to be mean zero.

Re: Dynamic Latent Factor Model

PostPosted: Mon Aug 22, 2011 5:02 pm
by econometrics
Thank you Tom , it worked, really appreciating all your help!
I have another inquiry and I was trying to find information from the forum and also from your Nile files. Is about forecasting. I would like to test the out of the sample forcasting performance of the DRA model using RMSE for1 month, 6 months and 12 months ahead.How should I handle this in Rats?

I was trying :

Code: Select all
dlm(startup=%(DRASetup3()),$
a=a,sw=sw,sv=sv,c=lambda,y=%eqnxvector(yvars,t)-muy,$
presample=ergodic,method=bfgs,iters=400,type=smooth) / xstates vstates

dlm(startup=%(DRASetup3()),$
a=a,sw=sw,sv=sv,c=lambda,y=%eqnxvector(yvars,t)-muy,$
x0=xstates(2000:12),sx0=vstates(2000:12),yhat=yhat,svhat=svhat) 2001:1 2001:6

set forecast 2001:1 2001:6 = %scalar(yhat)
set stderr   2001:1 2001:6 = sqrt(%scalar(svhat))


Regards,

Rosa

Re: Dynamic Latent Factor Model

PostPosted: Sun Aug 28, 2011 12:12 pm
by TomDoan
econometrics wrote:Thank you Tom , it worked, really appreciating all your help!
I have another inquiry and I was trying to find information from the forum and also from your Nile files. Is about forecasting. I would like to test the out of the sample forcasting performance of the DRA model using RMSE for1 month, 6 months and 12 months ahead.How should I handle this in Rats?

I was trying :

Code: Select all
dlm(startup=%(DRASetup3()),$
a=a,sw=sw,sv=sv,c=lambda,y=%eqnxvector(yvars,t)-muy,$
presample=ergodic,method=bfgs,iters=400,type=smooth) / xstates vstates

dlm(startup=%(DRASetup3()),$
a=a,sw=sw,sv=sv,c=lambda,y=%eqnxvector(yvars,t)-muy,$
x0=xstates(2000:12),sx0=vstates(2000:12),yhat=yhat,svhat=svhat) 2001:1 2001:6

set forecast 2001:1 2001:6 = %scalar(yhat)
set stderr   2001:1 2001:6 = sqrt(%scalar(svhat))


Regards,

Rosa


If you're trying to forecast multiple steps, you don't want the "Y" option, as if you supply data, DLM which will keep doing the Kalman updating (rather than just prediction) for as long as it has observed data. Without the Y option, your second DLM would forecast for one to six periods ahead starting in 2001:1. If you want a string to six-period ahead forecasts, you would need to do that type of calculation in a loop over the end period of estimation and the start of forecasts.

Re: Dynamic Latent Factor Model

PostPosted: Mon Sep 05, 2011 6:00 pm
by econometrics
Tom,

I would like to thank you for all your help and guidance. You were the person that helped me when I need it the most (and the only one) and I greatly appreciate it. Wishing you all the best.

Regards,

Rosa