Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Goal Seeker, Solver, Approximation or Iterative Searching for multiple rows

    I would like to know if there is a function in State like the goal seeker in excel for iterative searching functioning as a solver for thousands of rows. I would like to find minimise C-SN((ln(S/K)+t(r-d+σ2/2))/σ*t0.5)+Ke-rtN(N((ln(S/K)+t(r-d-σ2/2))/σ*t0.5)

    Or find C=SN((ln(S/K)+t(r-d+σ2/2))/σ*t0.5)-Ke-rtN(N((ln(S/K)+t(r-d-σ2/2))/σ*t0.5)

    In which the letters represent:
    C=price call option
    S=current price share
    N=cumulative normal distribution of value between brackets
    K=strike price of option
    t= time to maturity
    r= risk free interest
    d=dividend rate
    e=2.7182

    I try to find the value of the implied volatility σ for American call options with iterative searching. If this function is not there, is there a function to find an approximation in an specific range. It could be in the range of 0 until 5 with steps of 0.001. So σ in range 0.001,0.002,0.003........4.996,4.997,4.998,4.999,5 .0000. And then find the value with which the Black Scholes value most closely approximates the price of the call option or in which the upper function is minimised. And then calculate this value for each row (in this case some thousands).
    It would be very helpful if someone knew this.

  • #2
    Code:
    search minimize
    brings up a couple of possibilities, one Mata system and one an undocumented Stata command. I would try the latter first, making your equation into a quadratic function. (You could minimize the absolute value of the difference, I suppose, but quadratic would be faster.)
    Code:
    search minimise
    brings up a few unrelated commands that are probably not what you're looking for.

    Comment


    • #3
      Which do you mean with the undocumented Stata command?

      Comment


      • #4
        Joseph presumably refers to the minbound command, which help minimize tells us is documented only in help minbound, rather than in one of the Stata reference manual PDFs.

        Comment

        Working...
        X