Original link:http://tecdat.cn/?p=23115 

In this article, we demonstrate the Copula GARCH method (in general).

1. Analog Data

First, let’s model the distribution of innovation. We chose a small sample size. Ideally, the sample size should be larger, making it easier to detect the GARCH effect.

Kendall's Tau Copula(" T ", Param = Th, Dim = D, df = Nu) SQRT ((nu.-2)/nu.) * qt(U, df = nu) # For ugarchpath(), the edge must have mean 0 and variance 1!

Now we simulate two ARMA(1,1)-GARCH(1,1) processes using the distribution of innovation that these copulas rely on.

P < -list (mu = 1, spec(varModel, meanModel, fix.pars)) # condition innovation density (or use, e.g., "STD") ## Simulate the ARMA-GARCH model with innovation ## Note: ugarchpath(): Simulate from spec; < -fitted (X) # X\_t = mu\_t + eps_t (simulated process) # StopIfNot (all.equal(X., X@path$seriesSim, check. Attributes = FALSE), ## plot(X., type = "l", xlab = "t")

2. Fitting program based on simulated data

We now show how to fit the ARMA(1,1)-GARCH(1,1) process for X (we remove the parameter fix.pars to estimate these parameters).

spec(varModel, mean.model = meanModel)
 ugarchfit(uspec, data = x))

Check the (standardized) Z, the pseudo-observed value of the residuals Z.

plot(U.)

For the edge distribution, we also assume a T-distribution, but with different degrees of freedom.

fit("t", dim = 2), data = U., method = "mpl")
Fitted = C (Estimate, nu.), True = C (Th, nu, nu.)

3. Simulate from the fitting time series model

The simulation was carried out from the fitted Copula model.

Set. The seed (271) # repeatability sapply (1: d, the function SQRT (j) ((nu \ [j \] - 2)/nu \ [j \]) * qt (U \ [j \], Df = nu \ [j \])) # # = > innovation must be standardized garch () sim (fit \ [\ [j \] \], n.s im = n, Margaret spellings im = 1,

Each resulting sequence (XtXt) is plotted.

Apply (Sim,fitted(X)) # Plot (X.. , type = "l")


The most popular insight

1. Machine Learning to Identify Changing Stock Market Conditions — Application of Hidden Markov Model (HMM)

2. GARCH-DCC model and DCC (MVT) modeling estimation in R language

3.R language Copula algorithm modeling dependency case analysis report

4.R language COPULAS and VAR analysis of financial time series data

5. Time series prediction of R language multivariate Copula GARCH model

6. Using R language to realize the neural network to predict the stock example

7. Implementation of R language for volatility prediction: ARCH model and HAR-RV model

8. How do R languages do Markov Switching Model

9. Matlab uses Copula simulation to optimize market risks