NAGNews 111

In this issue

New White Paper: Optimization and the NAG Library

The NAG Library is a collection of functions that encapsulates hundreds of algorithms in mathematics and statistics, and which can be invoked by developers to efficiently solve numerical problems in their applications – be they from finance, quantitative analysis or other disciplines.

One of the fields the Library covers is optimization – i.e. the selection of the best element from a set of alternatives. This finds application in many areas of finance – for example, in the optimization of portfolios, the calibration of derivative pricing models and index tracking, and the NAG Library contains several functions that can be used to solve problems in this area.

We have recently prepared a white paper which is devoted to this topic; it highlights the way in which it is essential to use a solver which is appropriate for the type of optimization problem at hand. It describes the functionality of NAG’s solvers for both local and global optimization, and surveys a few example applications from finance and business analytics in which NAG solvers have been used. Finally, it discusses a specific financial analysis application in more detail; highlighting the way in which the NAG solver can be called from within various environments (e.g. Excel) by users having little or no programming knowledge.

Read the new white paper here.

The Knowledge Transfer Partnership between NAG and the University of Manchester

Knowledge Transfer Partnerships, or KTPs as they are commonly known were created as a bridge between academia and commercial organisations. NAG has always fostered strong relationships with academia – its roots are firmly placed in education – so formalising some of these into the KTP framework makes sense. A short video has been created to highlight the benefits to both Associates and Organisations.

Watch the video here.

New NAG and Excel Nearest Correlation Matrix

Recent market events in finance have yet again highlighted the importance of correlation. Not only is it important for hedging and risk management, but correlations between different instruments can also change extremely quickly, often with unfavourable consequences. Yet determining correlation is not simple. Mathematically, a correlation matrix is symmetric positive semi-definite with ones on the diagonal. But when estimating correlation from market data (a common task in many applications), one often ends up with a matrix which is symmetric, has ones on the diagonal, but is not positive semi-definite. Such a matrix can produce negative variances.

The NAG Library has a suite of routines to determine the correlation matrix nearest to a given input matrix. The Excel spreadsheets below (using both C and Fortran Libraries) demonstrate how these routines work.

  1. NAG routine (nag_nearest_correlation) determines the nearest correlation matrix to a given input matrix.
  2. NAG routine (nag_nearest_correlation_bounded) solves the same problem, but incorporates weights. This could be useful if a user attaches more importance to observations from one asset compared to the others (perhaps the measurements are more precise, or the asset is more liquid).
  3. NAG routine (nag_nearest_correlation_k_factor) solves a k-factor version of the problem. In many models, multiple factors (sources of noise) are used to describe the evolution of a set of assets. For example, one might have a model where m independent Brownian motions are used to describe the joint evolution of m+n assets. nag_nearest_correlation_k_factor allows the user to potentially reduce the number driving Brownian motions while maintaining a correlation structure which is as close as possible to the original.

Example using the NAG C Library
Example using the NAG Fortran Library

More demonstrations showing the use of the NAG Library from Excel can be found here.

The NAG Fortran Compiler, Fortran Builder and a Quiz

Article based on a recent blog post on Walking Randomly

What do you want from your Fortran compiler? Some people ask for extra (non-standard) features, others require very fast execution speed. The very latest extensions to the Fortran language appeal to those who like to be up to date with their code.

I suspect that very few would put enforcement of the Fortran standard at the top of their list, yet this is essential if problems are to be avoided in the future. Code written specifically for one compiler is unlikely to work when computers change, or may contain errors that appear only intermittently. Without access to at least one good checking compiler, the developer or support desk will be lacking a valuable tool in the fight against faulty code.

The NAG Fortran Compiler is such a tool. It is used extensivly by NAG's own staff to validate their library code and to answer user-support queries involving user's Fortran programs. It is available on Windows, where it has its own IDE called Fortran Builder, and on Unix platforms and Mac OS X.

Windows users also have the benefit of some Fortran Tools bundled into the IDE. Particularly nice is the Fortran polisher which tidies up the presentation of your source files according to user-specified preferences.

The Compiler includes most Fortran 2003 features, very many Fortran 2008 features and the most commonly used features of OpenMP 3.0 are supported.

Read the full blog post here.


Events & Training Courses

Training Courses Provided by NAG's HECToR Team*

8-10 January 2013
Imperial College London

Parallel Programming with MPI
21-23 January 2013
Imperial College London

Parallel Programming with MPI
13-15 February 2013
University of Sheffield

An Introduction to CUDA Programming
4-5 March 2013
University of Sheffield

These HPC training courses are provided free of charge to HECToR users and UK academics whose work is covered by the remit of one of the participating research councils (EPSRC, NERC and BBSRC). The courses are also open to non-eligible people but will require payment of a course fee. Please see the eligibility page for more details.

Recent blog posts

Keep up to date with NAG's recent blog posts here:

Bitwise Reproducibility with the NAG Libraries
Snippet: l've written in this blog before about the problems of Wandering Precision - where the results computed by a program are not consistent, even when running exactly the same program on the same machine with the same data several times in a row.
Read the full post here.

Our own Hall of Fame – the NAG Life Service Recognition Award
During NAG's 40th anniversary celebrations in 2011, a NAG Hall of Fame was established to recognise outstanding efforts and commitment to the company by a member or collaborator of NAG. The Life Service Recognition Award has now been bestowed twice.
Read the full post here.

NAGNews - Past Issues

We provide an online archive of past issues of NAGNews. For editions prior to these, please contact us.