# Tag Info

9

I found Coping With Copulas by Thorsten Schmidt really helped me to get a more basic understanding of copulas. As well as looking at some simple examples in R and thinking about different directions the transformations can happen. To answer your actual question I'll attempt to describe the steps involved as simply as I can. Let's say you use the copula ...

7

I personally use the simple Garch(1,1) for volatility filtering in the risk management area. In fact in most cases I don't even estimate the parameters, I stick 0.94 for mean reversion, 0.04 for the squared error and I get the constant by matching the series variance. My experience is that there is no point pretending to finetune parameters when vol is ...

7

The best introduction to copulas I know, i.e. with rigour and intuition, is the following. THE QUANT CLASSROOM BY ATTILIO MEUCCI A Short, Comprehensive, Practical Guide to Copulas Visually introducing a powerful risk management tool to generalize and stress-test correlations

6

In the theory of copulas you want to model a multivariate (often bivariate) distribution and keep the marginals fixed. Thus you have random variables $X$ and $Y$ with cdf $F_X(x) = P[X \le x]$ and $F_Y(y) = P[Y\le y]$ and you want to find some $F_{X,Y}(x,y) = P[X \le x, Y\le y]$ such that when you look at marginals you get $F_{X,Y}(x,\infty) = F_X(x)$ and ...

4

A multivariate normal distribution can be thought of as normal margins with a normal copula. The multivariate t is the same way, but it has t margins with a t copula and they all have the same degrees of freedom. So it has t copula dependence. It is either a spherical or an elliptical distribution. I can't think of a good reason to use a multivariate t. The ...

3

Since I think this is of interest for other people, I will post the approach I found: First, let $C_n(u_1,\ldots,u_n)$ be a $n$ - dimensional Clayton copula with generator function $F$ and inverse $F^{-1}$. Then, Generate $n$ independent r.v. from $U (0,1)$ Calculate $n-1$ derivatives of $F$, where $F_{n-1}$ denotes the $n-1$-th - order derivative of $F$ ...

3

Interesting question, as All the answers (including mine) could not be generalized unfortunately. As far as I am concerned, I use a univariate EGARCH for risk modelling purposes (Filtered Historical Simulation (FHS), etc.). 1 - EGARCH, merely because GARCH models do not take into account so-called leverage effects, which is crucial to me for skewed and ...

3

Yes you can, how depends fully on your required accuracy and also whether PC1 and PC2 are sufficient in explanatory power of the log differences of your futures contract. Also, make sure you understand the signs of the eigenvalues (sign of the PC) can be different from one experiment to the next as they are arbitrary (the values are obviously not). Here ...

3

