Тёмный

Introduction to DCC - Dynamic Conditional Correlation Models 

Dirty Quant
Подписаться 4,3 тыс.
Просмотров 11 тыс.
50% 1

Опубликовано:

 

16 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 105   
@ddzggi9396
@ddzggi9396 2 года назад
Please accept my sincere appreciation for this video! Best video about the DCC model ever!
@dirtyquant
@dirtyquant 2 года назад
Thank you very much! Glad you found it useful.
@optimizedpran1247
@optimizedpran1247 2 года назад
You are not a dirty quant. YOUR CONTENT IS CLEAN.
@dirtyquant
@dirtyquant 2 года назад
Haha. Thank you!
@cjia8520
@cjia8520 3 года назад
Thanks. The lightings, background, etc. Is really professional!
@dirtyquant
@dirtyquant 3 года назад
Thanks bud, appreciate it
@MrPumpkinhead24
@MrPumpkinhead24 3 года назад
Hi, just wanted to say thank you so much and found this video v helpful when searching for 'conditional probability'. Happy accident that lead to a great channel for quant finance and physical science research. Cheers! 🥂
@dirtyquant
@dirtyquant 3 года назад
Music to my ears! That was the plan all along. Welcome onboard :-)
@pietroaminpuddu7388
@pietroaminpuddu7388 7 месяцев назад
Thanks for the video! Just wanted to ask if in your opinion does make sense to use this to model implied volatilities, or might be better to use a multivariate OU process (with log(x)). Thanks!
@yuweibao163
@yuweibao163 3 года назад
Really clear explanation
@dirtyquant
@dirtyquant 3 года назад
Thank you
@officalencoro
@officalencoro 8 месяцев назад
thanks for the amazing video. do you have an idea how to calculate the composite likehood with pairwise method over all constituents, meaning over all neighboring paris of assets to estimate the two dcc parameters alpha and beta? i like to understand how to calculate on a big data set like you have done with the complete s&P 500. Pakel et al. (2020) - Fitting Vast Dimensional Time-Varying Covariance Models suggets to do that with pairwise likelihood. do have have an idea how to implement it in your code?
@MarcoMenon
@MarcoMenon Год назад
why computing the garch volatility you multiply that cond vola by 1600? in this part of code: 'garch_vol_df = pd.concat([pd.DataFrame(model_parameters[x].conditional_volatility/100)*1600 for x in model_parameters], axis=1)'
@dirtyquant
@dirtyquant Год назад
256 days in a year. Square root is 16. Multiplied by 100 to make 0.01 or 1% equal to 1.00 in the code. 16 x 100 = 1600 Thanks for checking!
@cjia8520
@cjia8520 3 года назад
And good knowledge! Learned something new today.
@dirtyquant
@dirtyquant 3 года назад
Yeah, you don’t see DCC very often in the wild!
@rahulkh96
@rahulkh96 Год назад
Hey.. very helpful video.. can you help me the code of DCC-MIDAS-X Model which is somewhat similar to this only.. i am unable to incorporate this model.. please help
@simranjuneja5736
@simranjuneja5736 Год назад
Thanks very helpful video. Could you please suggest how can exogenous variable X be incorporated into DCC garch model to see the impact of X on correlation of different assets
@dirtyquant
@dirtyquant Год назад
Glad you liked the video. Does the exogenous variable have a correlation with GARCH characteristics? You can’t just throw anything in there as it won’t converge. Just add it as another asset and see what it looks like. No problem in doing that. Remember we are looking at correlation of VOLATILITY, not returns.
@simranjuneja5736
@simranjuneja5736 Год назад
@@dirtyquant Thanks for replying X has garch characteristics i want to check whether variable X impact the dynamic conditional correlation of two assets..like if it has positive or negative effect
@dirtyquant
@dirtyquant Год назад
It won’t have any effect on the other 2 variables. But you can look at the time series of the DCC and I find that useful. Let me know how you get on. You can post your findings on dirtyquant.com
@marts2411
@marts2411 Год назад
Hi! First of all many thanks for your video. You clarified a lot of stuff that is a necessity for my thesis. I do run into an issue. I want to use the student's skew t distribution for my DCC-GARCH model. I have adjusted dist to 'skewt'. In the function garch_t_to_u. Also, i have added eta and lambda as parameters. Then, udata = t.cdf(std_rest, lambda). However, now opt.out.success provides a False and I do not have any estimations. Could you please let me know how I can adjust the code to use the skewed T distribution? If I make mistakes in my adjustments as explained above please let me know. Many thanks in advance!
@dirtyquant
@dirtyquant Год назад
Hi mate. Can you post this on dirtyquant.com and I will look at it later
@TooMuch742
@TooMuch742 2 года назад
Thanks for the video. Just wanted to ask what the limitations of DCC-GARCH models are?
@dirtyquant
@dirtyquant 2 года назад
Sometimes the DCC effects aren't there.... It's not a magic pill
@aarondelarosa3146
@aarondelarosa3146 8 месяцев назад
Hello. Last plot can't be executed. Something went wrong.
@dextergellizeau9330
@dextergellizeau9330 3 года назад
Thanks...Looking forward.
@dirtyquant
@dirtyquant 3 года назад
You bet!
@yi-hsuanchen5458
@yi-hsuanchen5458 Год назад
Hi , it's a really helpful video. Really appreciated :)) I have tried to walked through your code. Just have a question. If I wanna get the DCC correlation of the stocks do I just extract the Rt value? Thanks in advance.😁
@dirtyquant
@dirtyquant Год назад
Hi, yes, but that will give you the correlation of volatility, not of the returns, as it’s way more stable.
@yi-hsuanchen5458
@yi-hsuanchen5458 Год назад
@@dirtyquant Hi Dirtyquant, Thanks so much for getting beck so quickly! Is there any way that I can modify the code to get the return correlation. I tried input return instead of udata_list but the model shows not success.
@dirtyquant
@dirtyquant Год назад
The model is (likely) not going to converge if you use returns as they as far too unstable. You need to convert the returns to a uniform distribution using the appropriate CDF for that distribution. Again, I don’t think it will work as the autocorrelation of returns decays far too quickly so it will be incredibly noisy. Please try it and report back. :-)
@yi-hsuanchen5458
@yi-hsuanchen5458 Год назад
Thank you! I’ll try it out 🥹
@jeevaneducation1767
@jeevaneducation1767 Год назад
Thanks alot. Very impressive. Can you help me in VARMA-CCC-GARCH?
@alejandrovillalobos1678
@alejandrovillalobos1678 2 года назад
you are using the conditional vol of the returns?
@dirtyquant
@dirtyquant 2 года назад
Yes, we are looking at the correlation of vol, not the correlation of returns
@StiffishMedusa
@StiffishMedusa 3 года назад
I understand the basics, and could use this to interpret past data. But I am struggling conceptually with applying DCC to a simulation/forecast model. Do you have any recommended follow-up reading?
@dirtyquant
@dirtyquant 3 года назад
I am planning on doing a video on it, but look at my response here: dirtyquant.com/t/video-cholesky-decomposition-take-your-backtesting-to-the-next-level/127/4
@felipediogenes3668
@felipediogenes3668 2 года назад
Is there a similar model for dynamic correlation of returns instead ov volatilty?
@dirtyquant
@dirtyquant 2 года назад
There is no reason why you have to use GARCH. If you omit that step and just feed in returns, it should work. I think the issue is that returns are a lot more unstable compared to vol.
@chiarapalma8290
@chiarapalma8290 2 года назад
Thanks a lot for your videos! Is there a way to change your code to estimate the DCC considering the GARCH with a normal innovation density, instead of a t-distribution? I am really struggling to understand which parameters should I extract from the results of the GARCH to then get the uniform distribution.
@dirtyquant
@dirtyquant 2 года назад
Very easy. Instead of udata = t.cdf(std_res, nu) Just use the normal CDF And instead of arch_model(rets[x], dist = 't') Just change that to normal. Done!
@chiarapalma8276
@chiarapalma8276 2 года назад
@@dirtyquant thanks a lot for your kind reply, you are really making my last Master assignment a lot easier! Could you also tell which parameters should I put in the norm cdf? I mean how do I get the mean and std from the fitted GARCH model. (Amazing channel really)
@dirtyquant
@dirtyquant 2 года назад
@@chiarapalma8276 ha. Glad I can help. Well, the data going in there is standardised, so it’s already 0 means and variance of 1.
@chiarapalma8276
@chiarapalma8276 2 года назад
@@dirtyquant I see! So I just need to get the standardized residuals out of it, right? Any idea on how to do it? I tried to get the same object (std_res) from the fitted garch model with normal, but the object does not exist.
@dirtyquant
@dirtyquant 2 года назад
Because everything is in a function, and hence a local variable. It won’t appear in your list of variables. I am travelling but will give you a working example later. Try solve it yourself, you will learn a lot
@nico_brio3588
@nico_brio3588 3 года назад
thanks! very clear
@dirtyquant
@dirtyquant 3 года назад
Thank you. Glad it all made sense to you
@255sdr8
@255sdr8 2 года назад
Hi, I really enjoy the Video! Do you have a citable literature recommendation for DCC GARCH for me?
@dirtyquant
@dirtyquant 2 года назад
hdl.handle.net/2123/14728 Page 89 of the PDF onwards
@255sdr8
@255sdr8 2 года назад
@@dirtyquant Thank you, that helps a lot!
@nehalondhe9263
@nehalondhe9263 2 года назад
Thanks. It's really helpful. Can you please share that how to calculate value at risk using DCC GARCH on python.
@dirtyquant
@dirtyquant 2 года назад
Hey, yes, I have been planning to make something like that exactly, but life got in the way. Soon I promise :-)
@yi-hsuanchen5458
@yi-hsuanchen5458 Год назад
Hi, it's me again lol. Do you have any related videos that's calculating DCC forecast model? Thank you!
@dirtyquant
@dirtyquant Год назад
Hi mate. DCC automatically does 1 step ahead forecast
@yi-hsuanchen5458
@yi-hsuanchen5458 Год назад
@@dirtyquant Hi, I'm quite curious how to modify the code if I want 30 days ahead forecast. Do I just change the looping through Rt?
@aarondelarosa3146
@aarondelarosa3146 Год назад
It was really a little complicated to me to calculate DCC and CCC (Constant Conditional Correlation) in Excel. I had to use a LGARCHMLE (leveraged model) with American Indexes: Nasdaq, S&P500 and Dow Jones. However, it's gonna be very difficult to calculate it in Python. I heard that R programming is very easy to estimate it. I didn't know that DCC can be calculated in Python too. What about CCC? Your code looks complicated. Can you share it? Regards.
@dirtyquant
@dirtyquant Год назад
Link in the description to my GitHub with all the code
@minhnhatnguyen2530
@minhnhatnguyen2530 3 года назад
Thanks. Very helpful! I learn a lot from your code. I want to know about how to compute standard errors to make inferences about estimates in DCC. Could you add how to compute standard errors to your python code, please?
@dirtyquant
@dirtyquant 3 года назад
Hey, glad you liked the video and code. So the errors around the estimates really depend on your optimiser, which will give you estimates around the parameters. If you use MCMC, then you can just look at the chain and infer the errors from there.
@weavily66
@weavily66 2 года назад
On loglike_norm_dcc_copula function, why do you subtract the inverse matrix by np.eye(N) ?
@dirtyquant
@dirtyquant 2 года назад
Hey Rocky, if you look at page 135 (106 on top right) of this doc you will see the log like function for normal copula: ses.library.usyd.edu.au/bitstream/handle/2123/14728/2016_Christian_Contino_Thesis.pdf?sequence=2&isAllowed=y
@weavily66
@weavily66 2 года назад
@@dirtyquant Thank you for sharing your work. Very appreciate it. I do have a question. What if I would like to change from Multivariate Gaussian distributed errors to Multivariate t-distributed errors, how do I change the code?
@dextergellizeau9330
@dextergellizeau9330 3 года назад
Hello Master Quant, great video. Please add the code for the predicted next day DCC Volatility.
@dirtyquant
@dirtyquant 3 года назад
Easy! Let me get to it
@Septumsempra8818
@Septumsempra8818 3 года назад
Third time watching this vid, still learning. How do we simulate this?
@dirtyquant
@dirtyquant 3 года назад
I will do a video at some point, but look at this discussion, as I link to my paper on how to do it: dirtyquant.com/t/video-cholesky-decomposition-take-your-backtesting-to-the-next-level/127/3
@cedriczhou8861
@cedriczhou8861 2 года назад
Very helpful! Thank you so much!
@dirtyquant
@dirtyquant 2 года назад
Welcome mate!
@DavideSinesiJochepi
@DavideSinesiJochepi 3 года назад
Please con you do it with the DECO model
@dirtyquant
@dirtyquant 3 года назад
Hi Davide, Never heard of DECO model. will look into it. Thanks!
@DavideSinesiJochepi
@DavideSinesiJochepi 3 года назад
@@dirtyquant Why there is times 1600 in the volatility?
@dirtyquant
@dirtyquant 3 года назад
Sqrt 252 is approx 16, times 100 because the returns are tiny. So annualised, and in a scale that is more relatable.
@DavideSinesiJochepi
@DavideSinesiJochepi 3 года назад
@@dirtyquant There are no tutorial on DECO ever... Would you like to help me? stats.stackexchange.com/questions/534509/compute-conditional-equicorrelation-matrix-deco-garch-from-dcc-garch-estimatio
@FluffyTashiLai
@FluffyTashiLai 3 года назад
I've managed to get through to %time opt_out = minimize(loglike_norm_dcc_copula, np.array([0.01, 0.95]), args = (udata_list,), bounds=bnds, constraints=cons), however, I keep on getting --> ValueError: not enough values to unpack (expected 2, got 1). Need some help!!
@dirtyquant
@dirtyquant 3 года назад
what does udata_list look like? Mine looks like: [array([0.5747693 , 0.91835073, 0.25096253, ..., 0.43679173, 0.45847006, 0.60708795]), array([0.10530546, 0.9973108 , 0.6342007 , ..., 0.88912801, 0.21804338, 0.88675833]), array([0.48491891, 0.87296667, 0.37504468, ..., 0.46726709, 0.72021928, 0.20255693]), array([0.22081462, 0.07066372, 0.33594198, ..., 0.28937289, 0.6635698 , 0.9696474 ]), array([0.24902229, 0.16361277, 0.5294778 , ..., 0.61282812, 0.45911533, 0.52582611])] bnds should be: ((0, 0.5), (0, 0.9997)) cons: {'type': 'ineq', 'fun': } Have you upgraded yfinance to the latest version, 0.1.63? pip uninstall yfinance pip install yfinance --upgrade --no-cache-dir Are you using your own data or the yahoo finance data from the notebook?
@FluffyTashiLai
@FluffyTashiLai 3 года назад
how would you name ret in this case if it's data from my own excel?
@dirtyquant
@dirtyquant 3 года назад
Did you transform the data using the garch function? It shouldn’t matter, as long as the data is in a list of arrays like my udata_list
@FluffyTashiLai
@FluffyTashiLai 3 года назад
@@dirtyquant no I haven't done that yet..my udata_list is empty. My data is just a record of returns.
@dirtyquant
@dirtyquant 3 года назад
Ok, does your rets looks like a dataframe with dates as an index and stock name as the columns?
@lade_edal
@lade_edal 3 года назад
Good but could you walk through the code. That's where the real learning /value to be gained is.
@dirtyquant
@dirtyquant 3 года назад
Your wish is my command. On another video :-) You have access to the GitHub page in the description as well
@FreeMarketSwine
@FreeMarketSwine 2 года назад
How does one profit from this?
@dirtyquant
@dirtyquant 2 года назад
Pairs trading
@SohailAlam2
@SohailAlam2 3 года назад
Interesting video... thanks for sharing... loved it although not a fan of the background music.. would be 10x better without it! P.S. I consume such RU-vid videos at 1.5x or 2x and it's very annoying if there is background music :) Good luck... looking forward to more interesting stuffs
@dirtyquant
@dirtyquant 3 года назад
Thanks for watching. Glad you are enjoying the videos.
@wilkobets3300
@wilkobets3300 11 месяцев назад
Straight Outta Pandas 🤣
Далее
A Simple Introduction to Copulas
16:54
Просмотров 33 тыс.
ITZY "GOLD" M/V
03:20
Просмотров 6 млн
GARCH Model : Time Series Talk
10:25
Просмотров 160 тыс.
Time Series Analysis using Python | The GARCH Model
13:49
10.7: Dynamic Conditional Correlation (DCC) in RStudio
10:03
Time Varying Volatility and GARCH in Risk Management
6:23
Impostor Syndrome for Quants
7:58
Просмотров 846
[1hr Talk] Intro to Large Language Models
59:48
Просмотров 2,2 млн
The Metropolis-Hastings Algorithm (MCMC in Python)
20:27