Directory of Open Source for Quantitative Finance and Trading
Username: Password: Not registered?
 
Quick Search:    (AJAX based: No need to press button)

Main : Excel : 



Sort by:  Title () Date () Rating () Popularity ()
Files currently sorted by: Popularity (Least to Most Hits)


Category: Excel View Full Details
Download Now!Bond Option price in vasicek using direct forward rate simulation
Submitter: vanna Date: 2008/7/10
Description:
Here I have tried doind MC simulation of short rate under forward measure using analytical formula for Expected mean and variance of short rate under forward measure.(The formulas are given in Brigo's book)
During each simulation I am generating a random variable with Ert_T and varrt_T, and use bond price formula to cache initial A(t,T) and B(t,T) values.
where
Ert_T : Expected value of short rate under T-forward measure
varrt_T : variance of short rate under T-forward measure

Got a question or problem with this link? Just enter your message and click on submit. No registration is required.

Note: A copy of this message will also be emailed to the submitter of this link
Downloaded 806 times  806  File Size 0 bytes  Supported Platforms Excel VBA  Home Page http://www.quantcode.com/
Rating: 0.00 (0 votes)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (38)

Category: Excel View Full Details
Download Now!Bond Option Pricing Using T-Forward Measure
Submitter: vanna Date: 2007/12/22
Description:
Demonstrates the concept of forward measure and its application to price a bond option in Vasicek model using monte carlo simulation.
Algorithm:
For each simulation:
1.Start with expected value of forward measure as mentioned in Brigo's book.
2.Calculate drift adjustment required for swiitching over from risk neutral measure to forward measure
3.Simulate spot rate dynamics in forward measure using drift adjustment. (basically same as risk neutral path except for addition of drift adjustment term)
4.Calculate present value of payoff by discounting with risk neutral measure till option maturity (It can be deterministic and need not to simulate as mentioned in Glasserman)
5.Repeat 1
Set optionprice=average of above PVs

NOTE: The simulated values do not match very well to analytical prices, tough they are maybe within 10-20% range. When analytical option price is more the results match better eg., by increasing sigma.Hence I am guessing this might be due to approximation or discretization errors. If you find a bug or have a suggestion please let me know.

And if someone is interested in the formulas I have used, pl. add a comment and I will paste them.

Got a question or problem with this link? Just enter your message and click on submit. No registration is required.

Note: A copy of this message will also be emailed to the submitter of this link
Downloaded 823 times  823  File Size 100 bytes  Supported Platforms Excel VBA Forward Measure  Home Page http://www.quantcode.com/
Rating: 0.00 (0 votes)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (35)

Category: Excel View Full Details
Download Now!Swap Fair rate using Basis Point Sensitivity
Submitter: vanna Date: 2007/12/28
Description:
This spreadsheet calculates fair rate of swap using basis point sensitivity formula.

An initial dummy fixed rate is assumed to start with. Uisng this dummy fixed rate, N ,total NPV of fixed leg and floating legs is determined by discouting the payments in Vasicek model

Fixed rate amouunt=nominal*rate*accrualperiod

fixedlegBPS = nominal*discount*accrualperiod

FixedLegNPV=sum of discounted values of all Fixed rate amouunt payments

FloatingRateAmount=floatingcouponrate * accrualPeriod * nominal

FixedLegNPV=sum of discounted values of all Floating rate amouunt payments


TotalNPV=FixedLegNPV+FloatingNPV

Fairrate = Fixedrate - TotalNPV/fixedlegBPS

Got a question or problem with this link? Just enter your message and click on submit. No registration is required.

Note: A copy of this message will also be emailed to the submitter of this link
Downloaded 825 times  825  File Size 1000 bytes  Supported Platforms Excel VBA  Home Page http://www.quantcode.com/
Rating: 0.00 (0 votes)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (35)

Category: Excel View Full Details
Download Now!Fastest Pikaia Genetic Optimization Algorithm in VBA
Submitter: nicolasito Date: 2009/3/19
Description:
General purpose optimization subroutine based on a pikaia genetic algorithm. This function is particularly useful to solve global maximum solution in VBA.

Enjoy!
Rafael Nicolas Fermin

Got a question or problem with this link? Just enter your message and click on submit. No registration is required.

Note: A copy of this message will also be emailed to the submitter of this link
Downloaded 834 times  834  File Size 0 bytes  Supported Platforms   Home Page http://www.rnfc.org/rhapsody/math/OPTIM_GENETIC_PIKAIA_LIBR.bas
Rating: 0.00 (0 votes)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (48)

Category: Excel View Full Details
Download Now!Interest Rate Derivative Bond Option Valuation by Joint Simulation
Submitter: vanna Date: 2007/12/21
Description:
Calculates bond option price in Vasicek Model using Joint simulation of (int_0_T(r(t)),r(T))
where
T : Option Maturity
r(t) : sport rate at time t in risk neutral measure
int_0_T(r(t)) : integral of r(t) taken from time 0 to option maturity

Algorithm:
1.Calculate expected values of r(T) and integral_r(T)
2.Calculate correlation of r(t) and integral_of_r(t) using formulas for variances and covariance
For each simulation:
2a. Draw 2 random no. variables
2b. Transform the variables to make them correlated
2c. Simulate r(T) and integral_of_r(T)
2d. Calculate option payoff using simulated r(T)
2e. Discount option payoff using simulated integral_of_r(T)
Repeat 2a.

Average PVs to get bond option price

Note: the spreadsgeet also contains implementaiotn of analytical bond option price for comparision

Got a question or problem with this link? Just enter your message and click on submit. No registration is required.

Note: A copy of this message will also be emailed to the submitter of this link
Downloaded 838 times  838  File Size 1 bytes  Supported Platforms EXCEL VBA MONTE CARLO  Home Page http://www.quantcode.com/
Rating: 6.00 (1 vote)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (37)
« 1 2 3 (4) 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 »
Similar Links:

Subscribe to RSS or daily email updates of latest quantitative finance code listings
Email address :
Copyright © 2011 QuantCode Inc. All rights reserved.