by billmil » Thu Mar 10, 2011 7:53 pm
Does anyone know about implementing the new Filardo procedure for estimating an MS model with time-varying probabilities? I have version 8 of RATS, and I follow all of the commands in Filardo, but I get an error message about missing operands. In particular, I do the following:
compute nlags=4
*
source msvarsetup.src
compute gstart=1948:6,gend=1992:8
@MSVARSetup(lags=nlags)
# g
dec equation p1eq p2eq
dec vector v1 v2
nonlin(parmset=tv) v1 v2
function %MSVARPmat time
type rect %MSVARPmat
type int time
*
local integer i j
local rect pexpand
local real z
*
compute p(1,1)=%(z=exp(%dot(%eqnxvector(p1eq,time),v1)),z/(1+z))
compute p(1,2)=%(z=exp(%dot(%eqnxvector(p2eq,time),v2)),1/(1+z))
compute %MSVARInitTransition()
*
if nexpand==nstates {
dim pexpand(nstates,nstates-1)
ewise pexpand(i,j)=%if(i==nstates,-1.0,i==j)
compute %MSVARPmat=pexpand*p
ewise
## SX16. Missing Operand or Adjacent Operators
>>>> ewise<<<<
I am not sure what I am doing wrong.
Thanks