I am trying to estimate the joint distribution of stock returns using the copula
package. I have read a couple of papers on copulae, but alas my lack of math knowledge prevents me from understanding beyond the basics if that! I am thinking of estimating the joint distribution using the following steps and have a couple of questions about the process in general:
- Download stock prices for two companies
- Convert prices to continuous returns
- Transform returns to marginal uniform distribution.
- How do I do this??
- Create the copula object
- When creating the Copula object using
ellipCopula()
orarchmCopula()
, I need to specifiy the type of copula and the parameters. How do I know which copula to use? And how do I obtain the parameters... I thought the point of fitting a copula to the data was to obtain the estimated parameters, so why do I need to specify here? Am I just providing initial estimates of the parameters which are then corrected in the actual fitting?
- When creating the Copula object using
- Specifiy the bivariate distribution
- When specifying the bivariate distribution, I need to specify the margins in
mvdc()
, since, according to a number of sources, I should convert the data (returns) to uniform distributions, do I specify the margins as 'unif' in the function?
- When specifying the bivariate distribution, I need to specify the margins in
- Define the data to be fitted
- I am assuming the will be a matrix with 2 columns in this case, each column being the uniforms
- Fit the data
As you can see I am very new at this and any help would be greatly appreciated!