楼主: zhaoxiaixia
2250 1

[求助] 求大神!蒙特卡洛模拟给期权定价 针对BSM模型和GARCH模型的定价 [推广有奖]

  • 0关注
  • 0粉丝

等待验证会员

已卖:10份资源

小学生

7%

还不是VIP/贵宾

-

威望
0
论坛币
11 个
通用积分
0.0833
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
23 点
帖子
2
精华
0
在线时间
6 小时
注册时间
2018-7-22
最后登录
2018-9-7

楼主
zhaoxiaixia 发表于 2018-7-22 21:35:22 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
求助!很急!有大神会用蒙特卡洛模拟给期权定价的吗?分别根据BSM模型和GARCH模型
有偿!无论是excel, eviews或matlab都可以!求教!
感激不尽!



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝


数据.xlsx
下载链接: https://bbs.pinggu.org/a-2515874.html

745.02 KB

需要: 1 个论坛币  [购买]

S&P 500 options

沙发
moonlight100(未真实交易用户) 发表于 2018-7-24 11:51:58
import numpy as np
import numpy.random as npr
import matplotlib.pyplot as plt
S0 = 100
r = 0.05
sigma = 0.25
T = 1.0
I = 50000
M = 50
def gen_sn(M, I, anti_paths=True, mo_match=True):
    '''Function to generate random numbers for simulation
   
    Parameters
    ==========
    M : int
       number of time intervals for discretization
    I : int
       number of paths to be simulated
    anti_paths : Boolean
       use of antithetic variates
    mo_math : Boolean
       use of moment matching
    '''
    if anti_paths is True:
        sn = npr.standard_normal((M+1, int(I/2)))
        sn = np.concatenate((sn, -sn), axis=1)
    else:
        sn = npr.standard_normal((M+1, I))
    if mo_match is True:
        sn = (sn - sn.mean())/sn.std()
    return sn
def gbm_mcs_dyna(K, option='call'):
    '''Valuation of European options in Black-Scholes-Merton by Monte Carlo simulation (of index level paths)
   
    Parameters
    ==========
    K : float
        (positive) strike price of the option
    option : string
    type of the option to be valued('call', 'put')
   
    Returns
    =======
    C0 : float
         estimated present value of European call option
    '''
    dt = T/M
    #simulation of index level paths
    S = np.zeros((M+1, I))
    S[0] = S0
    sn = gen_sn(M, I)
    for t in range(1, M+1):
        S[t] = S[t-1]*np.exp((r-0.5*sigma**2)*dt+sigma*np.sqrt(dt)*sn[t])
    if option == 'call':
        hT = np.maximum(S[-1]-K, 0)
    else:
        hT = np.maximum(K-S[-1], 0)
    C0 = np.exp(-r*T)*1/I*np.sum(hT)
    return C0

gbm_mcs_dyna(K=110, option='call')

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2025-12-31 15:57