Frequently Asked Questions (FAQ)Derivatives Expert^{TM} for Mathematica^{®}IntroductionSome of this information may first be relevant to you after you have experimented with Derivatives Expert, but please skim the text so that you have an idea of the contents. Tips and Techniques
FAQ
Tips & TechniquesRunning the ExamplesNote when, running the examples in the different notebooks, it may be important to run some of the examples in the correct order, i.e. from top to bottom, because there may be intermediate or temporary results with the same names or because some examples depend on previous results. Financial Day Counting ConventionsDerivatives Expert can accomodate probably all financial day counting conventions. Please refer to e.g. YearsInPeriod in the CalendarTools.nb notebook about how to set the day counting optionals appropriately. Compounding -> ContinuousUnless you need the unlimited precision, then set (CompiledDF->True) because the execution is much faster. This is the case for all functions that discount or compound cash flows. SetOptionsNever use the Mathematica SetOptions with functions and/or objects from Derivatives Expert because this may spoil the consistency of the Derivatives Expert system. In any case, it is often not possible to change the default settings because they have been locked. This is a current design choice in Derivatives Expert. The internal design may change in later versions. Note that the general use of SetOptions with optionals from the standard Mathematica system can be reasonable in given situations. Options[...]Options[ object] has been added to relevant objects in addition to the Options[ function] already present. Because there often are several versions of "object" to a function available, the actual optionals that have effect are documented in the respective notebooks. Please refer to these. Getting information on symbols
Only Linux: System Time IssueYou may have to change your system time. NotationYou may want to stick to ISO-89*-1 characters and American/British notation i.e. "." as decimal divider. With e.g. the Link for Excel and with certain databases, there may be issues of notation. Often it is most "safe" to work with the American/British notation standard. J/LinkThe part handling the connection to Java in "~/.Mathematica/4.1/Kernel/init.m" may be moved to the main "/.../mathematica/Configuration/Kernel/init.m" file. This removes all remaining Java objects.
Displaying TablesMany of the results in the Derivatives Expert documentation are in the form of list of list i.e. tables. Below is a way to display these tables more nicely. This is a table of random numbers.
This formats table tbl using TableForm.
This is one way to format the numbers of table tbl using PaddedForm.
This defines a function dsp1 to format the table. Also refer to the Mathematica functions GridBox, StyleBox, and DisplayForm.
This applies the functions fun2 and dsp1 to the table.
This prepends a table header to tbl.
This defines a function dsp2 to format a table with header.
This applies the function dsp2 to the table with header.
This applies the functions fun2 and dsp2 to the table.
FAQAre there any known bugs?All known bugs, at the time of the release, in Derivatives Expert III are listed below. ExoticOptions1.nbDo not set passedobservations different from zero in ExoticOptions1.nbDo not use the Zhang versions to price EuropeanGeometricAverageStrikeCallOption and EuropeanGeometricAverageStrikePutOption. Doing so will result in a wrong option price. How do I Install the Packages?Refer to http://www.ifs.dk/Support/install.html You may also want to refer to the standard Mathematica documentation on how to install packages in general. This may be found via the Mathematica Help browser: Write Packages in the text field, and click the Master Index button, and then select Packages and click Go To. Are the Package Files Encoded?The software is delivered and distributed in Mathematica encoded format, i.e. the code cannot be read or modified directly as plain text, but it can be loaded into Mathematica. Refer to the Mathematica function Encode. What is init.m?Please refer to the standard Mathematica documentation.
Term Structure FunctionsAre jumps allowed?Often continuous term structure functions are used in the examples. The term structure functions do not have to be smooth continuous functions. They may e.g. have jumps. The only requirement is that there is one and only one function value for every time to maturity. Why are Term Structure Functions Used Instead of Discrete Points?Derivatives Expert uses a more sophisticated approach than normally seen and hence a more elegant way of treating term structures in the analysis. If you have a number of discrete term structure points then you need to construct a function. On how to do this please refer to the notebook TermStructureTools.nb and the function InterpolateInterestRates. Are Annual Rates or Periodic Rates Used?Interest rates are generally passed to the functions as annual rates and the functions normally return annual rates. Refer to the notebook TermStructureTools.nb. Coupon Rates and Interest RatesCoupon rates are normally assumed to be annual nominal rates, in percent.
Interest rates are normally assumed to be annual effective rates, in percent. What are Objects?Objects normally refer to financial contracts. The financial contracts are not always fully specified by the objects, e.g. whether an options contract is a European call option or an American put option is not specified by the object, but is passed to the calling function e.g. the pricing function TheoreticalPrice. TimeSeveral functions are written to accomodate more than one way of time specification. There are generally two different ways of specifying time, plus the case where time specification is not needed or does not make sense. (1) Calendar-Time
(2) Time as Numbers
(3) No Time
What Date Formats are Available?Dates are specified as {full year, month, day}. Thus 14. June 1998 is written as {1998, 6, 14}. Can Calendar Time Versions be Derived From Non-Calendar Versions?Often it is possible to pass e.g. the function YearsInPeriod instead of an exact number (theta). Thus in practice many non-calendar functions can also be used in calendar time. Holiday SymbolsThe holiday symbols that can be calculated by Derivatives Expert are found by evaluating SymbolsHolidays after opening the package CalendarTools.m. In addition you can make your own holidays known to the system through the optionals HolidaysSpecific and HolidaysGeneral. Workday OptionalsYou can often make the functions automatically change all non-workdays to workdays, by setting the optionals correctly. Remember to set: ToWorkdaysQ -> Yes. Refer to the optionals of the specific object and function. See also the notebook CalendarTools.nb. Are Cash Flows Viewed From a Buyer´s (Long) or a Seller´s (Short) View?Cash flows are generally viewed from a buyer´s point of view unless otherwise stated. Principal AmountsIn the documentation these amounts are just referred to as the principal as a matter of simplicity. Many examples in the documentation have a principal of 100, but that can be changed to any number (which of course normally changes the result of the specific evaluation). Market rates of financial instruments are often quoted in amounts of nominally 100, e.g. most bond market prices. What Currency Symbols are Used?The currency symbols used in Derivatives Expert are the ISO codes. You may use any symbols you like as the currency symbols (except reserved symbols for other purposes in Derivatives Expert, Mathematica and other packages), as long as you use the symbols consistently, but these are the recommended ones. Many symbols can be found here. About OptionalsThe TerminologyWhen talking about "optionals" in Derivatives Expert we actually mean "options" in the sense defined by standard Mathematica. The reason for this is to distinguish optionals from financial options contracts. A Shorthand NotationA list of optionals are sometimes written as e.g.:
The thing to note is the Options[FindRoot] part. If you execute Options[FindRoot] in Mathematica it will return the list of optionals and their default settings for the function FindRoot. So Options[FindRoot] is just a shorthand notation for the full list of optionals and their default settings. Using an Alien OptionalIf an alien optional (but otherwise correctly specified optional) is passed to a function, then the optional should be ignored by the function, or the function should return unevaluated or return $Failed together with a message. Note that many of the optionals that may apply to a function, may not apply to another version of the same function because there are many methods of the same function that do not all take the same optionals. Changing an Optional ValueIf an optional, that is usable for a function, has a non-valid value then it will normally terminate the evaluation of the function. Thus either the function should return unevaluated or return $Failed together with a message. Changing the Default Settings of OptionalsYou can change the default settings of optionals that do not have the attribute Locked. This is done via the function SetOptions. The functions UnProtect and SetOptions cannot be used on symbols that have the attributes: {Protected, ReadProtected, Locked}. These symbols cannot be changed or read. This is to protect you from changing important characteristics of these symbols. How is Output Handled?Typical FormatsIn the documentation the format of the result is often changed from an
exact format to a numerical result using the function ToN or the
Mathematica function N.
Exception HandlingA function that is given false input should either return unevaluated, return a value together with a warning or return $Failed and a message. This will not always be the case in this version of Derivatives Expert. Sometimes you will get a long list of output because you have e.g. some missing arguments or entered some wrong arguments. Are Some Functions Overloaded?Many functions are "overloaded" which means that they can take different sets of arguments and/or optionals, and thereby have different properties. This is done:
Rational Numbers and Real NumbersSome functions return a rational number (e.g. 2/3). In some cases it is convenient to transform the result to a real number (e.g. 0.666667). This can often be done by using ToN or the Mathematica function N. If you want the highest degree of precision then always use the rational numbers where possible. Note that the transformation to a real number can result in loss of precision. This should especially be noted when using results in further calculations. Please refer to the sections in the main Mathematica book ("A System for Doing Mathematics by Computer" by Steven Wolfram) about N, numbers and precision. Can I Execute the Functions Faster than Reported in The Documentation ?Running the functions using faster machines will speed up the timing compared to that reported in the documentation. System Related TopicsStrange Function BehaviorThere are different ways to terminate a calculation that is running. Please refer to the standard Mathematica documentation about e.g. Abort, Interrupt and Exit. Evaluation Crash !See also: $RecursionLimit, $IterationLimit, MemoryInUse[]. How Much Memory is Required by Derivatives Expert?See e.g. the Mathematica function MemoryInUse[]. |
Updated 2 August 2009 |