See GNU MCSim: fredomatic.free.frHerbertSitz wrote:I'm curious what people are using to do their Monte Carlo simulations. Is there any open source stuff out there to play with?
Monte Carlo simulation software?

 Posts: 1
 Joined: Tue Nov 04, 2008 6:25 am
Re: Monte Carlo simulation software?
Monte Carlo for portfolio simulation
Hi guys:
My name is Geoff ConsidineI built Quantext Portfolio Planner. I tried to post some relevant articles, but I could not due to the filters here. I will try to explain without links.
The challenge of Monte Carlo simulation is to generate forwardlooking parameters for a portfolio. This is much harder than the basic problem of simply simulating mean, standard deviation, and covariances. You have to develop the estimates for the means and standard deviations and, on top of this, how to deal with covariancesand you don't want to just use history.
Geoff
My name is Geoff ConsidineI built Quantext Portfolio Planner. I tried to post some relevant articles, but I could not due to the filters here. I will try to explain without links.
The challenge of Monte Carlo simulation is to generate forwardlooking parameters for a portfolio. This is much harder than the basic problem of simply simulating mean, standard deviation, and covariances. You have to develop the estimates for the means and standard deviations and, on top of this, how to deal with covariancesand you don't want to just use history.
Geoff
 dothemontecarlo
 Posts: 539
 Joined: Tue Nov 06, 2007 10:19 am
 Location: Colorado
 Contact:
Re: Monte Carlo for portfolio simulation
Here's a link to Geoff's Quantext Portfolio Planner.Quantext wrote:Hi guys:
My name is Geoff ConsidineI built Quantext Portfolio Planner. I tried to post some relevant articles, but I could not due to the filters here. I will try to explain without links.
The challenge of Monte Carlo simulation is to generate forwardlooking parameters for a portfolio. This is much harder than the basic problem of simply simulating mean, standard deviation, and covariances. You have to develop the estimates for the means and standard deviations and, on top of this, how to deal with covariancesand you don't want to just use history.
Geoff
Geoff, how, if at all, do you model mean reversion in your simulation? Do you assume that returns are lognormally distributed? That returns are completely independent of past returns?
As far as covariances are concerned, do you project future covariances that are fixed, or do you model them as varying?
Best regards,
dothemontecarlo
Brief Overview of QPP
First, I have an article on SeekingAlpha that shows a nineyear outofsample portfolio analysis using QPP to develop the asset allocations. This is benchmarked against buyandhold, annual rebalance, etc. The article is called Testing Forward Looking Asset Allocation, dated October 22.
I have a range of detailed articles that explain how QPP works, but to address the questions:
1) QPP is a nonstationary model, but does assume normal returns ' lognormal prices
2) QPP handles portfolio covariance using a model that is somewhat proprietary..so I cannot give exact details. I have a detailed discussion in some articles, and I compare to Style Analysis in one called:
Diversifying Portfolios With Market And NonMarket Correlations
This is on SeekingAlpha and it is from April 2006. If you read this, please note that QPP was projecting volatility would be twice as high, on average, as the recent years had been...this goes to the other question about Reversion to the Mean:
Generating Meaningful Outlooks for Portfolio Performance
This article is on SeekingAlpha and is dated March 1, 2007.
I have a range of detailed articles that explain how QPP works, but to address the questions:
1) QPP is a nonstationary model, but does assume normal returns ' lognormal prices
2) QPP handles portfolio covariance using a model that is somewhat proprietary..so I cannot give exact details. I have a detailed discussion in some articles, and I compare to Style Analysis in one called:
Diversifying Portfolios With Market And NonMarket Correlations
This is on SeekingAlpha and it is from April 2006. If you read this, please note that QPP was projecting volatility would be twice as high, on average, as the recent years had been...this goes to the other question about Reversion to the Mean:
Generating Meaningful Outlooks for Portfolio Performance
This article is on SeekingAlpha and is dated March 1, 2007.
Overtuning models
As far as Gatorman's comment about having a portfolio that looked good in the model but blows up in practice:
All models can be overfitted / overtuned. QPP and other good monte carlo models use theory in combination with data to help in building better portfoliosand QPP has tested well outofsampleI have many studies available publiclyincluding by third parties. The fact remains that models can always be overfitted. I have suggested many times that if a model (any model) gives results that cannot be explained or are inconsistent with reliable people and models, this is a bad sign.
The good news is that there are consistent standards emerging. I just wrote an article in which I showed that QPP's estimates of risk for a set of stocks were remarkably consistent with some results from RiskGrades, for example. I have also shown consistent results with sources like Ibbotson, and discussions by David Swensen and ElErian.
All models can be overfitted / overtuned. QPP and other good monte carlo models use theory in combination with data to help in building better portfoliosand QPP has tested well outofsampleI have many studies available publiclyincluding by third parties. The fact remains that models can always be overfitted. I have suggested many times that if a model (any model) gives results that cannot be explained or are inconsistent with reliable people and models, this is a bad sign.
The good news is that there are consistent standards emerging. I just wrote an article in which I showed that QPP's estimates of risk for a set of stocks were remarkably consistent with some results from RiskGrades, for example. I have also shown consistent results with sources like Ibbotson, and discussions by David Swensen and ElErian.
 dothemontecarlo
 Posts: 539
 Joined: Tue Nov 06, 2007 10:19 am
 Location: Colorado
 Contact:
