Problem with MSVAR estimation
-
chauhal
Problem with MSVAR estimation
Dear Tom Doan,
I have the problem with MSVAR estimation.
source msvarsetup.src
open data forex.xls
cal(weekly) 2005 6 3
data(for=xls,org=columns) 2005:6:3 2011:12:30 SG KR TL ML ID PH
compute gstart=2005:6:3, gend=2011:12:30
@msvarsetup(lags=3,states=2,switch=mh)
# SG KR TL ML ID PH
@msvarinitial gstart gend
@msvaremgeneralsetup
do emits=1,50
@msvaremstep gstart gend
disp "Iteration" emits "LOg Likelihood" %logl
end do emits
The output reports:
Iteration 1 Log Likelihood NA
The Error Occurred At Location 186, Line 19 of %MSVARINIT
Called From Location 200, Line 11 of MSVARFILTERINIT
Called From Location 82, Line 10 of MSVARFILTER
Called From Location 62, Line 9 of MSVARESTEP
Called From Location 118, Line 9 of MSVAREMSTEP
Called From Location 68, Line 2 of loop/block
## MAT14. Non-invertible Matrix. Using Generalized Inverse for SYMMETRIC
(and the same for Iteration 2-50)
Could you please tell me why the problem and how should I do to fix that.
Thank you very much!
Best wishes,
Chau Le
I have the problem with MSVAR estimation.
source msvarsetup.src
open data forex.xls
cal(weekly) 2005 6 3
data(for=xls,org=columns) 2005:6:3 2011:12:30 SG KR TL ML ID PH
compute gstart=2005:6:3, gend=2011:12:30
@msvarsetup(lags=3,states=2,switch=mh)
# SG KR TL ML ID PH
@msvarinitial gstart gend
@msvaremgeneralsetup
do emits=1,50
@msvaremstep gstart gend
disp "Iteration" emits "LOg Likelihood" %logl
end do emits
The output reports:
Iteration 1 Log Likelihood NA
The Error Occurred At Location 186, Line 19 of %MSVARINIT
Called From Location 200, Line 11 of MSVARFILTERINIT
Called From Location 82, Line 10 of MSVARFILTER
Called From Location 62, Line 9 of MSVARESTEP
Called From Location 118, Line 9 of MSVAREMSTEP
Called From Location 68, Line 2 of loop/block
## MAT14. Non-invertible Matrix. Using Generalized Inverse for SYMMETRIC
(and the same for Iteration 2-50)
Could you please tell me why the problem and how should I do to fix that.
Thank you very much!
Best wishes,
Chau Le
- Attachments
-
- forex.xls
- (74.5 KiB) Downloaded 871 times
Re: Problem with MSVAR estimation
Your GSTART isn't allowing for data points lost to lags.
-
chauhal
Re: Problem with MSVAR estimation
Dear Tom Doan,
I reduce the period to avoid gstart from data points lost to lags. But I also face the same problem (attached data).
One more issue is that how could I get the regime-dependent impulse response functions for MSVAR model?
Thank you very much for your kind help!
Best wishes,
Chau
I reduce the period to avoid gstart from data points lost to lags. But I also face the same problem (attached data).
One more issue is that how could I get the regime-dependent impulse response functions for MSVAR model?
Thank you very much for your kind help!
Best wishes,
Chau
- Attachments
-
- rforex.xls
- (74.5 KiB) Downloaded 804 times
Re: Problem with MSVAR estimation
Why would the data file be different? You need the early part of the data for the lags. Keep the original data and adjust GSTART.
-
chauhal
Re: Problem with MSVAR estimation
Dear Tom,
I try to run MSVAR on CDS data, but I got the report: NO CONVERGENCE IN 400 ITERATIONS.
I increase the mumber of iterations and reestimate the model and then I got the following information:
NO CONVERGENCE IN 536 ITERATIONS
LAST CRITERION WAS 0.0000000
SUBITERATIONS LIMIT EXCEEDED.
ESTIMATION POSSIBLY HAS STALLED OR MACHINE ROUNDOFF IS MAKING FURTHER PROGRESS DIFFICULT
TRY HIGHER SUBITERATIONS LIMIT, TIGHTER CVCRIT, DIFFERENT SETTING FOR EXACTLINE OR ALPHA ON NLPAR
RESTARTING ESTIMATION FROM LAST ESTIMATES OR DIFFERENT INITIAL GUESSES MIGHT ALSO WORK
Would you please kindly advise me how to sort out the problem. Following is the code and my data.
Thank you so much!
source msvarsetup.src
open data CDS.xls
cal(weekly) 2006 4 21
data(for=xls,org=columns) 2006:4:21 2010:9:24 TL ID PH ML KR HK US
compute gstart=2007:7:5, gend=2010:9:24
SET LTL = LOG(TL)-LOG(TL{1})
SET LID = LOG(ID)-LOG(ID{1})
SET LPH = LOG(PH)-LOG(PH{1})
SET LML = LOG(ML)-LOG(ML{1})
SET LKR = LOG(KR)-LOG(KR{1})
SET LHK = LOG(HK)-LOG(HK{1})
SET LUS = LOG(US)-LOG(US{1})
@msvarsetup(lags=2,states=2,switch=mh)
# LTL LID LPH LML LKR LHK LUS
@msvarinitial gstart gend
nonlin(parmset=varparms) mu phi sigmav
nonlin(parmset=msparms) p
frml msvarf = log(%MSVARProb(t))
maximize(parmset=varparms+msparms,start= (pstar=%MSVARInit()),reject = %msvarinittransition()==0.0,pmethod=simplex, piters=5, method=bfgs,iters=400) msvarf gstart gend
I try to run MSVAR on CDS data, but I got the report: NO CONVERGENCE IN 400 ITERATIONS.
I increase the mumber of iterations and reestimate the model and then I got the following information:
NO CONVERGENCE IN 536 ITERATIONS
LAST CRITERION WAS 0.0000000
SUBITERATIONS LIMIT EXCEEDED.
ESTIMATION POSSIBLY HAS STALLED OR MACHINE ROUNDOFF IS MAKING FURTHER PROGRESS DIFFICULT
TRY HIGHER SUBITERATIONS LIMIT, TIGHTER CVCRIT, DIFFERENT SETTING FOR EXACTLINE OR ALPHA ON NLPAR
RESTARTING ESTIMATION FROM LAST ESTIMATES OR DIFFERENT INITIAL GUESSES MIGHT ALSO WORK
Would you please kindly advise me how to sort out the problem. Following is the code and my data.
Thank you so much!
source msvarsetup.src
open data CDS.xls
cal(weekly) 2006 4 21
data(for=xls,org=columns) 2006:4:21 2010:9:24 TL ID PH ML KR HK US
compute gstart=2007:7:5, gend=2010:9:24
SET LTL = LOG(TL)-LOG(TL{1})
SET LID = LOG(ID)-LOG(ID{1})
SET LPH = LOG(PH)-LOG(PH{1})
SET LML = LOG(ML)-LOG(ML{1})
SET LKR = LOG(KR)-LOG(KR{1})
SET LHK = LOG(HK)-LOG(HK{1})
SET LUS = LOG(US)-LOG(US{1})
@msvarsetup(lags=2,states=2,switch=mh)
# LTL LID LPH LML LKR LHK LUS
@msvarinitial gstart gend
nonlin(parmset=varparms) mu phi sigmav
nonlin(parmset=msparms) p
frml msvarf = log(%MSVARProb(t))
maximize(parmset=varparms+msparms,start= (pstar=%MSVARInit()),reject = %msvarinittransition()==0.0,pmethod=simplex, piters=5, method=bfgs,iters=400) msvarf gstart gend
- Attachments
-
- CDS.xls
- (52 KiB) Downloaded 862 times
Re: Problem with MSVAR estimation
What happens if you just switch means, not means and variances? The model with switching variances has an unbounded likelihood function, and so can have numerical problems.chauhal wrote:Dear Tom,
I try to run MSVAR on CDS data, but I got the report: NO CONVERGENCE IN 400 ITERATIONS.
I increase the mumber of iterations and reestimate the model and then I got the following information:
NO CONVERGENCE IN 536 ITERATIONS
LAST CRITERION WAS 0.0000000
SUBITERATIONS LIMIT EXCEEDED.
ESTIMATION POSSIBLY HAS STALLED OR MACHINE ROUNDOFF IS MAKING FURTHER PROGRESS DIFFICULT
TRY HIGHER SUBITERATIONS LIMIT, TIGHTER CVCRIT, DIFFERENT SETTING FOR EXACTLINE OR ALPHA ON NLPAR
RESTARTING ESTIMATION FROM LAST ESTIMATES OR DIFFERENT INITIAL GUESSES MIGHT ALSO WORK
Would you please kindly advise me how to sort out the problem. Following is the code and my data.
Thank you so much!
-
chauhal
Re: Problem with MSVAR estimation
Dear Tom,
I did try to switch in mean only but still face the same problem. Would you please suggest me any other solution for this. I am really interested in modelling the switching in both mean and variance. Thanks a lot!
I did try to switch in mean only but still face the same problem. Would you please suggest me any other solution for this. I am really interested in modelling the switching in both mean and variance. Thanks a lot!
Re: Problem with MSVAR estimation
add
nlpar(derives=second)
at some point before you do the MAXIMIZE. That uses a slower, but more accurate, method of computing the numerical derivatives.
nlpar(derives=second)
at some point before you do the MAXIMIZE. That uses a slower, but more accurate, method of computing the numerical derivatives.