TomDoan wrote:The following will give you a count of consecutive zeroes in the series x:
set(first=(x==0.0)) zerocount = %if(x==0,zerocount{1}+1,0.0)
Following your construction, I edit my codes, and it works.
Thanks for that.
But one more issue arises in the following codes:
***Setting dummy varibles
set ssmt = t>=2010:03:31
***Setting deterministic trend
set zerocount = %if(r1{1}==0,zerocount{1}+1,0.0)
set nt = zerocount
***
set v = %variance
set u = 0.0
frml et = r1-b0-b1*v-(b2+b3*v+b4*ssmt*v)*r1{1}
frml ot = %exp(a4*ssmt+%log(1+a5*nt))
frml ht = ot*(a0+a1*u{1}**2/ot{1}+a2*v{1}/ot{1}+%if(u{1}<0.0, a3*u{1}**2/ot{1}, 0.0))
For the line frml ot, RATS keeps reporting a mistake as:
## SX22. Expected Type REAL, Got MATRIX[REAL] Instead
>>>>smt+%log(1+a5*nt))<<<<
How can this mistake be solved?
Regards,
Aixia