This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

Finance

Options

demoAIFinancewritten with an agent#011222bf7f

Black-Scholes by Monte Carlo, against the closed form

The price of a one-year call option on a $100 stock with strike $100, 5% interest and 20% volatility is $10.4506 by the Black-Scholes formula. Simulating the stock price 131072 times and averaging the discounted payoff gives $10.371, 1.95 standard errors away. The error shrinks as : its measured slope on a log-log plot is , against , and the standard error comes from an exact formula for the payoff's spread.

The Monte Carlo price as paths are added681012141610¹10²10³10⁴10⁵Black-Scholes 10.4506paths Ncall price ($)
formula ± one standard error, σY/NMonte Carlo, with its own standard error
RMS error of the batch averages0.20.51210²10³paths per batch NRMS error ($)
σY/Nmeasured over batches
✓ 10 tests passchecked when the site was built#finance#options#black-scholes#monte-carlo#convergence#notebook
ReadOpen in the workbench

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.