Where can I find the code for the function "hcomputeMTMValues" in http://www​.mathworks​.in/help/f​ininst/cou​nterparty-​credit-ris​k-and-cva.​html ?

The CVA calculation example in "http://www.mathworks.in/help/fininst/counterparty-credit-risk-and-cva.html" uses some functions like "hcomputeMTMValues" and "hgenerateScenario". I am unable to find the implementation of these functions. Need to compute CVA for my project.

Answers (2)

which -all hcomputeMTMValues
C:\Program Files\MATLAB\R2013b\toolbox\fininst\fininstdemos\hcomputeMTMValues.m

2 Comments

which -all hcomputeMTMValues
C:\Program Files\MATLAB\R2013a\toolbox\fininst\fininstdemos\hcomputeMTMValues.m

Sign in to comment.

I have one more question concerning the hcomputeMTMValues. Why does a function in the CVA Solution provided by MathWorks http://de.mathworks.com/help/fininst/counterparty-credit-risk-and-cva.html refers to four arguments, and the description of mine requires five arguments? Because of this I can't run the code... =( Is it a mismatch of the versions used?
When I read the description of hcomputeMTMValues, it makes the matters even worse, I fear the functions in the link above and in the description have different structures...
Would be grateful for any help.

3 Comments

What release are you using? It's possible the function was changed between the release you're using and the current release (the documentation on the website refers to the current release; you need to specifically select older releases' documentation if you want to look at it on the website.) When in doubt I recommend that you look at the version of the documentation that was installed with your release, as it will be in sync with the code.
Release R2013a was the latest release I can see in which that function in that example was called with 5 inputs. [I checked the later releases; I didn't go back before R2013a to see when the function or the five input syntax was introduced.]
Dear Mr. Lord!
Thank you very much for your answer! I use namely the R2013a version. Does it mean, that I either need some update (a new version where 4 parameters are required) or to use the documentation for the Version R2013a? Does the Version R2013b already call for the function only based on 4 arguments?
Thanks again in advance.
Regards.
Yes, the release R2013b version of that example called it with 4 inputs.
If you want to use the four input argument variety of that example helper function, you will need to upgrade to a newer release. If the five input argument variety is working for you, use the function as it is used in the example in the documentation for release R2013a. What won't work is mixing and matching. That's like putting a part from a 2015 model car into a 2013 version of that same model; it may work, it may not, and in this case it will not.

Sign in to comment.

Tags

Asked:

on 23 Sep 2013

Commented:

on 14 Aug 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!