MSVARSETUP / @msvarsetup compile error
MSVARSETUP / @msvarsetup compile error
Hi there, I am new to RATS and trying to run MS-VAR program, however I am getting these errors and will really appreciate any pointers. I have looked other codes and I cant seem to find what am doing wrong. Is there anyway I can get debug log when an error occurs? Thanks
OPEN DATA "/Users/user/Downloads/Book1.xlsx"
CALENDAR(W) 2007:12:11
DATA(FORMAT=XLSX,ORG=COLUMNS,SHEET="UK") 2007:12:11 2020:01:28 FDUKBANKS FDUKCSMGOODS FDUKELECTRICPOWER FDUKMNFG FDUKOTHERFIN FDUKSERVICECO FDUKTELECOMM FDUKSOVR
compute gstart=2007:12:11,gend=202001:28
source "/Users/user/Downloads/msvarsetup.src"
## CP18. MSSETUP is not the Name of a PROCEDURE. (Did you forget to SOURCE?)
>>>>@MSSetup(<<<<
@msvarsetup(lags=1,regimes=2)
## CP24. PROCEDURE/FUNCTION MSVARSETUP compiled with errors. Please correct
OPEN DATA "/Users/user/Downloads/Book1.xlsx"
CALENDAR(W) 2007:12:11
DATA(FORMAT=XLSX,ORG=COLUMNS,SHEET="UK") 2007:12:11 2020:01:28 FDUKBANKS FDUKCSMGOODS FDUKELECTRICPOWER FDUKMNFG FDUKOTHERFIN FDUKSERVICECO FDUKTELECOMM FDUKSOVR
compute gstart=2007:12:11,gend=202001:28
source "/Users/user/Downloads/msvarsetup.src"
## CP18. MSSETUP is not the Name of a PROCEDURE. (Did you forget to SOURCE?)
>>>>@MSSetup(<<<<
@msvarsetup(lags=1,regimes=2)
## CP24. PROCEDURE/FUNCTION MSVARSETUP compiled with errors. Please correct
Re: MSVARSETUP / @msvarsetup compile error
First (which isn't the problem you cited), you have a typo on the GEND=... (should have 2020:01:28---you're missing the first 
compute gstart=2007:12:11,gend=202001:28
Delete this line (or comment it out, either will work)
source "/Users/user/Downloads/msvarsetup.src"
@MSVARSETUP is one the procedures that gets installed with RATS---by pulling in your own copy, you may have messed up the hierarchy for the procedures.
compute gstart=2007:12:11,gend=202001:28
Delete this line (or comment it out, either will work)
source "/Users/user/Downloads/msvarsetup.src"
@MSVARSETUP is one the procedures that gets installed with RATS---by pulling in your own copy, you may have messed up the hierarchy for the procedures.
Re: MSVARSETUP / @msvarsetup compile error
Hi Tom, I still will really appreciate your help. I manage the overcome the earlier issues, however I getting missing and my data has no missing values (please see below re the error msg I get). I greatly appreciate your time.
OPEN DATA "/Users/user/Downloads/Book1.xlsx"
CALENDAR(W) 2007:12:11
DATA(FORMAT=XLSX,ORG=COLUMNS,SHEET="UK") 2007:12:11 2020:01:28 FDUKBANKS FDUKCSMGOODS FDUKELECPOWER FDUKMNFG FDUKOTHERFIN FDUKSERVICECO FDUKTELECOMM FDUKSOVR
compute gstart=2007:12:11,gend=2020:01:28
*source "/Users/user/Downloads/msvarsetup.src"
@msvarsetup(lags=1,regimes=2,switch=ch)
# FDUKBANKS FDUKCSMGOODS FDUKELECPOWER FDUKMNFG FDUKOTHERFIN FDUKSERVICECO FDUKTELECOMM FDUKSOVR
@msvarinitial gstart gend
## @MSVARInitial range of 2007:12:11 to 2020:01:28 includes 2 missing observations.
## Correct the range before estimating model.
@msvarEMgeneralsetup
do emits=1,50
@msvaremstep gstart gend
disp "Iteration" emits "Log Likelihood" %logl
end do emits
## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points
The Error Occurred At Location 307, Line 31 of MSVARMSTEP
/Users/user/Downloads/msvarsetup.src Line 1262
Called From Location 226, Line 10 of MSVAREMSTEP
/Users/user/Downloads/msvarsetup.src Line 1500
Called From Location 79, Line 2 of loop/block
OPEN DATA "/Users/user/Downloads/Book1.xlsx"
CALENDAR(W) 2007:12:11
DATA(FORMAT=XLSX,ORG=COLUMNS,SHEET="UK") 2007:12:11 2020:01:28 FDUKBANKS FDUKCSMGOODS FDUKELECPOWER FDUKMNFG FDUKOTHERFIN FDUKSERVICECO FDUKTELECOMM FDUKSOVR
compute gstart=2007:12:11,gend=2020:01:28
*source "/Users/user/Downloads/msvarsetup.src"
@msvarsetup(lags=1,regimes=2,switch=ch)
# FDUKBANKS FDUKCSMGOODS FDUKELECPOWER FDUKMNFG FDUKOTHERFIN FDUKSERVICECO FDUKTELECOMM FDUKSOVR
@msvarinitial gstart gend
## @MSVARInitial range of 2007:12:11 to 2020:01:28 includes 2 missing observations.
## Correct the range before estimating model.
@msvarEMgeneralsetup
do emits=1,50
@msvaremstep gstart gend
disp "Iteration" emits "Log Likelihood" %logl
end do emits
## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points
The Error Occurred At Location 307, Line 31 of MSVARMSTEP
/Users/user/Downloads/msvarsetup.src Line 1262
Called From Location 226, Line 10 of MSVAREMSTEP
/Users/user/Downloads/msvarsetup.src Line 1500
Called From Location 79, Line 2 of loop/block
Re: MSVARSETUP / @msvarsetup compile error
2007:12:11 isn't available as part of the range since it doesn't have the lag required by the model. It's possible that you're also missing 2007:12:11 itself if everything has been differenced. If you're not sure what the proper range is, run a one lag VAR and see what it comes up with---that would be the available range.
Re: MSVARSETUP / @msvarsetup compile error
Hi Tom,
Thanks for the suggestion. Everything is differenced... I also just did that i.e. one lag var and it suggest 2007:12:18, however when I used it, it still suggest missing one observation...any more ideas please...
Thanks for the suggestion. Everything is differenced... I also just did that i.e. one lag var and it suggest 2007:12:18, however when I used it, it still suggest missing one observation...any more ideas please...
Re: MSVARSETUP / @msvarsetup compile error
Check your data carefully. Something is probably missing a data point (probably the final data point).
Re: MSVARSETUP / @msvarsetup compile error
Hi Tom, I sincerely have looked severally...I really dont see anything...if youd be kind to have another look that would the super...
- Attachments
-
- uk.xlsx
- (54.21 KiB) Downloaded 1031 times
Re: MSVARSETUP / @msvarsetup compile error
Seems to work fine if you allow for 1 observation at the front end:
compute gstart=(2007:12:11)+1,gend=2020:01:28
@msvarsetup(lags=1,regimes=2,switch=ch)
# FDUKBANKS FDUKCSMGOODS FDUKELECPOWER FDUKMNFG FDUKOTHERFIN FDUKSERVICECO FDUKTELECOMM FDUKSOVR
@msvarinitial gstart gend
@msvarEMgeneralsetup
do emits=1,50
@msvaremstep gstart gend
compute gstart=(2007:12:11)+1,gend=2020:01:28
@msvarsetup(lags=1,regimes=2,switch=ch)
# FDUKBANKS FDUKCSMGOODS FDUKELECPOWER FDUKMNFG FDUKOTHERFIN FDUKSERVICECO FDUKTELECOMM FDUKSOVR
@msvarinitial gstart gend
@msvarEMgeneralsetup
do emits=1,50
@msvaremstep gstart gend
Re: MSVARSETUP / @msvarsetup compile error
Many Thanks Tom, its sorted out the issue...really appreciate the support. Thanks Again!
Re: MSVARSETUP / @msvarsetup compile error
Hi Tom, Can I please ask a few more questions...I get these errors and will appreciate if you can give me pointers. Many Thanks
1).
@MSVARSetModel(regime=2)
compute factor=%decomp(sigmav(2)),factor=factor*inv(%diag(%xdiag(factor)))
## MAT14. Non-invertible Matrix. Using Generalized Inverse for SYMMETRIC.
impulse(print,model=MSVARModel,results=impulses2,steps=10,factor=factor)
2). I know that the code below doesnt produce IRF graphs...Can you help with the code that does...
@MCProcessIRF(model=MSVARModel,lower=lower,upper=upper,irf=irf)
1).
@MSVARSetModel(regime=2)
compute factor=%decomp(sigmav(2)),factor=factor*inv(%diag(%xdiag(factor)))
## MAT14. Non-invertible Matrix. Using Generalized Inverse for SYMMETRIC.
impulse(print,model=MSVARModel,results=impulses2,steps=10,factor=factor)
2). I know that the code below doesnt produce IRF graphs...Can you help with the code that does...
@MCProcessIRF(model=MSVARModel,lower=lower,upper=upper,irf=irf)
Re: MSVARSETUP / @msvarsetup compile error
Are you doing MCMC estimation? You have a big model and you need to make sure that the minimum size of a partition can't get too small.shams11 wrote:Hi Tom, Can I please ask a few more questions...I get these errors and will appreciate if you can give me pointers. Many Thanks
1).
@MSVARSetModel(regime=2)
compute factor=%decomp(sigmav(2)),factor=factor*inv(%diag(%xdiag(factor)))
## MAT14. Non-invertible Matrix. Using Generalized Inverse for SYMMETRIC.
impulse(print,model=MSVARModel,results=impulses2,steps=10,factor=factor)
@MCGRAPHIRF is designed to organize "standard" graphs of impulse response functions. @MCPROCESSIRF does the calculations of the bounds, but doesn't do the graphs; in case you want to do some non-standard arrangement. MS models are a typical example of that since one usually wants to display graphs which contrast the responses in different regimes. The Balcilar-Gupta-Miller example shows an example of that.shams11 wrote: 2). I know that the code below doesnt produce IRF graphs...Can you help with the code that does...
@MCProcessIRF(model=MSVARModel,lower=lower,upper=upper,irf=irf)
Re: MSVARSETUP / @msvarsetup compile error
Hi Tom, really appreciate the support...many many thanks...
Re: MSVARSETUP / @msvarsetup compile error
Hi Tom, another question please....(I am struggling with the example you pointed) and simply using MCGRAPHIRF(model=MSVARModel,lower=lower,upper=upper,irf=irf) has returned errors...as it couldnt find lower...etc and I'm not sure how to define them...
I then attempted:
declare vect[rect] %%responses
dim %%responses(10)
source "/Users/user/Downloads/mcgraphirf.src"
impulse(noprint,model=MSVARmodel,results=impulses1,steps=10,factor=factor)
dim %%responses(10)(nvar*nvar,10)
ewise %%responses(10)(i,j)=ix=%vec(%xt(impulses,j)),ix(i)
## MAT1. Matrix IMPULSES Has Not Been Dimensioned
Can you please advice a solution. Thanks
NB
attached is an empty irf graph when I remove the options lower=lower....
I then attempted:
declare vect[rect] %%responses
dim %%responses(10)
source "/Users/user/Downloads/mcgraphirf.src"
impulse(noprint,model=MSVARmodel,results=impulses1,steps=10,factor=factor)
dim %%responses(10)(nvar*nvar,10)
ewise %%responses(10)(i,j)=ix=%vec(%xt(impulses,j)),ix(i)
## MAT1. Matrix IMPULSES Has Not Been Dimensioned
Can you please advice a solution. Thanks
NB
attached is an empty irf graph when I remove the options lower=lower....
- Attachments
-
- irfs empty.rgf
- (230 Bytes) Downloaded 1006 times
Re: MSVARSETUP / @msvarsetup compile error
@MCGraphIRF doesn't have the LOWER and UPPER options because it does the graphs itself. @MCProcessIRF doesn't have all the graphing options because it doesn't do any graphs, but just does the number crunching. The Balcilar-Gupta-Miller example uses @MCProcessIRF and then generates graphs using the output from it.shams11 wrote:Hi Tom, another question please....(I am struggling with the example you pointed) and simply using MCGRAPHIRF(model=MSVARModel,lower=lower,upper=upper,irf=irf) has returned errors...as it couldnt find lower...etc and I'm not sure how to define them...
@MCGraphIRF requires some help to produce output because this isn't a standard VAR---rather than being a 2 x 2 array, the IRF's are a 2 x 4 to allow for the shocks in each regime (2 target variables, 2 shocks/regime x 2 regimes) and the default @MCGraphIRF has no idea how to label the shocks. The Ehrmann-Ellison-Valla example does the same type of interleaved IRF's but uses @MCGraphIRF with quite a few extra options to handle the proper labeling.
Re: MSVARSETUP / @msvarsetup compile error
Hi Tom, Thanks for the explanation....I am really programming daft....
Would you really be even more kind than youve already been and write the code base my on model (below are my codes)
I truly appreciate this.
Would you really be even more kind than youve already been and write the code base my on model (below are my codes)
I truly appreciate this.
Code: Select all
OPEN DATA "/Users/user/Downloads/Book1.xlsx"
CALENDAR(W) 2007:12:18
DATA(FORMAT=XLSX,ORG=COLUMNS,SHEET="UK") 2007:12:18 2020:01:28 FDUKTELECOMM FDUKBANKS FDUKCSMGOODS FDUKELECPOWER FDUKMNFG FDUKOTHERFIN FDUKSERVICECO FDUKSOVR
compute gstart=(2007:12:18)+1,gend=2020:01:28
source "/Users/user/Downloads/msvarsetup.src"
@msvarsetup(lags=1,regimes=2,switch=ch)
# FDUKTELECOMM FDUKBANKS FDUKCSMGOODS FDUKELECPOWER FDUKMNFG FDUKOTHERFIN FDUKSERVICECO FDUKSOVR
@msvarinitial gstart gend
@msvarEMgeneralsetup
*
do emits=1,30
@msvaremstep gstart gend
disp "Iteration" emits "Log Likelihood" %logl
end do emits
*
set smoothp1 gstart gend = pstar=%MSVARMarginal(msvarptsm(t),0),pstar(1)
graph(footer="Low Persistence Mode")
# smoothp1
*
nonlin(parmset=varparms) mu phiv sigmav
nonlin(parmset=msparms) theta
gset pt_t gstart gend = %zeros(nexpand,1)
gset pt_t1 gstart gend = %zeros(nexpand,1)
frml msvarf = log(%MSVARProb(t))
@msvarinitial gstart gend
maximize(parmset=varparms+msparms,$
start=%(p=%mslogisticp(theta),pstar=%MSVARInit()),$
reject=%minvalue(MSVARTransProbs)<0.0,method=bfgs,iters=400) msvarf gstart gend
@msvarEMgeneralsetup
do emits=1,50
@msvaremstep gstart gend
disp "Iteration" emits "Log Likelihood" %logl
end do emits
set smoothp1 gstart gend = pstar=%MSVARMarginal(msvarptsm(t),0),pstar(1)
graph(footer="End of Golden Age Mode")
# smoothp1
************Save IRF’s for regime1
@MSVARSetModel(regime=1)
compute factor=%decomp(sigmav(1)),factor=factor*inv(%diag(%xdiag(factor)))
impulse(print,model=MSVARModel,results=impulses1,steps=10,factor=factor)
compute factor=%decomp(sigmav(1))
errors(print,model=MSVARModel,results=errors1,steps=10,factor=factor)
****************** Save IRF's for regime 2
@MSVARSetModel(regime=2)
compute factor=%decomp(sigmav(2)),factor=factor*inv(%diag(%xdiag(factor)))
impulse(print,model=MSVARModel,results=impulses2,steps=10,factor=factor)
compute factor=%decomp(sigmav(2))
errors(print,model=MSVARModel,results=errors2,steps=10,factor=factor)
@MCGRAPHIRF(model=MSVARModel,lower=lower,upper=upper,irf=irf)
spgraph(footer="",vfields=3,hfields=2,$