[R-SIG-Finance] Fitting and testing copula-functions

JohnnyPaper brad.saterfiel at gmail.com
Mon Apr 15 11:22:42 CEST 2013


Hi,

There are some rather quick workarounds to answer your problems I can assure
you. Here are a couple of steps, but I warn you...you had better know what
type of game you are playing with copulas and their limitations. By the way
if step 1 or 2 sounds strange to you, stop then and go back to learning more
before you mess with this stuff. 

1) Pick a time frame and distribution...a la GEV family or maybe Laplace or
Cauchy or whatever floats your boat. 

2) Normalize that on [0,1] for the unit hypercube. (Some data I just looked
at from someone was returns only for SP, Goog and BRKb or something. Those
were definitely not CDFs.)  

3) Use the package CDVine for hours weeks and months of enjoyment. (Save
yourself a ton of time and read the documentation about 10 times so you are
thoroughly aware of what is available to you in the package.) It should
contain everything you fellas are looking for...including some very high
level stuff, hence the "Vine", should you really wanna mash it up. 

4) Don't forget to take the inverse of the CDF later. (Quantile Function)
And voila.

If you are just looking to fit a copula though, steps 1-3 should do you
fine.  You just need to think about storing the parameters for your fitted
distributions dynamically if you wanna run a very large universe through a
backtest or say get some hypothetical pairs or a full portfolio to trade the
next day. Possibly need to look at packages doParallel and doSNOW for use of
%dopar% if you plan on running super granular data. Ok ok ok...that's enough
and if you're truly ready for this stuff (Copulas) in my opinion, then that
should have been all the help you needed. Good luck fellas. 

*It is also very late so I hope there aren't any dumb mistakes in that
explanation off the top of my head. I haven't messed with copulas & R in
several months. 

Best,

Brad




--
View this message in context: http://r.789695.n4.nabble.com/Fitting-and-testing-copula-functions-tp929814p4664233.html
Sent from the Rmetrics mailing list archive at Nabble.com.



More information about the R-SIG-Finance mailing list