Created
May 17, 2022 01:33
-
-
Save andreachello/33d70f4091832f6b09e505dcf10c129f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
np.random.seed(0) | |
num_simulations = 1000 | |
# the number of steps represent the times we simulate the process, with each step comprising | |
# 1000*i steps so we get simulations from 1000 to 50000 | |
num_steps = 50 | |
num_of_months = 13 | |
# terminal price is an array of size 13 to account for the 12 months plus initial value | |
# it is timed by the number of steps | |
term_val = [[None]*num_of_months]*num_steps | |
# initialise the monte carlo value, estimates and std as empty array of size number of steps | |
mbarrier_val = [None]*num_steps | |
mbarrier_estimates = [None]*num_steps | |
mbarrier_std = [None]*num_steps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment