Optimization problem: solve for the size of negative price shock within a stochastic simulation

3 views (last 30 days)
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
  1. Normally distributed stochastic change in price
  2. 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!

Accepted Answer

Roger Stafford
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.
  1 Comment
Linda
Linda on 20 Jul 2014
Thank you for your reply. Yes, you are correct.
I was actually just looking for some help with coding (new to MATLAB) that combines simulation and solver. Thus, I simplified the original question. Originally the question was designed so that the final price is only considered when P3 falls below 0. We set Average P3 = the average of max(-P3,0), then to calculate S requires the simulation, since it is now dependent on variance of the random variable (assuming that the random variable is not normally distributed).
Hope this is clear. Thanks.

Sign in to comment.

More Answers (0)

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!