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

Main : Excel : 


Category: Excel View Full Details
Download Now!Partial Derivatives Jacobian Matrix
Submitter: vanna Date: 2007/4/15
Description:
This function returns a Jacbian Matrix of partial derivatives for a function.

eg., usage:


'function for which Jacobian matrix needs to be computed
Public Function myfn(x As Variant, p As Variant)
Dim outVec As Variant
ReDim outVec(1 To UBound(x, 1), 1 To 1)
Dim i As Single
For i = 1 To UBound(x, 1)
outVec(i, 1) = p(1, 1) * x(i, 1) ^ 3 - p(2, 1) * x(i, 1) + 4
Next i
myfn = outVec
End Function


'example code for getting jacobian matrix
Private Sub CommandButton1_Click()
ReDim x(1 To 10, 1 To 1)
Dim i As Single
For i = 1 To 10
x(i, 1) = i
Next i
ReDim p(1 To 2, 1 To 1)
p(1, 1) = 0.5
p(2, 1) = 0.2
ReDim dp(1 To 2, 1 To 1)
dp(1, 1) = 0.001
dp(2, 1) = 0.001

Dim myres As Variant
myres = GetJacobianMatrix(x, p, "myfn", dp)
End Sub

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 879 times  879  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 (32)

Poster Thread
Anonymous
Posted: 2012/1/2 12:51  Updated: 2012/1/28 18:50
 Partial Derivatives Jacobian Matrix
Hi vanna
Can I use this for solving a system of non-linear equations? if yes how?

Discuss this file. Just enter your message and click on submit. No registration is required.
Similar Links:
Global Derivatives Matlab Code (Software)
Derivatives (Paper)
Covariance matrix (Forum)
Volatility Derivatives (Paper)
Multinomial Lattices and Derivatives Pricing (Paper)

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