[R-SIG-Finance] Random numbers with positive skewness
spencer.graves at prodsyse.com
Mon Jul 20 16:55:11 CEST 2009
I believe that GARCH models tend to fit real data better than a
normal, and GARCH with a skewed t often fits even better. I'm not
absolutely certain, but I believe a skewed t distribution can be
estimated with the "garchFit" function in the "fGarch" package. If it
were my problem, I'd try "garchFit" to several real data set using a
skewed t before I used simulation. Then you could simulate more numbers
To look for capabilities in R for historical price data, I did the
hpd <- RSiteSearch.function('historical price data')
This found 10 help pages in 8 contributed packages containing the
indicated search term and displayed the results in a browser.
Hope this helps.
James Toll wrote:
> I've been debating how to go about acquiring the historical data
> necessary to backtest an indexing idea and I finally decided that
> maybe I should first try it out on some randomly generated time series
> data. So, for starters, I need to generate 100 time series to
> represent 100 different equities, like, for example, the OEX. To take
> the place of 10 years of closing prices, I thought I could simply
> generate 2520 price relatives using something along the lines of this:
> x <- rnorm(2520, mean = 1, sd = 0.02)
> But obviously, it's not likely that each of the components of a cap
> weighted index of 100 equities is going to have price relatives with
> an SD of 0.02. So I'd like to be able to vary the SD for each. I
> thought I could just as easily randomly generate a vector of SD's for
> use in generating each time series like so:
> y<-rnorm(100, mean = 0.025, sd = 0.007)
> The problem I'm running into is that when generating the SD's for each
> of the 100 time series my wild guess is that the mean might be
> somewhere between 0.02 and 0.03, and I think the SD might be somewhere
> around 0.007, but I don't think a normal distribution really works at
> all. I think I need a lot of positive skewness to the distribution.
> BTW, all of these wild guesses are simply based upon my experience as
> an option market maker (which may be worthless to this task), and
> there are lots of equities that normally trade between 30 and 50
> volatility, but then I've also traded tech stocks with vols around 80
> and 90. So basically I think the bulk of the distribution of SD's is
> between 0.02 and 0.03, they taper off on the left side around 0.01,
> maybe a little lower, but then on the right side the long tail goes up
> to around 0.06. If my assumptions / conclusions are totally off base
> please feel free to tell me. This is definitely my first attempt at
> any kind of backtesting.
> Is there some other method of generating random numbers that will
> allow me to control the skewness of the distribution? Thanks.
> R-SIG-Finance at stat.math.ethz.ch mailing list
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
More information about the R-SIG-Finance