Hi,
Using the following code, I cannot retrieve the filtered probabilities. I only get the smoothed probabilities. What's the problem?
cal 1999 01 12
all 50 2012:11
open data d:\Indicat\Contrat_Eurostat\rapport_2012\final\markov\Eurocoin\eurocoin_rat.xls
data(format=xls,org=obs) / dx
source(noecho) msregression.src
@MSRegression(switch=ch,states=4) dx
# constant
compute gstart=1999:01,gend=2012:11+0
@MSRegInitial gstart gend
@MSRegEMGeneralSetup
do emits=1,100
@MSRegEMStep gstart gend
end do emits
compute p=%xsubmat(p,1,nstates-1,1,nstates)
nonlin(parmset=regparms) betas sigsqv
nonlin(parmset=msparms) p
frml logl = f=%MSRegFVec(t),fpt=%MSProb(t,f),log(fpt)
@MSFilterInit
maximize(start=%(%MSRegInitVariances(),pstar=%msinit()),$
parmset=regparms+msparms,$
method=bhhh,iters=100,print) logl gstart gend
set p1smooth gstart gend = psmooth(t)(1)
set p2smooth gstart gend = psmooth(t)(2)
set p3smooth gstart gend = psmooth(t)(3)
set p4smooth gstart gend = psmooth(t)(4)
set p1filtre gstart gend = pt_t(t)(1)
set p2filtre gstart gend = pt_t(t)(2)
set p3filtre gstart gend = pt_t(t)(3)
set p4filtre gstart gend = pt_t(t)(4)
graph(footer="Probability of Regime",max=1.0,min=0.0) 1
# p4smooth
graph(footer="Probability of Regime",max=1.0,min=0.0) 1
# p4filtre
Furthermore, adding to this program the instruction you suggested (@%mssmooth p pt_t pt_t1 psmooth)
does'nt help in anyway, end even more erases the smoothed probabilities computed earlier.
Thank for your answer