Introduction to “Numerical Methods and Optimization in Finance”

October 27, 2011

The book is by Manfred Gilli, Dietmar Maringer and Enrico Schumann.  I haven’t actually seen the book, so my judgement of it is mainly by the cover (and knowing the first two authors).

The parts of the book closest to my heart are optimization, particularly portfolio optimization, and particularly particularly portfolio optimization via heuristic algorithms.  However, the book covers several other topics as well.

R Package

There is an accompanying R package for the book, which can be installed via:

install.packages('NMOF')

I have only just glanced through the package, so I don’t know much about it either.  In addition to the optimization functions discussed below there are a few functions concerning options.

Optimization functions

There are functions in the package for optimization via:

  • a traditional genetic algorithm (GAopt)
  • a differential evolution algorithm (DEopt)
  • a particle swarm algorithm (PSopt)
  • a threshold accepting algorithm (TAopt)
  • a stochastic local search algorithm (LSopt)
  • grid search (gridSearch)

Here is my take on why the traditional genetic algorithm is horrible. The Portfolio Probe computing engine includes something similar to the differential evolution algorithm.

Programming note

One rather non-“R”ish thing that I noted was in function tfTrefethen (“tf” as in “test function”).  The function just has x as an argument and it starts with:

y <- x[2L] x <- x[1L]

That is, it is not vectorized and the single argument contains the value of both logical arguments.  One way to make this look more typically R would be:

function(x, y=NULL) {
   if(!length(y)) {
      y <- x[,2]       x <- x[,1]    }
   ...
}

Then the way to get the behavior of the original function would be to say:

tfTrefethen(rbind(my_x))

instead of:

tfTrefethen(my_x)

Subscribe to the Portfolio Probe blog by Email

Latest posts

Leave a Reply

  1. […] The NMOF package contains a set of functions that are introductory examples of various algorithms. This package is support for the book Numerical Methods and Optimization in Finance. […]

Related posts

  • October 14, 2013

    What good are the skewness and kurtosis of portfolios? Previously The post "Cross-sectional skewness and kurtosis: stocks and portfolios" looked at skewness and kurtosis in portfolios.  The key difference [...]

  • October 7, 2013

    Get data that fit before you fit data. Why verify? Garbage in, garbage out. How to verify The example data used here is daily (adjusted) prices of stocks.  By [...]

  • September 23, 2013

    The subtitle is "Organizational Design, Risk, and Value Creation". Executive summary This should be a business book bestseller -- it simply and clearly explains the process of value creation. [...]