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: Title (Z to A)


Category: Excel View Full Details
Download Now!Generating Random variables from exponential distribution in Excel
Submitter: vanna Date: 2009/6/18
Description:
This is a function to generate a set of random numbers from exponential distribution.
It uses a formula mentioned in http://en.wikipedia.org/wiki/Exponential_distribution

Example code to use this function
lambda=2
nVars=10000
exprndvars = GetExponentialVariables(lambda,nVars)


exprndvars is the vector of generated exponential distributed random number variables
lambda is the parameter of exponential distribution
nVars is the length of vector to generate




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 939 times  939  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 (57)

Category: Excel View Full Details
Download Now!Generating multivariate normal random numbers in VBA
Submitter: vanna Date: 2008/9/23
Description:
This function GetMuiltivariateRandomNos returns a set of n vectors drawn from multivariate normal distribution.
Input parameters are :
Mu : mean array
Sigma : covariance matrix of a normal distribution
cases : no. of random vectors


Following is example usage:
Redim Sigma(1 to 3,1 to 3)
Sigma(1,1)=1.55869
Sigma(1,2)=-0.85802
Sigma(1,3)=1.45868

Sigma(2,1)=-0.85802
Sigma(2,2)=2.24283
Sigma(2,3)=-2.44512

Sigma(3,1)=1.45868
Sigma(3,2)=-2.44512
Sigma(3,3)=3.75283
ReDim Mu(1 To 3, 1 To 1)
Mu(1, 1) = 1
Mu(2, 1) = 2
Mu(3, 1) = 0
rndvars = GetMuiltivariateRandomNos(Mu, Sigma, 10)


Following is value of rndvars matrix:
-0.347443879	2.04617674	-1.186177819
2.580336111	0.464957559	2.243791782
1.131096202	1.727204021	2.338258573
0.583116106	3.809239781	-2.834853381
0.637456616	2.87640474	-0.190386463
0.133824191	1.677845184	0.221439357
2.03751742	2.8033236	                0.428118682
0.473264324	3.623211235	-2.341566983
5.078022715	-1.278159439	4.887537982
2.249934772	4.007060452	-1.970715669


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 1841 times  1841  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 (37)

Category: Excel View Full Details
Download Now!Gaussian, Student ,Clayton, Frank and Gumbel copulas
Submitter: vanna Date: 2007/3/31
Description:
This file contains code to generate Gaussian, Student ,Clayton, Frank and Gumbel copulas for a prescribed correlation coeeficient, and demonstrates comparision of their depnedency structures

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

Category: Excel View Full Details
Download Now!GARCH code in Excel
Submitter: vanna Date: 2006/9/2
Description:
Rez's classic spreadhsheet for GARCH in Excel

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 13680 times  13680  File Size 0 bytes  Supported Platforms Excel VBA  Home Page http://www.wilmott.com/messageview.cfm?catid=4&threadid=29421
Rating: 8.00 (2 votes)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (67)

Category: Excel View Full Details
Download Now!Function Minimization using Nelder Mead Simplex
Submitter: vanna Date: 2008/12/31
Description:
This class is used for minimzing a user defined function in a module file. It uses Nelder mead simplex algorithm

For example, consider mimizing this function:
Public Function MyFunction(xVec As Variant) As Double
  MyFunction = (xVec(1, 1) - 4) ^ 2 + (xVec(2, 1) - 2.7) ^ 4 + (xVec(3, 1) - 6.7) ^ 4
End Function


Use the following code to get minimum:
ReDim initParams(1 To 3, 1 To 1)
initParams(1, 1) = 0
initParams(2, 1) = -1
initParams(3, 1) = -2.8
Dim nelderObj As New Nelder
result = nelderObj.SolveMaximum("MyFunction", initParams)


Optionally, accuracy or tolerance for convergence can be changed by setting eg., nelderObj.Tolerance_=0.00001


Demo for using this function

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 2367 times  2367  File Size 0 bytes  Supported Platforms Excel VBA  Home Page http://www.quantcode.com/
Rating: 9.00 (2 votes)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (40)
« 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.