NAGnews 120 | 20 February 2014

In this issue

NAG Library for Java updated to provide more numerical routines and improved error checking

The NAG Library for Java has just seen its second release with the inclusion of over 100 new routines. The NAG Library for Java enables the calling of over 1,750 mathematical and statistical routines to aid complex computation and now features enhanced error reporting enabling increased precision from computation results. Release 2 of the NAG Library for Java also provides additional abstract classes for callback functions alongside a host of new numerical functionality.

New functionality at Release 2 of the NAG Library for Java

  • Multi-start (global) optimization
  • Non-negative least squares (local optimization)
  • Nearest correlation matrix
  • Inhomogeneous time series
  • Gaussian mixture model
  • Confluent hypergeometric function (1F1)
  • Brownian bridge & random fields
  • Best subsets
  • Real sparse eigenproblems
  • Matrix functions
  • Two stage spline approximation

See our website for more information and to arrange a trial. You might be entitled to use this version of the Library as part of your NAG software licence. We can check this for you - email us.

C++ Wrappers for the NAG C Library

We strive to make NAG Library routines flexible and easy to use from many different languages, packages and environments - think Java, MATLAB, Excel, Xeon Phi, Python, etc. The following is an extract from the latest NAG Blog post where Brian Spector, Technical Consultant at NAG illustrates how to call the NAG Library from C++ using wrappers:

Occasionally, we receive requests to make the NAG C Library easier to call from C++. In the past, we found it difficult to build something that would work across all of the code our C++ users write. With the advent of the C++11 standard, many of the key features of the widely used Boost library have been incorporated into the STL, and finally provide a standardized way to address many of the difficulties we've encountered (the code we describe here works with Visual Studios 2010 and later, as well as several different versions of the Intel compiler and gcc).

We have created four example wrappers (and possibly more to come) that can serve as templates for creating C++ wrappers around NAG functions. Specifically, the examples now allow the user to:

  1. Pass function pointers, functors, class member functions and lamda functions as callbacks to the NAG Library.
  2. Use raw pointers, smart pointers, STL containers or Boost containers to store data and pass these to the NAG Library.

Note: these are NOT a C++ interface, but merely wrappers around the C Library.

To learn more about the C++ Wrappers read the blog where you can download four example templates for your use.

New examples demonstrating ease of use of NAG routines in Excel: Schur-Parlett Algorithm and Brownian Bridge Generator

Two new NAG and Excel examples have been developed to demonstrate how NAG Library routines can be utilized within Excel. Click on the links below to view the demonstrations. If you'd like more information on NAG and Excel email us or click here for more information.

Basic example:

How to compute the matrix exponential, and other matrix functions, of a real matrix using the Schur-Parlett algorithm using the NAG Fortran Library NEW AT MARK 24

This routine (F01EKF) sits within the Matrix Operations, Including Inversion Chapter in the NAG Library.

Advanced example:

How to use the scaled Wiener increments produced using a Brownian bridge generator to compute numerical solutions to stochastic differential equations (SDEs) driven by (free or non-free) Wiener processes using the NAG Fortran Library NEW AT MARK 24

This routine (G05XDF) is housed in the Random Number Generators Chapter of the NAG Library.

Mark 24 functionality spotlight: Gaussian Mixture Model

The new Gaussian Mixture Model included at Mark 24 of the NAG Library is the highlighted functionality in today's NAGnews. The new Mark 24 routine sits within the Multivariate Methods Chapter of the NAG Library.

Routine Summary

The routine G03GAF fits a Gaussian k-mixture model. Modelling data drawn from an unknown statistical distribution with a weighted sum of distributions defines a finite mixture model, also known as a latent class method. The most common example incorporates a given number, say k, of Gaussian (i.e., Normal) distributions to model data. Mixture models can be applied to a wide range of applications relating to grouped data, such as density estimation and clustering.

Read about this new functionality here.

Case Brief - NAG Services: A large spreadsheet software publisher came to NAG to add and audit new functions

When the Excel® team wanted to improve the numerical functions in Microsoft Office 2010 they came to NAG. For Excel 2010, Microsoft made many improvements to their spreadsheet application. In particular Excel 2010 featured an accurate and consistent set of integrated functions. NAG helped to ensure the quality of these functions. Over the years there had been various academic papers detailing issues associated with Excel- provided functions. Therefore a key goal for the release was to better understand, and to address, any accuracy issues with these functions. Microsoft wanted to implement a set of new algorithms, which retained compatibility with previous versions but delivered improved accuracy from the statistical, financial and math functions.

NAG was commissioned to do two things. Firstly to review the implementation of the existing content and advise on algorithms that could be employed in order to provide an extended feature set. Secondly NAG were to undertake a rigorous testing exercise including all of the new algorithmic content included in this release. The result was that users were able to rely on functions in Excel® with confidence knowing they now had comparable accuracy to those of other statistical packages.

Read the full story here.

Training Courses & Events

Your users, developers and managers can all benefit from NAG's highly regarded training courses. All of the training courses shown have been delivered successfully either from NAG offices or at client premises. Training courses can be tailored to suit your particular requirements and be targeted to novice, intermediate or experienced levels. Specialized mentoring and development programs are also available for HPC managers.

HPC & Software Training / NAG Product Training

  • Accelerating Applications with CUDA and OpenCL
  • Algorithmic Differentiation
  • An Introduction to CUDA Programming
  • An Introduction to OpenCL Programming
  • An Introduction to Unified Parallel C (UPC)
  • Coarray Fortran
  • Core Algorithms for High Performance Scientific Computing
  • Debugging, Profiling and Optimizing
  • Developing Parallel Applications for the Intel Xeon Phi
  • Fortran 95
  • Multicore
  • Object-Oriented Programming in Fortran 2003
  • Open MP
  • Parallel I/O
  • Parallel Programming with MPI
  • Scientific Visualisation
  • Using the NAG Library in Fortran
  • Using the NAG Library in C and C++
  • Using the NAG Library in Excel and VBA
  • Using the NAG Library for Java
  • Using the NAG Toolbox for MATLAB
  • Using the NAG Library for Python
  • Multicore Programming and the NAG Library for SMP & Multicore
  • An Introduction to CUDA Programming and the NAG Numerical Routines for GPUs

Examples of tailored training courses

  • Best Practice in HPC Software Development
  • OpenCL introduction for CUDA programmers

For more information about our courses including tailoring a course for your exact needs please email us. NAG will be at the following exhibitions and conferences in March, April and May 2014.

The Best of the Blog

The London Thalesians Seminar

NAG's Brian Spector gave a great talk to a packed audience of finance professionals in London recently. The Thalesians describe themselves as a "think tank of dedicated professionals with an interest in quantitative finance, economics, mathematics, physics and computer science". Brian was delighted to present "Implied Volatility using Python's Pandas Library" at their London Seminar on Wednesday 15 January 2014.

You can learn more about the subject of Brian's talk in one of his NAG and Python blogs below:

Additional NAG and Python information features on our website, including how you can download the NAG Python Bindings that will enable use of the NAG C Library from Python.