For the two-dimensional case, the Cholesky decomposition of the covariance matrix $$\Sigma = \left( \begin{array}{c c} \sigma_1^2 & \rho \sigma_1 \sigma_2\\ \rho \sigma_1 \sigma_2 & \sigma_2^2 \end{array} \right)$$ is given by B = \left( \begin{array}{c c} \sigma_1 & 0\\ \rho \sigma_2 & \sigma_2 ...

3

PYTHON I have found this class from the statsmodels library for calculating Garch models. Unfortunately, I have not seen MGARCH class/library. Below you can see the basic information about the garch models in mentioned class from the statsmodels. Probably you have to implement it by your own in python, so this class might be used as a starting point. ...

3

Yes, it exists and it is called ccgarch package. You can install that by simply running in R install.packages("ccgarch") and learn more about that on the CRAN relative paper. Moreover, I suggest you to read this lecture hold by the author during an R conference. Hope this help.

2

How can I change this to implement FULL ARCH and GARCH parameter matrices, to capture the spillover effects? You cannot. The original paper by Engle (2002) as well as the Stata manual for the DCC-GARCH model reveal that the model admits a different form than the one represented in the equation in your question. (What you have there is a special case of a ...

2

There is a brief and not overly technical introduction here: http://prescientmuse.blogspot.co.uk/2015/01/a-brief-introduction-to-copula.html And an application of use in a trading system with full R code here: http://prescientmuse.blogspot.co.uk/2015/02/vanilla-trading-algorithm.html Hope that helps!

2

Clayton Copula-Matlab Code %% Simulations of Clayton copulas using conditional cdf %Example for theta=4 n=3000; theta=5; u=rand(1,n); y=rand(1,n); v=((y.^(1/(1+theta)).*u).^(-theta)+1-u.^(-theta)).^(-1/theta); x1=norminv(u); x2=norminv(v); plot(x1,x2,'.') Though for me, Gaussian seems uneasy, can you share a code, on how to do Gaussian Copula in ...

2

VECM-GARCH models do not seem to be implemented in R as of now. However, if you are willing to accept some simplifications, you could perhaps be fine with the existing functionality. Take, for example, the "rmgarch" package in R. It allows combining univariate conditional mean-conditional variance models with several multivariate GARCH models that take ...

2

With a multivariate normal model, the portfolio has a univariate normal distribution (mean and variance are easy), so it reduces to a scaled univariate quantile.

2

IIRC, the signs of the PC are meaningless. +/-'ive doesn't itself tell you anything. Rather, the cross-sectional, absolute max of the PCs will tell you which one is most important per item (eg: PC6 looks most important for Beta: M-3). I think 6.6a and 6.6b in Cochrane's asset pricing touch on this (https://www.youtube.com/playlist?list=...

2

...this technique works only when returns are generated from normal distributions? Yes and no. Multiplying them by $C$ will produce the correlation that you wanted, but it won't preserve the distribution in general. Remember that when we apply $C$ to a vector of i.i.d. random variables $\boldsymbol{x}$ that the resultant vector element is $\sum_j C_{ij}x_j$,...

2

Based on Quantuple comments (thank you), I fixed many mistakes and I came up with the following code: import numpy as np import scipy.stats nb_simuls = 5_000_000 # parameters from https://file.scirp.org/pdf/JMF_2014050615380663.pdf Table 1 / cell 1 S1, S2, S3 = 50, 60, 150 v1, v2, v3 = 0.3, 0.3, 0.3 rho_12, rho_23, rho_13 = 0.40, 0.20, 0.80 K = 30.0 T = ...

1

Since the correlation matrix is symetric, if you move the term (i,j), you have to do it for the term (j,i) as well Of course -> the correlation of an asset with itself is equal to 1... so it should not change You apply a downward shock (1 to 0.99) and you use the formula of finite differences

1

I guess more than multicolinearity you are running into the issue of identification. What are you exactly identifying with such a regression? You somehow need to instrument for defaults. Although your $R^2$ is high, does your regression make any sense? Take for example the coefficient on unemployment. It is negative, so that seems to imply that higher ...

1

I think the mistake is how to define $\ Y_t$. It is supposed to contain endogenous and exogenous variables. Hence, the multivariate white noise in the VAR analysis should full fill the following conditions: $E(\epsilon_t )=0$ and $E(\epsilon_t \epsilon_s^{‚})$ equals either $0$ if $t \neq s$, or $\sum{\epsilon}$ if $t=s$. In the case of $t=s$, this ...

1

I am not familiar with the QE scheme, but I think your question is more general: You want to do a multi-variate diffusion, for $n$ correlated processes. You have your instantaneous correlations matrix $R = (\rho_{i,j})_{i,j}$ where $d \langle W^i, W^j \rangle_t = \rho_{i,j} dt$, and I am assuming here you know how to simulate brownian increments for a ...

1

It is not clear from the post if you are querying for the mechanics/code for looping over the series or the appropriate critical values. I here make a comment on the latter. One of the main pitfalls when testing multiple hypotheses is the fact that a certain percentage would fail under the null (as this xkcd strip nicely illustrates https://xkcd.com/882/ ). ...

1

There a to ways that you can performe the ADF test to a data frame, first write a loop for applying the test to all the columns or use the apply function to your data. For leaving out the first column just create an other data frame like this: da=yourDataName[,-1]. the code for the ADF would be something like apply(da,2,adfTest,lags=0,type="c"). The 2 is ...

1

I suggest you to organize you explanatory variables in different matrix and then use the mvregress(...) command, that allows you to handle well the results. I tried in the past to use pre-built command for VAR but I find way simpler to organize it by myself and use usual regression commands.

1

You need to adjust your correlation matrix such that it becomes positive definite. There is an R routine that will do this for you - link. Or, if you want to do it yourself, i believe the general method is to do an eigen value decomposition, set any negative eigenvalues to zero, and then reconstruct the original matrix. If you're going to go down this ...

1

Try the mgarch package, it's available at CRAN. In this link you will find an example from Prof. Zivot.

1

I recently met the same problem and found a way to achieve it using R in Python. from rpy2.robjects import pandas2ri import rpy2.robjects as objects import numpy as np # pd_rets - a pandas dataframe of daily returns, where the column names are the tickers of stocks and index is the trading days. # compute DCC-Garch in R using rmgarch ...

1

Slight correction: the package in R is called rmgarch, not mgarch. It works well with rugarch, which provides a variety of univariate GARCH models. Both packages allow for parallelized computation on local cluster and return a nice and full set of fitted parameters, model specs, etc. I provided some additional links in this post.

Only top voted, non community-wiki answers of a minimum length are eligible