[tech-spec] Monte Carlo

• From: James Sogi <jsogi@xxxxxxxxxxxxx>
• To: tech-spec@xxxxxxxxxxxxx
• Date: Sun, 29 May 2005 14:10:37 -1000

The Professor, Chair, and the master simulator use Monte Carlo techniques in recent posts on http://www.dailyspeculations.com/ to determine whether various moves are consistent with randomness or not. Will ?permute(gtools) from a wiz favorite package gregmisc ' Randomly Permute the Elements of a Vector' do the trick for the R users?

`The procedure for a Monte Carlo test  was described in dailyspec:`

"In order to address the question posed, we found the percent change over each month, and we stored it in a list. We then simulated the S&P time series by starting at the same initial value and moving to the next month's value by randomly selecting one of the percent changes in our list and using that as the current month's percent change. We sample without replacement, i.e., we use all of the same values but in a random order. We perform our algorithm on each of the simulated time series and keep track of the data. Twenty trials were performed.

Do we find a significant distinction between the actual S&P data and the simulations? "

What is the test in R to determine significant difference between actual and random, or is it as Chair summarizes, "For each simulation, there was an average rally duration. Taking the average of these yields 15 months, with 25 rallies on average. The standard deviation is 3.4 months. The actual value for the average rally duration is about 4 standard deviations away from the mean, a significant finding. This indicates that actual rallies tend to last longer than in the simulations." Is it as simple as computing the standard deviation from the mean of the random samples and not requiring a table or test?

`I would appreciate your comments and corrections.`

Other related posts:

• » [tech-spec] Monte Carlo