Panel GARCH? (Cermeno and Grier, 2006)
Re: Panel GARCH? (Cermeno and Grier, 2006)
Dear Tom,
I am getting error message as follow:
SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points
I have attached my code. I am not sure why I am getting this error message. When I viewed the data all u(n) are showing no data
best regards
M
I am getting error message as follow:
SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points
I have attached my code. I am not sure why I am getting this error message. When I viewed the data all u(n) are showing no data
best regards
M
- Attachments
-
- PANEL GARCH,h.docx
- (14.51 KiB) Downloaded 1216 times
Re: Panel GARCH? (Cermeno and Grier, 2006)
You have an extra ) after liq(&i) (character in red):
frml resid(i) = (y(&i)-b(1)-it(1)*liq(&i))-kappa(&1)*sqrt(rr(i,i))-ar(1)*yL1(&i)-ar(2)*yL2(&i))
Note that if you use the RATS editor, it color codes matching () pairs. If you put the cursor on the ) at the end, it shows no match, and if you put it on the ( before y(&i) will will show the match to be the extra one, rather than the expected ) at the overall end of the expression.
frml resid(i) = (y(&i)-b(1)-it(1)*liq(&i))-kappa(&1)*sqrt(rr(i,i))-ar(1)*yL1(&i)-ar(2)*yL2(&i))
Note that if you use the RATS editor, it color codes matching () pairs. If you put the cursor on the ) at the end, it shows no match, and if you put it on the ( before y(&i) will will show the match to be the extra one, rather than the expected ) at the overall end of the expression.
Re: Panel GARCH? (Cermeno and Grier, 2006)
Dear Tom,
Many thanks for your reply.
I removed the bracket but I am still getting the error message: ## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points. All value of u(n) are showing 'no data' when I viewd the data. is it beacuse of u values?
best regards
M
Many thanks for your reply.
I removed the bracket but I am still getting the error message: ## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points. All value of u(n) are showing 'no data' when I viewd the data. is it beacuse of u values?
best regards
M
Re: Panel GARCH? (Cermeno and Grier, 2006)
The &1 isn't what you intend (red)---it should be just 1--though I'm not sure that is a problem. However, the i,i (blue) needs to be &i,&i.
frml resid(i) = (y(&i)-b(1)-it(1)*liq(&i))-kappa(&1)*sqrt(rr(i,i))-ar(1)*yL1(&i)-ar(2)*yL2(&i))
frml resid(i) = (y(&i)-b(1)-it(1)*liq(&i))-kappa(&1)*sqrt(rr(i,i))-ar(1)*yL1(&i)-ar(2)*yL2(&i))
Re: Panel GARCH? (Cermeno and Grier, 2006)
Dear To,
Many thanks for your quick reply. I really appreciate your help.
I have adjusted but the error message still same 'SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points'
It is generating after 'nlsystem(parmset=meanparms,resids=u) gstart gend res' line. I am not sure why it is keep happing.
Best regards
M
Many thanks for your quick reply. I really appreciate your help.
I have adjusted but the error message still same 'SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points'
It is generating after 'nlsystem(parmset=meanparms,resids=u) gstart gend res' line. I am not sure why it is keep happing.
Best regards
M
Last edited by soha on Sat Jun 08, 2019 2:18 pm, edited 1 time in total.
Re: Panel GARCH? (Cermeno and Grier, 2006)
What is RR supposed to be? %SIGMA isn't defined when you create it, so there it will give an NA value when you try to use its elements.
compute rr=%sigma
display rr
*sigmasq=rr(i,i)
*
dec vect b(1) it(1) kappa(1) ar(1) ar(2)
nonlin(parmset=meanparms) b it ar kappa
do i=1,n
frml resid(i) = (y(&i)-b(1)-it(1)*liq(&i))-kappa(&1)*sqrt(rr(i,i))-ar(1)*yL1(&i)-ar(2)*yL2(&i))
end do i
compute rr=%sigma
display rr
*sigmasq=rr(i,i)
*
dec vect b(1) it(1) kappa(1) ar(1) ar(2)
nonlin(parmset=meanparms) b it ar kappa
do i=1,n
frml resid(i) = (y(&i)-b(1)-it(1)*liq(&i))-kappa(&1)*sqrt(rr(i,i))-ar(1)*yL1(&i)-ar(2)*yL2(&i))
end do i
Re: Panel GARCH? (Cermeno and Grier, 2006)
Dear Tom,
I have the following question. How can I adjust it to introduce mean effects in the mean equations for let's say only the standard deviation of xsui for example?
And second how can I introduce asymmetry in the model, if that's possible. Thank you!
I have the following question. How can I adjust it to introduce mean effects in the mean equations for let's say only the standard deviation of xsui for example?
And second how can I introduce asymmetry in the model, if that's possible. Thank you!
Code: Select all
* Mean equations
equation eqn(1) xjpn
# constant xjpn{1}
equation eqn(2) xfra
# constant xfra{1}
equation eqn(3) xsui
# constant xsui{1}]
Re: Panel GARCH? (Cermeno and Grier, 2006)
Did you mean variance effects in the mean equation? See
https://estima.com/forum/viewtopic.php?p=4438#p4438
https://estima.com/forum/viewtopic.php?p=4438#p4438
Re: Panel GARCH? (Cermeno and Grier, 2006)
Yes, thank you. How can I modify this code to work?
Code: Select all
* These will be the parameters for the mean equations. These are
* adjusted to add variance or covariance terms as needed.
*
dec vect b(n)
dec rect ar(n,n) gm(n,n)
nonlin(parmset=meanparms) b ar
*
* Mean model = VAR(1) with sqrt(h) "M" term
*
frml residv = yv-b-ar*yv{1}-gm*%sqrt(%xdiag(h))
*
gset h = %zeros(n,n)
gset yv = ||xjpn,xfra,xsui||Re: Panel GARCH? (Cermeno and Grier, 2006)
Dear all,
I understand that the model in these posts is for balanced panel datasets.
Is there an alternative for UNBALANCED panels? What would be the instructions for NLSYSTEM and MAXIMIZE for this case?
Any advise is so welcomed. Thank you.
I understand that the model in these posts is for balanced panel datasets.
Is there an alternative for UNBALANCED panels? What would be the instructions for NLSYSTEM and MAXIMIZE for this case?
Any advise is so welcomed. Thank you.
Re: Panel GARCH? (Cermeno and Grier, 2006)
Dear all,
Although hoping to find a solution to run a panel GARCH for unbalanced datasets, in the meantime, I tried to get the results for a "simple" model on a balanced dataset.
I tried with an AR(2) mean equation. See the code here: Everything works fine until line
I get the error message
I also checked h matrix with
The matrix have values for many i,i points but, at certain point, all values become NaN. See part of this matrix here: .
Where should I look for the mistake? How could I solve it?
Thank you in advance for the help.
Although hoping to find a solution to run a panel GARCH for unbalanced datasets, in the meantime, I tried to get the results for a "simple" model on a balanced dataset.
I tried with an AR(2) mean equation. See the code here: Everything works fine until line
Code: Select all
maximize(start =PGARCHInit(),parmset =meanparms+garchparms,pmethod =simplex,piters =20,method =bfgs,iters =400) logl gstart gendI checked the data and it is balanced and I have values for U(), y(), yL1() and yL2(). gstart=2 and gend=454 just before the line that produces the error.## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points
I also checked h matrix with
Code: Select all
do ii =gstart,gend
dis h(ii)
end do iiWhere should I look for the mistake? How could I solve it?
Thank you in advance for the help.
Re: Panel GARCH? (Cermeno and Grier, 2006)
You are using a mean model with two lags, so you can't start before GSTART=3 at the earliest. (If you're missing any other early data points it may be later than that.) If you continue to have a problem, you would have to attach the data set so we can see how it works with the model.
Regarding unbalanced data, GARCH models generally aren't very good at handling any sort of missing data points because they depend upon a recursion for estimating the variances.
Regarding unbalanced data, GARCH models generally aren't very good at handling any sort of missing data points because they depend upon a recursion for estimating the variances.
Re: Panel GARCH? (Cermeno and Grier, 2006)
Dear Tom,
Thank you so much for your help. What a mistake! Of course, gstart should be 3, at least.
Thanks for the reflexion about the unbalanced panel I had in mind. You are right.
I attach here my dataset (the web did not allow me to upload it in dta format): Now, maximize runs, but it does not finish the process. It gives me the following warning error message:
For instance, when I put on the TRACE option in maximize and use garchparms only, I get this:
Thank you so much for your help. What a mistake! Of course, gstart should be 3, at least.
Thanks for the reflexion about the unbalanced panel I had in mind. You are right.
I attach here my dataset (the web did not allow me to upload it in dta format): Now, maximize runs, but it does not finish the process. It gives me the following warning error message:
I tried changing the method to BHHH, specifying nlpar(derive=second), nlpar(exactline) and using parmset =garchparms in maximize...MAXIMIZE - Estimation by BFGS
NO CONVERGENCE IN 4 ITERATIONS. FINAL NORMED GRADIENT 434833.36558
ESTIMATION POSSIBLY HAS STALLED OR MACHINE ROUNDOFF IS MAKING FURTHER PROGRESS DIFFICULT
TRY DIFFERENT SETTING FOR EXACTLINE, DERIVES OR ALPHA ON NLPAR
RESTARTING ESTIMATION FROM LAST ESTIMATES OR DIFFERENT INITIAL GUESSES/PMETHOD OPTION MIGHT ALSO WORK
For instance, when I put on the TRACE option in maximize and use garchparms only, I get this:
Do you have a potential solution? Thank you so much.BFGS Optimization, Iteration 1. Function Calls 12094.
Cosine of Angle between Direction and Gradient 0.0026745. Alpha used was 0.000000
Adjusted squared norm of gradient 23873.93
Diagnostic measure (0=perfect) 0.3000
Subiterations 31. Distance scale 0.000122070
Old Function = 91391.136090 New Function = 91391.195177
BFGS Optimization, Iteration 2. Function Calls 15543.
Cosine of Angle between Direction and Gradient 0.0492812. Alpha used was 0.000000
BFGS update adjusted.
Adjusted squared norm of gradient 487189.7
Diagnostic measure (0=perfect) 1.4800
Exact Line Search. Distance scale 0.000037376
Old Function = 91391.195177 New Function = 91391.733753
New Coefficients:
5.268880e-06 -1.162761e-07 2.501623e-06 -2.894214e-07 8.623287e-07
8.797271e-06 -2.787537e-07 7.582274e-07 7.836243e-06 7.897636e-06
5.060727e-07 1.282020e-06 2.172348e-06 1.987485e-06 4.812249e-05
Re: Panel GARCH? (Cermeno and Grier, 2006)
It probably would help to scale the data by 100 as described in the User's Guide.
You should be able to attach a .dta file. However, could you post the program using the XLSX file?
You should be able to attach a .dta file. However, could you post the program using the XLSX file?
Re: Panel GARCH? (Cermeno and Grier, 2006)
Thank you Tom,
From yesterday, I'm trying the following steps (after scaling, by 100):
Doing these 3 steps, does the 2nd maximize use the outcome of the 1st one as initial values? And the 3rd, does it use as initial values what I got in the 1st and 2nd?
The first maximize converges.
The second maximize does converge if I use BHHH (it does not after 400 iterations with BFGS). But results aren't reliable (std errors are 0 for many coefficients).
If I try running the third, just after the other two maximize instructions, it tells me:
From yesterday, I'm trying the following steps (after scaling, by 100):
Code: Select all
maximize(start =PGARCHInit(),trace,parmset =meanparms,pmethod =simplex,piters =5,method =bfgs,iters =400) logl gstart gend
maximize(trace, parmset =garchparms,method =bhhh,iters =400) logl gstart gend
maximize(trace,parmset =meanparms+garchparms,method =bfgs,iters =200) logl gstart gendThe first maximize converges.
The second maximize does converge if I use BHHH (it does not after 400 iterations with BFGS). But results aren't reliable (std errors are 0 for many coefficients).
If I try running the third, just after the other two maximize instructions, it tells me:
Here you have the dta file zipped. Otherwise, the forum tells me it's rejected because it may be an attack vector: The code Thank you so much for your help...SR10 Missing Values And/Or SMPL Options Leave No Usable Data Points