# Fitting Copula and Simulation

I would greatly appreciate any insights into the problem described below, regarding using the data obtained from applying the functions of the rugarch package into those from the copula package.

1. I fitted AR(1)-GARCH(1,1) to two return series u,v of length 500 each. using rugarchfitin R.
2. I converted the residuals to uniform using pit(residuals(fit,standardize=TRUE))

3. Then, I plugged these residuals (uniform using PIT) to a copula and got the parameters.

4. I simulated 100 points (bivariate) from the fitted copula.

Now, I want to convert these 100 points which are uniformly distributed back to the originally distributed series. How can I do this? How can I convert them back to residual form and then applying the fitted AR-GARCH to get the original series form?

• Have a look at Andrew Patton's code page. – Tim Jun 22 '16 at 3:45

You need to estimate or assume a marginal distribution of the (u,v). Lets say you assume normality (don't do this), you would be able to perform a rosenblatt-transformation, to perform the task you describe.

https://en.wikipedia.org/wiki/Inverse_transform_sampling

This could be a useful resource.

You need to know what your original conditional distribution was when you fitted the AR-GARCH(1,1). Assuming that you chose a student-t distribution, the reverse transformation after step 4 in R would look as follows:

### step 1: Fit Garch

fit <- rugarchfit


### step 4: Simulate points

sim <- 'simulated 100 points'


### step 5: Convert 100 uniformly distributed points back to the originally distributed series

shape <- coef(fit)['shape']
transformed_residuals <- qdist("std", mu=0, sigma=1, sim, shape = shape)