Re: [R] DCC-GARCH model
Hello Marcin, did you get the answer to your questions. I have the same questions and would appreciate your help if you found the answers. Thanks, Ankur -- View this message in context: http://r.789695.n4.nabble.com/DCC-GARCH-model-tp3524387p4634776.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] DCC-GARCH model
Dear Marcin, This document should clarify your questions: http://www.google.be/url?sa=trct=jq=ccgarch%3A%20an%20r%20package%20for%20building%20multivariate%20garchsource=webcd=1ved=0CCMQFjAAurl=http%3A%2F%2Fhhs.diva-portal.org%2Fsmash%2Fget%2Fdiva2%3A320449%2FFULLTEXT02ei=8V1GT_uDDcLq8QOWyqSwDgusg=AFQjCNE36DZu4qWOK-5AlZXhlDaT_sZ1sgsig2=Z-dnG2bprPpL1FxtAuUCeA -- View this message in context: http://r.789695.n4.nabble.com/DCC-GARCH-model-tp3524387p4414223.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] DCC-GARCH model
Also see the most excellent rmgarch package from A*lexios Ghalanos *available here: https://r-forge.r-project.org/R/?group_id=339 On Thu, Feb 23, 2012 at 9:41 AM, vnatanel vnatane...@gmail.com wrote: Dear Marcin, This document should clarify your questions: http://www.google.be/url?sa=trct=jq=ccgarch%3A%20an%20r%20package%20for%20building%20multivariate%20garchsource=webcd=1ved=0CCMQFjAAurl=http%3A%2F%2Fhhs.diva-portal.org%2Fsmash%2Fget%2Fdiva2%3A320449%2FFULLTEXT02ei=8V1GT_uDDcLq8QOWyqSwDgusg=AFQjCNE36DZu4qWOK-5AlZXhlDaT_sZ1sgsig2=Z-dnG2bprPpL1FxtAuUCeA -- View this message in context: http://r.789695.n4.nabble.com/DCC-GARCH-model-tp3524387p4414223.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] DCC-GARCH model
Hello, I have a few questions concerning the DCC-GARCH model and its programming in R. So here is what I want to do: I take quotes of two indices - SP500 and DJ. And the aim is to estimate coefficients of the DCC-GARCH model for them. This is how I do it: library(tseries) p1 = get.hist.quote(instrument = ^gspc,start = 2005-01-07,end = 2009-09-04,compression = w, quote=AdjClose) p2 = get.hist.quote(instrument = ^dji,start = 2005-01-07,end = 2009-09-04,compression = w, quote=AdjClose) p = cbind(p1,p2) y = diff(log(p))*100 y[,1] = y[,1]-mean(y[,1]) y[,2] = y[,2]-mean(y[,2]) T = length(y[,1]) library(ccgarch) library(fGarch) f1 = garchFit(~ garch(1,1), data=y[,1],include.mean=FALSE) f1 = f1@fit$coef f2 = garchFit(~ garch(1,1), data=y[,2],include.mean=FALSE) f2 = f2@fit$coef a = c(f1[1], f2[1]) A = diag(c(f1[2],f2[2])) B = diag(c(f1[3], f2[3])) dccpara = c(0.2,0.6) dccresults = dcc.estimation(inia=a, iniA=A, iniB=B, ini.dcc=dccpara,dvar=y, model=diagonal) dccresults$out DCCrho = dccresults$DCC[,2] matplot(DCCrho, type='l') dccresults$out deliver me the estimated coefficients of the DCC-GARCH model. And here is my first question: How can I check if these coefficients are significant or not? How can I test them for significance? second question would be: Is this true that matplot(DCCrho, type='l') shows conditional correlation between the two indices in question? and the third one: What is actually dccpara and why do I get totally different DCC-alpha and DCC-beta coefficients if I change dccpara from c(0.2,0.6) to, let's say, c(0.01, 0.98) ? What determines which values should be chosen? Hopefully someone will find time to give me a hand. Thank you very much in advance, people of good will, for looking at/checking what I wrote and helping me. Best regards Marcin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] DCC-GARCH model
Hello, I have a few questions concerning the DCC-GARCH model and its programming in R. So here is what I want to do: I take quotes of two indices - SP500 and DJ. And the aim is to estimate coefficients of the DCC-GARCH model for them. This is how I do it: library(tseries) p1 = get.hist.quote(instrument = ^gspc,start = 2005-01-07,end = 2009-09-04,compression = w, quote=AdjClose) p2 = get.hist.quote(instrument = ^dji,start = 2005-01-07,end = 2009-09-04,compression = w, quote=AdjClose) p = cbind(p1,p2) y = diff(log(p))*100 y[,1] = y[,1]-mean(y[,1]) y[,2] = y[,2]-mean(y[,2]) T = length(y[,1]) library(ccgarch) library(fGarch) f1 = garchFit(~ garch(1,1), data=y[,1],include.mean=FALSE) f1 = f1@fit$coef f2 = garchFit(~ garch(1,1), data=y[,2],include.mean=FALSE) f2 = f2@fit$coef a = c(f1[1], f2[1]) A = diag(c(f1[2],f2[2])) B = diag(c(f1[3], f2[3])) dccpara = c(0.2,0.6) dccresults = dcc.estimation(inia=a, iniA=A, iniB=B, ini.dcc=dccpara,dvar=y, model=diagonal) dccresults$out DCCrho = dccresults$DCC[,2] matplot(DCCrho, type='l') dccresults$out deliver me the estimated coefficients of the DCC-GARCH model. And here is my first question: How can I check if these coefficients are significant or not? How can I test them for significance? second question would be: Is this true that matplot(DCCrho, type='l') shows conditional correlation between the two indices in question? and the third one: What is actually dccpara and why do I get totally different DCC-alpha and DCC-beta coefficients if I change dccpara from c(0.2,0.6) to, let's say, c(0.01, 0.98) ? What determines which values should be chosen? Hopefully someone will find time to give me a hand. Thank you very much in advance, people of good will, for looking at/checking what I wrote and helping me. Best regards Marcin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] DCC-GARCH model
Hello, I have a few questions concerning the DCC-GARCH model and its programming in R. So here is what I want to do: I take quotes of two indices - SP500 and DJ. And the aim is to estimate coefficients of the DCC-GARCH model for them. This is how I do it: library(tseries) p1 = get.hist.quote(instrument = ^gspc,start = 2005-01-07,end = 2009-09-04,compression = w, quote=AdjClose) p2 = get.hist.quote(instrument = ^dji,start = 2005-01-07,end = 2009-09-04,compression = w, quote=AdjClose) p = cbind(p1,p2) y = diff(log(p))*100 y[,1] = y[,1]-mean(y[,1]) y[,2] = y[,2]-mean(y[,2]) T = length(y[,1]) library(ccgarch) library(fGarch) f1 = garchFit(~ garch(1,1), data=y[,1],include.mean=FALSE) f1 = f1@fit$coef f2 = garchFit(~ garch(1,1), data=y[,2],include.mean=FALSE) f2 = f2@fit$coef a = c(f1[1], f2[1]) A = diag(c(f1[2],f2[2])) B = diag(c(f1[3], f2[3])) dccpara = c(0.2,0.6) dccresults = dcc.estimation(inia=a, iniA=A, iniB=B, ini.dcc=dccpara,dvar=y, model=diagonal) dccresults$out DCCrho = dccresults$DCC[,2] matplot(DCCrho, type='l') dccresults$out deliver me the estimated coefficients of the DCC-GARCH model. And here is my first question: How can I check if these coefficients are significant or not? How can I test them for significance? second question would be: Is this true that matplot(DCCrho, type='l') shows conditional correlation between the two indices in question? and the third one: What is actually dccpara and why do I get totally different DCC-alpha and DCC-beta coefficients if I change dccpara from c(0.2,0.6) to, let's say, c(0.01, 0.98) ? What determines which values should be chosen? Hopefully someone will find time to give me a hand. Thank you very much in advance, people of good will, for looking at/checking what I wrote and helping me. Best regards Marcin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] DCC-GARCH model and AR(1)-GARCH(1,1) regression model
Hello, I have a rather complex problem... I will have to explain everything in detail because I cannot solve it by myself...i just ran out of ideas. So here is what I want to do: I take quotes of two indices - SP500 and DJ. And my first aim is to estimate coefficients of the DCC-GARCH model for them. This is how I do it: library(tseries) p1 = get.hist.quote(instrument = ^gspc,start = 2005-01-07,end = 2009-09-04,compression = w, quote=AdjClose) p2 = get.hist.quote(instrument = ^dji,start = 2005-01-07,end = 2009-09-04,compression = w, quote=AdjClose) p = cbind(p1,p2) y = diff(log(p))*100 y[,1] = y[,1]-mean(y[,1]) y[,2] = y[,2]-mean(y[,2]) T = length(y[,1]) library(ccgarch) library(fGarch) f1 = garchFit(~ garch(1,1), data=y[,1],include.mean=FALSE) f1 = f1@fit$coef f2 = garchFit(~ garch(1,1), data=y[,2],include.mean=FALSE) f2 = f2@fit$coef a = c(f1[1], f2[1]) A = diag(c(f1[2],f2[2])) B = diag(c(f1[3], f2[3])) dccpara = c(0.2,0.6) dccresults = dcc.estimation(inia=a, iniA=A, iniB=B, ini.dcc=dccpara,dvar=y, model=diagonal) dccresults$out DCCrho = dccresults$DCC[,2] matplot(DCCrho, type='l') dccresults$out deliver me the estimated coefficients of the DCC-GARCH model. And here is my first question: How can I check if these coefficients are significant or not? How can I test them for significance? second question would be: Is this true that matplot(DCCrho, type='l') shows conditional correlation between the two indices in question? Ok. This would be it when it comes to DCC-GARCH. Now, using conditional correlation obtained from the DCC-GARCH model, I want to test for structural shifts in conditional correlations. To be precise, I want to test whether the conditional correlations significantly increase in the turmoil period / during the Subprime crisis. The regression model is AR(1)-GARCH(1,1), using a dummy variable specified as: *** the equations, you can find in the attachment *** where the first equation is the conditional correlation among the two indices during the Subprime crisis, Dt is a dummy variable for the turmoil period, and the second equation (hij,t) is the conditional variance of eij,t The aim is, of course, to find the estimates of the regression model on structural shifts in the conditional correlations obtained in the DCC-GARCH model. I found an information that there is no function for AR(1)-GARCH(1,1) regression model. That's why it has to be done in two steps: 1) estimate the AR parameters 2) estimate the GARCH part of the model on the residuals from the AR model And this would be my rather poor idea of how to do it... library(timeSeries) library(fSeries) step1 = arma(DCCrho, order = c(1,0), include.intercept = TRUE) step1$res step11 = na.remove(step1$res) step2 = garch (step11, order = c(1,1), include.intercept = TRUE) To be honest I have no clue how to do it. I don't even now why do I get a missing value as a result of step1 (step1$res[1]) and how to account for it? Above, I just removed it but then I have a smaller number of observations...and this is probably wrong. And then these GARCH estimates on the residuals...does that make sense at all? I know the mail is quite looong, but hopefully, someone will find time to give me a hand because I have to solve the problem and I reached the point where I cannot move forward without someone's help. There is not much information on how to apply DCC-GARCH model and AR(1)-GARCH(1,1) regression model in the Internet. Hopefully, some of you are familiar with it. Thank you very much in advance, people of good will, for looking at what I wrote and helping me. Best regards Marcin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] DCC-GARCH model and AR(1)-GARCH(1,1) regression model
Hello, I have a rather complex problem... I will have to explain everything in detail because I cannot solve it by myself...i just ran out of ideas. So here is what I want to do: I take quotes of two indices - SP500 and DJ. And my first aim is to estimate coefficients of the DCC-GARCH model for them. This is how I do it: library(tseries) p1 = get.hist.quote(instrument = ^gspc,start = 2005-01-07,end = 2009-09-04,compression = w, quote=AdjClose) p2 = get.hist.quote(instrument = ^dji,start = 2005-01-07,end = 2009-09-04,compression = w, quote=AdjClose) p = cbind(p1,p2) y = diff(log(p))*100 y[,1] = y[,1]-mean(y[,1]) y[,2] = y[,2]-mean(y[,2]) T = length(y[,1]) library(ccgarch) library(fGarch) f1 = garchFit(~ garch(1,1), data=y[,1],include.mean=FALSE) f1 = f1@fit$coef f2 = garchFit(~ garch(1,1), data=y[,2],include.mean=FALSE) f2 = f2@fit$coef a = c(f1[1], f2[1]) A = diag(c(f1[2],f2[2])) B = diag(c(f1[3], f2[3])) dccpara = c(0.2,0.6) dccresults = dcc.estimation(inia=a, iniA=A, iniB=B, ini.dcc=dccpara,dvar=y, model=diagonal) dccresults$out DCCrho = dccresults$DCC[,2] matplot(DCCrho, type='l') dccresults$out deliver me the estimated coefficients of the DCC-GARCH model. And here is my first question: How can I check if these coefficients are significant or not? How can I test them for significance? second question would be: Is this true that matplot(DCCrho, type='l') shows conditional correlation between the two indices in question? Ok. This would be it when it comes to DCC-GARCH. Now, using conditional correlation obtained from the DCC-GARCH model, I want to test for structural shifts in conditional correlations. To be precise, I want to test whether the conditional correlations significantly increase in the turmoil period / during the Subprime crisis. The regression model is AR(1)-GARCH(1,1), using a dummy variable specified as: *** the equations, you can find in the attachment *** where the first equation is the conditional correlation among the two indices during the Subprime crisis, Dt is a dummy variable for the turmoil period, and the second equation (hij,t) is the conditional variance of eij,t The aim is, of course, to find the estimates of the regression model on structural shifts in the conditional correlations obtained in the DCC-GARCH model. I found an information that there is no function for AR(1)-GARCH(1,1) regression model. That's why it has to be done in two steps: 1) estimate the AR parameters 2) estimate the GARCH part of the model on the residuals from the AR model And this would be my rather poor idea of how to do it... library(timeSeries) library(fSeries) step1 = arma(DCCrho, order = c(1,0), include.intercept = TRUE) step1$res step11 = na.remove(step1$res) step2 = garch (step11, order = c(1,1), include.intercept = TRUE) To be honest I have no clue how to do it. I don't even now why do I get a missing value as a result of step1 (step1$res[1]) and how to account for it? Above, I just removed it but then I have a smaller number of observations...and this is probably wrong. And then these GARCH estimates on the residuals...does that make sense at all? I know the mail is quite looong, but hopefully, someone will find time to give me a hand because I have to solve the problem and I reached the point where I cannot move forward without someone's help. There is not much information on how to apply DCC-GARCH model and AR(1)-GARCH(1,1) regression model in the Internet. Hopefully, some of you are familiar with it. Thank you very much in advance, people of good will, for looking at what I wrote and helping me. Best regards Marcin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] DCC-GARCH model and AR(1)-GARCH(1, 1) regression model - help needed..
Hello, I have a rather complex problem... I will have to explain everything in detail because I cannot solve it by myself...i just ran out of ideas. So here is what I want to do: I take quotes of two indices - SP500 and DJ. And my first aim is to estimate coefficients of the DCC-GARCH model for them. This is how I do it: library(tseries) p1 = get.hist.quote(instrument = ^gspc,start = 2005-01-07,end = 2009-09-04,compression = w, quote=AdjClose) p2 = get.hist.quote(instrument = ^dji,start = 2005-01-07,end = 2009-09-04,compression = w, quote=AdjClose) p = cbind(p1,p2) y = diff(log(p))*100 y[,1] = y[,1]-mean(y[,1]) y[,2] = y[,2]-mean(y[,2]) T = length(y[,1]) library(ccgarch) library(fGarch) f1 = garchFit(~ garch(1,1), data=y[,1],include.mean=FALSE) f1 = f1@fit$coef f2 = garchFit(~ garch(1,1), data=y[,2],include.mean=FALSE) f2 = f2@fit$coef a = c(f1[1], f2[1]) A = diag(c(f1[2],f2[2])) B = diag(c(f1[3], f2[3])) dccpara = c(0.2,0.6) dccresults = dcc.estimation(inia=a, iniA=A, iniB=B, ini.dcc=dccpara,dvar=y, model=diagonal) dccresults$out DCCrho = dccresults$DCC[,2] matplot(DCCrho, type='l') dccresults$out deliver me the estimated coefficients of the DCC-GARCH model. And here is my first question: How can I check if these coefficients are significant or not? How can I test them for significance? second question would be: Is this true that matplot(DCCrho, type='l') shows conditional correlation between the two indices in question? Ok. This would be it when it comes to DCC-GARCH. Now, using conditional correlation obtained from the DCC-GARCH model, I want to test for structural shifts in conditional correlations. To be precise, I want to test whether the conditional correlations significantly increase in the turmoil period / during the Subprime crisis. The regression model is AR(1)-GARCH(1,1), using a dummy variable specified as where the first equation is the conditional correlation among the two indices during the Subprime crisis, Dt is a dummy variable for the turmoil period, and the second equation (hij,t) is the conditional variance of eij,t The aim is, of course, to find the estimates of the regression model on structural shifts in the conditional correlations obtained in the DCC-GARCH model. I found an information that there is no function for AR(1)-GARCH(1,1) regression model. That's why it has to be done in two steps: 1) estimate the AR parameters 2) estimate the GARCH part of the model on the residuals from the AR model And this would be my rather poor idea of how to do it... library(timeSeries) library(fSeries) step1 = arma(DCCrho, order = c(1,0), include.intercept = TRUE) step1$res step11 = na.remove(step1$res) step2 = garch (step11, order = c(1,1), include.intercept = TRUE) To be honest I have no clue how to do it. I don't even now why do I get a missing value as a result of step1 (step1$res[1]) and how to account for it? Above, I just removed it but then I have a smaller number of observations...and this is probably wrong. And then these GARCH estimates on the residuals...does that make sense at all? I know the mail is quite looong, but hopefully, someone will find time to give me a hand because I have to solve the problem and I reached the point where I cannot move forward without someone's help. There is not much information on how to apply DCC-GARCH model and AR(1)-GARCH(1,1) regression model in the Internet. Hopefully, some of you are familiar with it. Thank you very much in advance, people of good will, for looking at what I wrote and helping me. Best regards Marcin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] DCC Garch model estimation
Hi all: I am a master student writing my master thesis about using the DCC garch model analysing the correlation between the insurance stock market and the local market. Right now I have a question about how to estimate the DCC garch, I know all the other meanings of the arguments in the ccgarch package, but still dont know how to estimate the dcc.para in the function dcc.estimation with for example two columns of time series returns. Can you tell me how to get the dcc.para matrix in R? Really thanks. Best Regards. Wenkai Li liwenkai1...@hotmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.