Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 

















File:Black-Scholes surface plot with random paths.svg




Page contents not supported in other languages.  









File
Talk
 

















Read
View on Commons
 








Tools
   


Actions  



Read
View on Commons
 




General  



What links here
Upload file
Special pages
Printable version
Page information
Get shortened URL
Download QR code
 
















Appearance
   

 





This is a file from the Wikimedia Commons

From Wikipedia, the free encyclopedia
 


File

File history

File usage

Metadata
File:Black-Scholes surface plot with random paths.svg
Size of this PNG preview of this SVG file: 600 × 600 pixels. Other resolutions: 240 × 240 pixels | 480 × 480 pixels | 768 × 768 pixels | 1,024 × 1,024 pixels | 2,048 × 2,048 pixels | 900 × 900 pixels.

Original file(SVG file, nominally 900 × 900 pixels, file size: 1.47 MB)





Summary

Description
English: ```python

import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm

  1. Define parameters

K = 1.0 sigma = 0.2 T = 1 x = np.linspace(-0.5, 0.5, 100) tau = np.linspace(0.0001, T, 100) X, TAU = np.meshgrid(x, tau)

def black_scholes(x, tau):

   d_plus = (1 / (sigma * np.sqrt(tau))) * (x + 0.5 * sigma**2 * tau + 0.5 * sigma**2 * tau)
   d_minus = (1 / (sigma * np.sqrt(tau))) * (x + 0.5 * sigma**2 * tau - 0.5 * sigma**2 * tau)
   u = K * (np.exp(x + 0.5 * sigma**2 * tau) * norm.cdf(d_plus) - norm.cdf(d_minus))
   return u

fig = plt.figure(figsize=(10, 10)) ax = fig.add_subplot(projection='3d')

K = 1.0 sigma = 0.05 num_walks = 10 starting_points = [-0.2, -0.1, 0, 0.1, 0.2] num_starting_points = len(starting_points) num_points = 1000 t_values = np.linspace(1e-4, 1, num_points)

brownian_walks = np.zeros((num_starting_points, num_walks, num_points)) for i in range(num_starting_points):

   for j in range(num_walks):
       dt = 1 / num_points
       dW = np.random.normal(0, np.sqrt(dt), num_points)
       brownian_walks[i, j] = np.cumsum(dW) * sigma + starting_points[i]

for i in range(num_starting_points):

   for j in range(num_walks):
       B_t = brownian_walks[i,j]
       S_t = np.exp(B_t)-1
       S_t = S_t[::-1]
       ax.plot(T-t_values, S_t, black_scholes(S_t, t_values), color='w', alpha=0.2)

ax.plot_surface(T-TAU, X, black_scholes(X, TAU), cmap='viridis')

ax.set_ylabel(r'$(S-C) ) ax.set_xlabel(r'$t
Source Own work Edit this at Structured Data on Commons
Author

)

ax.set_zlabel(r'$V(S, t)}}) ax.view_init(elev=20, azim=0, roll=0)

plt.savefig("black_scholes_surface.svg") plt.show() ```}} |date=2023-10-17 |source=Own work |author=Cosmia Nebula }}

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
  • Under the following conditions:
    • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
    • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

    Captions

    Add a one-line explanation of what this file represents

    Items portrayed in this file

    depicts

    image/svg+xml

    0bdeca01eba0649685532c40484f4b5456b53fb7

    1,543,714 byte

    900 pixel

    900 pixel

    File history



    Click on a date/time to view the file as it appeared at that time.
    Date/TimeThumbnailDimensionsUserComment
    current02:51, 18 October 2023Thumbnail for version as of 02:51, 18 October 2023900 × 900 (1.47 MB)Cosmia NebulaUploaded while editing "Black–Scholes equation" on en.wikipedia.org



    The following pages on the English Wikipedia use this file (pages on other projects are not listed):

    BlackScholes equation


    Metadata

    If the file has been modified from its original state, some details may not fully reflect the modified file.


    Retrieved from "https://en.wikipedia.org/wiki/File:Black-Scholes_surface_plot_with_random_paths.svg"







    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki