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

Main : Matlab : 



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


Category: Matlab View Full Details
Download Now!CDO Tranche Pricing using T copula
Submitter: vanna Date: 2006/11/16
Description:
Calculates fair price for a CDO tranches using T copula as described in paper Copula Functions and their Application in Pricing and Risk Managing Multiame Credit Derivative Products
CDO tranche spread curves are verified to have similar slopes as given on page 58(increasing for senior tranche and decreasing for equity tranche)
Requires changing of variables rho,Lowerlimit,Upperlimit to observe the impact of the variables.


Thanks to josema for valuable contribution in improving the earlier code!



Note : This file is compatible with Matlab. For an Octave verion download from here

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 2948 times  2948  File Size 0 bytes  Supported Platforms Octave Matlab  Home Page http://quantcode.com/
Rating: 0.00 (0 votes)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (77)

Category: Matlab View Full Details
Download Now!Implicit vs Crank Nicholson vs Explicit Finite difference methods
Submitter: vanna Date: 2007/8/21
Description:
This program demonstrates comparision of put option values obtained by the Implicit ,Crank Nicholson and Explicit Finite difference methods

eg., following is output:

octave:44> fdexperiment
option_price_full_implicit = 4.9325
option_price_crank_nicholson = 5.0125
option_price_explicit_scheme = -1.2934e+05
option_price_explicit_scheme_corrected = 5.0581
bsprice = 5.0689



As can be seen by playing with input parameters of stock and timesteps, crank nicholson looks like a winner and explicit scheme is very sensitive to stability condition which requires a minimum no. of timesteps for a given no. of stock steps.
Explicit scheme results are dsiplayed for input parameter values and also for the timesteps adjusted for stability condition


Required file : BinomialPrice.m

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 3029 times  3029  File Size 0 bytes  Supported Platforms Octave Matlab  Home Page http://www.quantcode.com/
Rating: 0.00 (0 votes)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (6)

Category: Matlab View Full Details
Download Now!Tutorial on Generalized Method of Moments (GMM)
Submitter: vanna Date: 2008/2/3
Description:
I have written this simple code to demonstrate the concept of Generalized method of moments.

Follwoing are the ideas behind this tutorial/code:
1.We simulate random variables in T distribution with a given degrees of freedom.
2.Just for comparision purposes, we use maximum likelihood estimation to determine the estimation of the degrees of freedom parameter.
3.We use the property of the 2nd moment analytical formula, and solve the equation to find DF estimiate.
4.We use the property of the 4th moment analytical formula, and solve the equation to find DF estimiate. Note that this will be different from value result of (3)
5.We assume weight matrix as indentity matrix, and solve both the moments together by criteria function as mentioned in lecture notes Generalized Method of Moments - lecture notes by Stanislav Radchenko

Note that W matrix used is an arbitrary choice and may be suboptimal. I will continue more about the optimization in next tutorial

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 3080 times  3080  File Size 0 bytes  Supported Platforms Octave Matlab  Home Page http://www.quantcode.com/
Rating: 0.00 (0 votes)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (12)

Category: Matlab View Full Details
Download Now!Variance Swap Pricing
Submitter: vanna Date: 2007/3/26
Description:
Calculates fair rate of variance swap for given input implied vol curve

Based on paper More Than You Ever Wanted To Know About Volatility Swaps by Derman et al

Note : This file requires the function BlackScholesPrice

Uploaded a new version of the file as the previous version code was not matching the values reproduced in Table 1. Thanks to Taras and Caye for their valued suggestion in pointing out the problem!
Results are now matching the table 1 values , and final value of 20.467 is compared to the value mentioned on page 22


Note: there is no change in calcualtion procedure. The changes made are:
1. T is set to 90/365 instead of 0.25 earlier. (it is mentioned to be 3 months in the paper, and their calc. procedure assumed it to be 90/365 I suppose. )
2.Border strike values (50 put and 135 call) are also now considered for calculation of total
3.A new display matrix is added to verify results are reproduced


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 3201 times  3201  File Size 0 bytes  Supported Platforms Octave Matlab  Home Page http://www.quantcode.com/
Rating: 0.00 (0 votes)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (17)

Category: Matlab View Full Details
Download Now!Credit Default Swap Pricing
Submitter: vanna Date: 2007/3/31
Description:
Calculates upfront premium for a CDS using the following inputs:
1.CDS specs
2.Risk free term structure
3.Yield spread for corresponding bond grade

Uses default probability implied from the term structure to find present value of default payments

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 3269 times  3269  File Size 0 bytes  Supported Platforms Octave Matlab  Home Page http://www.quantcode.com/
Rating: 0.00 (0 votes)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (13)
« 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) 30 31 32 »
Similar Links:

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