Hello,
Below are the codes for my unstructured data
I have got 2668 observations but the codes produce 2667 correlations. The first value is given as "NA". If I only write "s1 1 2668" then it does not calculate the logl. So the best result I get comes with the codes below. I would like to ask whether the correlations produced are in line with the observations and there is no skid. I mean does the
second value of correlations is the result of the first two observations and not just the first observation? Because for my dissertation I compare several methods and the results of the observations must be in line.
smpl @all
s0 1 2668
s1 2 2668
scalar pi=3.14159
series y1=usd_eur
series y2=usd_gbp
equation eq_y1.arch(1,1,m=1000,h) y1 c
equation eq_y2.arch(1,1,m=1000,h) y2 c
eq_y1.makeresids(s) z1
eq_y2.makeresids(s) z2
eq_y1.makegarch() garch1
eq_y2.makegarch() garch2
scalar var_z1=@var(z1)
scalar var_z2=@var(z2)
scalar cov_z1z2=@cov(z1,z2)
scalar corr12=@cor(z1,z2)
series var_z1t=var_z1
series var_z2t=var_z2
series cov_z1tz2t=cov_z1z2
coef(2) T
logl dcc
dcc.append @logl logl 41
dcc.append var_z1t=@nan(1-T(1)-T(2)+T(1)*(z1(-1)^2)+T(2)*var_z1t(-1),1)
dcc.append var_z2t=@nan(1-T(1)-T(2)+T(1)*(z2(-1)^2)+T(2)*var_z2t(-1),1)
dcc.append cov_z1tz2t=@nan((1-T(1)-T(2))*corr12+T(1)*z1(-1)*z2(-1)+T(2)*cov_z1tz2t(-1),1)
dcc.append pen=(var_z1t<0)+(var_z2t<0)
dcc.append rho12=cov_z1tz2t/@sqrt(@abs(var_z1t*var_z2t))
dcc.append detrRt=(1-(rho12^2))
dcc.append detrDt=@sqrt(garch1*garch2)
dcc.append pen=pen+(detrRt<0)
dcc.append detrRt=@abs(detrRt)
dcc.append logl=(-1/2)*(2*log(2*pi)+log(detrRt)+(z1^2+z2^2-2*rho12*z1*z2)/detrRt)-10*pen
smpl s1
dcc.ml(showopts, m=500, c=1e-5)
show dcc.output
graph corr.line rho12
show corr
regarding the results that mgarch dcc produces
Moderators: EViews Gareth, EViews Moderator
Re: regarding the results that mgarch dcc produces
1) You need to share your workfile and provide us with the details of your research question, if you really need to get a more definitive answer.
2) Second and third lines are missing the "sample" command.
3) Series y1 and y2 should be the returns, not the levels.
4) Since your maximum likelihood model uses the first lags of variables, you loose the first observations and therefore you define/initialize them at the outset.
5) Your estimation period for this particular method is "2 2668", so you can set this sample for other methods as well.
6) I am not sure what you are asking here, but the correlation series is determined jointly by covariance and variance series, each of which are conditionally dependent on their own past values.
2) Second and third lines are missing the "sample" command.
3) Series y1 and y2 should be the returns, not the levels.
4) Since your maximum likelihood model uses the first lags of variables, you loose the first observations and therefore you define/initialize them at the outset.
5) Your estimation period for this particular method is "2 2668", so you can set this sample for other methods as well.
6) I am not sure what you are asking here, but the correlation series is determined jointly by covariance and variance series, each of which are conditionally dependent on their own past values.
Re: regarding the results that mgarch dcc produces
Hello, my workfile and program file are attached.
My variables are ehat and ehatm. Those are residual series of autoregressive processes of two return series. The first correlation value is not produced. I will apply diebold mariano test between the results of mgarch ccc and mgarch dcc. However, the first correlation value of dcc method is not produced. On the other hand, mgarch ccc codes produce them beginning from the first observation. I am okay with that. But I must be sure that the correlations of two methods must be in line. My data is Daily. So when I do compare the correlations of two methods the correlations must come from the same day's data. The dcc's first correlation value is missing but this is the best result I got with the codes so I am okay with it. But I must be sure that the correlations produced by the dcc method belong to same day as the correlations produced by ccc method. Thus I compare the correlations produced by dcc at end of the second day with the correlation produced by ccc at the end of second day. Like wise I compare the correlations produced by dcc at end of the third day with the correlation produced by ccc at the end of third day. So on, I compare the correlations produced by dcc at end of the last day with the correlation produced by ccc at the end of last day. Only the correlations of the first day cannot be compared because dcc codes did not produce. I would be okay with this result but as I said I must be sure that the correlations produced by the dcc method belong to same day as the correlations produced by ccc method. In another saying, did the dcc not produce the value for the first day? If so, there is no problem but if it produced the first day's value and put it in the second row that would be a problem.
Thank you for your interest,
My Kindest Regards,
My variables are ehat and ehatm. Those are residual series of autoregressive processes of two return series. The first correlation value is not produced. I will apply diebold mariano test between the results of mgarch ccc and mgarch dcc. However, the first correlation value of dcc method is not produced. On the other hand, mgarch ccc codes produce them beginning from the first observation. I am okay with that. But I must be sure that the correlations of two methods must be in line. My data is Daily. So when I do compare the correlations of two methods the correlations must come from the same day's data. The dcc's first correlation value is missing but this is the best result I got with the codes so I am okay with it. But I must be sure that the correlations produced by the dcc method belong to same day as the correlations produced by ccc method. Thus I compare the correlations produced by dcc at end of the second day with the correlation produced by ccc at the end of second day. Like wise I compare the correlations produced by dcc at end of the third day with the correlation produced by ccc at the end of third day. So on, I compare the correlations produced by dcc at end of the last day with the correlation produced by ccc at the end of last day. Only the correlations of the first day cannot be compared because dcc codes did not produce. I would be okay with this result but as I said I must be sure that the correlations produced by the dcc method belong to same day as the correlations produced by ccc method. In another saying, did the dcc not produce the value for the first day? If so, there is no problem but if it produced the first day's value and put it in the second row that would be a problem.
Thank you for your interest,
My Kindest Regards,
- Attachments
-
- p1_dcc.wf1
- (470.04 KiB) Downloaded 535 times
-
- p1_dcc.prg
- (1.17 KiB) Downloaded 580 times
Re: regarding the results that mgarch dcc produces
Your results are fine. Let me emphasize the fact that the first value is not actually missing. It is the starting value, so you defined it at the outset. It is already there, if you would like to use it:
EViews also employs several initialization methods where necessary, so you do not see any missing observations in the output.
MGARCH CCC would (and should) produce a single correlation value. Other than that, yes, both CCC and DCC produce correlations that belong to the very same date.
As a side note, I am not sure whether these have anything to do with Diebold-Mariano test. DM test compares the models in terms of forecasting accuracy. It seems to me that AIC, SIC or LR would be more appropriate model comparison metrics in your case.
Code: Select all
smpl @all
show cov_z1tz2t/@sqrt(var_z1t*var_z2t)MGARCH CCC would (and should) produce a single correlation value. Other than that, yes, both CCC and DCC produce correlations that belong to the very same date.
As a side note, I am not sure whether these have anything to do with Diebold-Mariano test. DM test compares the models in terms of forecasting accuracy. It seems to me that AIC, SIC or LR would be more appropriate model comparison metrics in your case.
Re: regarding the results that mgarch dcc produces
I actually estimate the covariances indirectly through correlations values. Then I use them to forecast returns. I estimate the difference between the realized and estimated returns for two methods. There I use DM test to estimate whether this difference is significant. So for me of course, not the correlation but the covariances should belong to the same date. Sorry for the mistake in my question. So the covariances that dcc and ccc or dcc and bekk should produce covariances that belong to the very same date. Also days of covariances and the realized returns should match. Because I use those covariances in estimating the forecasted return of that particular day. So I can conduct a proper DM test.
As I understand, my results are fine and dates (days) would match.
Thank you,
Kindest Regards,
As I understand, my results are fine and dates (days) would match.
Thank you,
Kindest Regards,
Re: regarding the results that mgarch dcc produces
OK then, you seem to be all set.
Re: regarding the results that mgarch dcc produces
Thank you Trubador,
Who is online
Users browsing this forum: No registered users and 2 guests
