Matlab Program Notes

Algorithmic Trading With Matlab

Advanced Algorithmic Trading Strategies

Get Instant Access

Optimization software is quite common. The MATLAB function fminunc.m, for unconstrained minimization, part of the Optimization Toolbox, is the one used for the quasi-Newton gradient-based methods. It has lots of options, such as the specification of tolerance criteria and the maximum number of iterations. This function, like most software, is a minimization function. For maximizing a likelihood function, we minimize the negative of the likelihood function.

The genetic algorithm used above is gen7f.m. The function requires four inputs, including the name of the function being minimized. The function being optimized, in turn, must have as its first output the criterion to be minimized, such as a sum of squared errors, or the negative of the likelihood function.

The function simanneal.m requires the specification of the function, coefficient matrix, and initial temperature. Finally, the orthogonal polynomial operators, chedjudd.m, hermiejudd.m, legendrejudd.m, and laguerrejudd.m are also available.

The scaling functions for transforming variables to ranges between [0,1] or [—1,1] are in the MATLAB Neural Net Toolbox, premnmx.m.

The scaling function for the transformation suggested by Helge Petersohn is given by hsquasher.m. The reverse transformation is given by helgeyx.m.

Was this article helpful?

0 0

Post a comment