quantitative finance
文章平均质量分 75
zhucai4
这个作者很懒,什么都没留下…
展开
-
Vanilla Option Pricing via C++
Box-Muller Algorithm, generate Gaussian random numbers#ifndef BM_GAUSSIAN_HPP_INCLUDED#define BM_GAUSSIAN_HPP_INCLUDED#include #include #include double uniformRandom(){ return (double)(rand原创 2015-05-03 11:44:58 · 452 阅读 · 0 评论 -
Basket Call Option via C++
Two stocks, with correlation rho, European type, payoff is Max(S1-S2, 0). First, Box-Muller algorithm,#ifndef BM_GAUSSIAN_HPP_INCLUDED#define BM_GAUSSIAN_HPP_INCLUDED#include #include #include原创 2015-05-03 12:01:39 · 562 阅读 · 0 评论 -
Finite Difference BS Call PDE
#include #include #include #include using namespace std;double explicitCallOption(double S0, double X, double T, double r, double sigma, int iMax, int jMax) { // declare and initialise local v原创 2015-05-03 15:35:35 · 561 阅读 · 0 评论 -
binomial tree in python
import numpy as npdef binomial(strike, optype, extype): # optype 'C' = call, 'P' = put # extype 'E' = european, 'A' = american # set model paramters S0 = 100 # initial st原创 2015-05-06 15:06:54 · 1903 阅读 · 0 评论 -
Simulate Common Stochastic Process
import numpy as npimport matplotlib.pyplot as pltimport numpy.random as npr####################################### simulate stock price in one step######################################S0 = 100原创 2015-05-06 22:53:30 · 484 阅读 · 0 评论 -
American Option Pricing via Longstaff and Schwartz (2001)
import numpy as npimport matplotlib.pyplot as pltimport numpy.random as nprdef gen_sn(M, I, anti_paths=True, mo_match=True): if anti_paths is True: sn = npr.standard_normal((M+1, I/2)原创 2015-05-07 09:21:13 · 1435 阅读 · 1 评论 -
Calibration Heston Model via Python
Semi-Closed-Form of Pricing Formulaimport numpy as npimport scipy.integrate as spidef Heston_Call_Value_Int(kappa, theta, sigma, rho, v0, r, T, s0, K): a = s0*Heston_P_Value(kappa, theta,原创 2015-06-01 20:06:09 · 3195 阅读 · 0 评论 -
Monte Carlo Asian Option Pricing OOP Framework
Box-Muller Algorithm to Generate Normal Random Numbersdouble gaussian_box_muller(){ double x = 0.0; double y = 0.0; double euclid_sq = 0.0; do{ x = 2.0 * rand() / static_ca原创 2015-05-19 10:05:28 · 892 阅读 · 0 评论