[This article was first published on FOSS Trading, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
I’ve received several requests for methods to create joint probability tables for use in LSPM’s portfolio optimization functions. Rather than continue to email this example to individuals who ask, I post it here in hopes they find it via a Google search. 😉
I’m certain there are more robust ways to estimate this table, but the code below is a start…
‘x’ is a matrix of market system returns
‘n’ is the number of bins to create for each system
‘FUN’ is the function to use to calculate the value for each bin
‘…’ are args to be passed to ‘FUN’