Re: Brief Overview of QPP
I'm not asking you to disclose anything you would regard as a trade secret, but how are the expected returns in your model nonstationary?Quantext wrote:First, I have an article on SeekingAlpha that shows a nineyear outofsample portfolio analysis using QPP to develop the asset allocations. This is benchmarked against buyandhold, annual rebalance, etc. The article is called Testing Forward Looking Asset Allocation, dated October 22.
I have a range of detailed articles that explain how QPP works, but to address the questions:
1) QPP is a nonstationary model, but does assume normal returns ' lognormal prices
2) QPP handles portfolio covariance using a model that is somewhat proprietary..so I cannot give exact details. I have a detailed discussion in some articles, and I compare to Style Analysis in one called:
Diversifying Portfolios With Market And NonMarket Correlations
This is on SeekingAlpha and it is from April 2006. If you read this, please note that QPP was projecting volatility would be twice as high, on average, as the recent years had been...this goes to the other question about Reversion to the Mean:
Generating Meaningful Outlooks for Portfolio Performance
This article is on SeekingAlpha and is dated March 1, 2007.
My nonsecret monte carlo retirement calculator models stock returns as if they were lognormally distributed, but with a cumulativeperformancedependent mean. The degree to which past performance affects future results depends on the "reversiontothemean" time variable specified by the user.
Imagine a user specifies a 25year RTM factor and a 4% expected annualized real return on the stock part of his portfolio. The simulation starts with the expected annualized return (converted to an arithmetic return) and standard deviation specified by the user. Say the first random return for simulation year #1 is 30%. The program calculates what is, in essence, the "YTM" that it would take over the next 25 years to result in an annualized return, over the entire 26year period, of 4%/year. In this example, it would take an expected subsequent annualized return of 5.66%/year over the next 25 years for the cumulative return, over the entire 26year period, to "revert" back to the originally expected annualized 4%/year. The lognormal distribution about which the next random return number is generated is then centered around the arithmetic equivalent of an annualized 5.66% return.
This is repeated every year, each time calculating the "YTM" it would take over the subsequent 25 years to get the return over the entire simulation period to "revert" back to the mean.
The effect is that you have a shifting lognormal distribution.
I tested several large series of meanreverting variables like this in Excel, and confirmed that it did not meaningfully change the overall standard deviation. That is, if you generated a histogram of these meanreverting randomly generated variables, it would still look a whole lot like a randomwalk distribution.
The advantage of this approach is that it reduces the dispersion of longterm results while preserving a wide distribution of shortterm results.
Just wondering... does QPP model mean reversion in the same or a similar way?
Also, to what extent does QPP let the user specify the expected returns going forward. Does the user have to depend on your quantitative forecast models? What if the user is more optimistic or pessimistic about returns going forward?
QPP and Mean Reversion
QPP handles mean reversion in a very different way than you are proposing. QPP gets historical data and uses these to generate volatility projections for each asset in the portfolio. QPP then calculates a "fair" expected return based on this volatility projection. If an asset class has high historical returns relative to risk, QPP's projections will be lower and vice versa.
Adjusting the outlook in QPP
oopsjust realized I did not answer your whole question:
The user can adjust the worldview by (1) adjusting the assumed equity risk premium or (2) by hand adjusting the expected return for each asset. There is a version of the model (called QRP) in which you can adjust all parameters (individual volatilies, Betas, etc.) but getting an internally consistent dataset when you change these factors by hand can be challenging.
The user can adjust the worldview by (1) adjusting the assumed equity risk premium or (2) by hand adjusting the expected return for each asset. There is a version of the model (called QRP) in which you can adjust all parameters (individual volatilies, Betas, etc.) but getting an internally consistent dataset when you change these factors by hand can be challenging.
 dothemontecarlo
 Posts: 539
 Joined: Tue Nov 06, 2007 10:19 am
 Location: Colorado
 Contact:
Re: QPP and Mean Reversion
Sounds like a novel and fascinating approach to me. Thanks for the replies.Quantext wrote:QPP handles mean reversion in a very different way than you are proposing. QPP gets historical data and uses these to generate volatility projections for each asset in the portfolio. QPP then calculates a "fair" expected return based on this volatility projection. If an asset class has high historical returns relative to risk, QPP's projections will be lower and vice versa.