1
$\begingroup$

Attempting Copula in R for Stock Returns, Bond Returns, and Inflation Rates. This is my first attempt with Copulas but I have looked many places and cannot determine what I'm doing wrong. My Marginal Distribution for Stock Returns includes negatives but my copula is non-negative? I studied math in college but somehow didn't get into stats outside of probability theory so I realize I may be making a very obvious mistake. I appreciate any help!

Here are my samples:

> EQ 1 0.2577 -0.0973 0.1476 0.1727 0.0140 0.2633 0.1462 0.0203 0.1240 0.2725 -0.0656 0.2631 0.0446 0.0706 -0.0154 0.3411 0.2026 0.3101 0.2667 0.1953 [21] -0.1014 -0.1304 -0.2337 0.2638 0.0899 0.0300 0.1362 0.0353 -0.3849 0.2345 0.1278 0.0000 0.1341 0.2960 0.1139 -0.0073 0.0954 0.1942 -0.0624 0.2888 [41] 0.1626

> FI 1 0.0271 0.0626 0.3265 0.0819 0.1515 0.2213 0.1530 0.0275 0.0789 0.1453 0.0896 0.1600 0.0740 0.0975 -0.0292 0.1846 0.0364 0.0964 0.0870 -0.0082 [21] 0.1163 0.0843 0.1026 0.0410 0.0434 0.0243 0.0433 0.0697 0.0524 0.0593 0.0654 0.0784 0.0422 -0.0202 0.0597 0.0055 0.0265 0.0354 -0.0005 0.0898 [41] 0.0732

> INF 1 0.125 0.089 0.038 0.038 0.039 0.038 0.011 0.044 0.044 0.046 0.061 0.031 0.029 0.027 0.027 0.025 0.033 0.017 0.016 0.027 0.034 0.016 0.024 0.019 0.033 0.034 0.025 [28] 0.041 0.001 0.027 0.015 0.030 0.017 0.015 0.008 0.007 0.021 0.021 0.019 0.023 0.012

I create the multivariate normal distribution: z <- mvrnorm(5000,mu=rep(0, 3),Sigma=sigma,empirical=T)

My Covariance Matrix:

         Stocks         Bonds     Inflation

Stocks 0.0249320710 1.823011e-03 1.782424e-04

Bonds 0.0018230106 4.504779e-03 9.501098e-05

Inflation 0.0001782424 9.501098e-05 4.711988e-04

Converting above to Kendall Tau:

cor(z,method='kendall')

       [,1]       [,2]       [,3]

[1,] 1.00000000 0.10960080 0.04068798

[2,] 0.10960080 1.00000000 0.04049146

[3,] 0.04068798 0.04049146 1.00000000

I then covert to the Uniform Distribution:

u <- pnorm(z)

I apply the marginal distributions:

Skew Normal for Stock Returns x1 <- qsn(u[,1], 0.30184549, 0.2588313, -3.791324)

Asymmetric Laplace for Bond Returns x2 <- qALD(u[,2], 0.05929170, 0.02179876, 0.40287827)

Asymmetric Laplace for Inflation X3 <- qALD(u[,3], 0.018981966, 0.004905255, 0.271608939)

Here's my final result that has no negatives?...

But my Skew Normal simulated stock returns sample looks like this:

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.