NAGNews 104 - 8 March 2012


Using the NAG Library for .NET in Microsoft Excel®

excel demo
Screenshot of demo Excel workbook, showing the data points and the fitted surface

Much of our work at NAG is devoted to creating new implementations of our numerical libraries, and making them accessible from which ever environment our users are working in. We recently received a query from a user who wanted to add functionality to his Excel workbook by invoking a method from the NAG Library for .NET. One way to do this is to use Visual Studio Tools for Office (VSTO) to create a customized Excel workbook that loads a .NET assembly when it is opened. Events in the workbook (e.g. typing values in cells or clicking buttons) then call assembly methods which can access workbook data and - for example - call NAG methods to process it.

To illustrate this, we have developed a demo Excel workbook which uses methods to fit a surface through a set of points in 3D space (see figure). It is freely available for download as a deployed VSTO solution from here. More information about its working and installation - including how to obtain a trial licence for the NAG Library for .NET - is available in this README. A copy of the full solution (including the C# source which invokes the NAG methods) may be obtained by contacting NAG support.

An alternative way to enhance Excel with numerical functionality is to use the NAG Dynamic Link Libraries (DLLs) with Visual Basic for Applications (VBA). A recent blog post illustrates this detail by describing how to solve a nonlinear least-squares problem in Excel using a NAG routine.

NAG and the Manchester Girl Geeks

We're delighted to announce our first collaboration of 2012 with the sponsorship of the Manchester Girl Geeks. The not-for-profit group, based in Manchester UK, is part of the Girl Geek Dinner network, which organises networking events, talks and hands-on workshops for women and girls with an interest in science, technology, engineering and mathematics.

girl geeks tea party
A Girl Geek Tea Party

The Manchester Girl Geeks mission resonated loudly with NAG as we both share a not-for-profit status and have an objective of fostering new talent in computing, science and technology. NAG already awards a number of Student Prizes and offers internal placements, but is always on the look-out for new initiatives in this area to support. NAG is looking forward to attending some of the Girl Geek events, and supporting the group in its very worthwhile mission.

Read the full story here.

Nearest Correlation Matrix - New NAG Library Functionality

In Mark 23 of the NAG Library we have extended the functionality in the area of computing the nearest correlation matrix. In this mini-article we take a look at nearest correlation problems, giving some background and introduce the routines that solve them.


A correlation matrix is characterised as being real, square symmetric matrix with ones on the diagonal and with non-negative eigenvalues. A matrix with non-negative eigenvalues is called positive semidefinite. If a matrix C is a correlation matrix then the elements of C, C(I,J), represent the pair-wise correlation of entity I with entity J, that is, the strength and direction of a linear relationship between the two.

Read the full mini-article here.

NAG Student Prize Update

Global Derivatives, Barcelona

NAG will be attending the Global Derivatives Trading & Risk Management event being held in Barcelona in April. As with previous events we have a pass to the event to award the best financial maths project. If you're studying mathematical finance you can enter the NAG 'Direct Award' prize by sending through details of your mathematical project. Email us for more information.

Previous winners and their work can be viewed here.

Technical Seminars, Training and Events

Adding Numerical Functionality to LabVIEW Using the NAG Library
University of Manchester
14 March 2012

26-27 March 2012

High Performance Computing and Communications
Rhode Island
26-28 March 2012

Global Derivatives
16-20 April 2012

All NAG attended and organised events and training courses can viewed here.

Recent Blog Posts

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

Self Improvement - An algorithm for getting to "empty"
Whether we like it or not, at NAG and many other organizations, we live in an "e-mail" culture. MORE

Upgrades - hotels, airlines and HPC
I was pointed to this short but interesting blog today, which makes the point that customers like it when businesses over-deliver on expectations. MORE

How to solve a NLLS problem using SQP method in Excel
NLLS stands for nonlinear least-sqaures and SQP is sequential quadratic programming. So essentially, this is an optimization problem. MORE


NAGNews - Past Issues

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