Optimization problem: solve for the size of negative price shock within a stochastic simulation
3 views (last 30 days)
Show older comments
I'm running a simulation for stock prices over a 12 months period and each period there are two randomly generated variables that affect the price
- Normally distributed stochastic change in price
- negative shock - that only occur p% of the time
at the end of each month, Price is given by: P(t+1) = P(t)*randn(t) - Shock, where Shock = S if rand(0,1) < 0.1 and Shock = 0 otherwise.
I need to solve for S such that Average Price at the end of the 12 months is a fixed number (say 40). Is there a code that will help me calibrate the size of the shock (s) with 100,000 simulations over 12 months?
Below is an example of the problem described. Thanks!
0 Comments
Accepted Answer
Roger Stafford
on 20 Jul 2014
It is not necessary to run a simulation to solve this problem. Because the mean value of 'randn' is zero, after each month the mean value of P(t)*randn(t) will always be zero also, no matter what the size of P(t) is. Hence the mean value of P(t) after each month is always the same, namely -S*(p/100) with p% (= p/100). This is independent of the number of months and depends only on the S occurrence in the last month. To get 40 with p% the necessary value for S is easy to calculate: S = -4000/p.
However, if you ask about the variance, as opposed to the mean value, that is a different matter. It would depend on the number of months.
More Answers (0)
See Also
Categories
Find more on Stochastic Differential Equation (SDE) Models in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!