NAG C Library News, Mark 9 (PDF version)
NAG C Library Manual

NAG Library

NAG C Library News, Mark 9

+ Contents

1  Introduction

At Mark 9 of the NAG C Library new functionality has been introduced in addition to improvements in existing areas. The Library now contains 1159 user-callable functions, all of which are documented, of which 153 are new at this mark.
Two new chapters have been introduced on wavelet transforms and global optimization; a new sub-chapter has also been introduced on option pricing formulae; and extensions have been included in the areas of statistics, optimization, linear algebra, ordinary differential equations, regression, random numbers, searching, and special functions.
The new Chapter c09 (Wavelet Transforms) has functions for performing one-dimensional discrete, single-level and multi-level, wavelet transforms and their inverses.
The new Chapter e05 (Global Optimization of a Function) has a function for performing global optimization on a problem with simple bounds using a multi-level coordinate search, which is complemented by a number of support functions for initializing the data and setting optional arguments.
Chapter c05 (Roots of One or More Transcendental Equations) has a new function to evaluate real values of Lambert's W function.
Chapter d02 (Ordinary Differential Equations) has extended its functionality to include functions that use the integration method of DASSL; thus, implicit differential algebraic equations of index 2 can now be solved.
Chapter e04 (Minimizing or Maximizing a Function) has added a replacement function for applying the simplex algorithm which should perform significantly faster than the original.
Chapter f01 (Matrix Factorizations) contains a new function for computing the matrix exponential of a real-valued matrix.
Chapter f02 (Eigenvalues and Eigenvectors) contains a new function for obtaining leading terms in the singular value decomposition of a real general matrix.
Chapter f16 (NAG Interface to BLAS) contains various useful level-1 functions from the BLAS Technical Forum (BLAST).
Chapter g01 (Simple Calculations on Statistical Data) contains a new function for finding quantiles of an unordered vector.
Chapter g02 (Correlation and Regression Analysis) contains new functions for: computing the nearest correlation matrix to a real square matrix; computing predicted value and error from a generalized linear model; ridge regression; and partial least squares.
Chapter g03 (Multivariate Methods) contains a new function for performing ProMax rotations.
Chapter g05 (Random Number Generators) has been overhauled to provide a consistent set of functions for: initializing pseudorandom, quasirandom and scrambled quasirandom base generators; generating vectors from distributions; generating matrices from Copula and multivariate distributions; and generating realizations from (V)ARMA models and GARCH processes. The base generators now include the Mersenne Twister and ACORN generators.
Chapter g13 (Time Series Analysis) contain a new function for exponential smoothing of a univariate time series.
Chapter m01 (Sorting and Searching) is renamed from ‘Sorting’ and contains functions for searching arrays of real-valued, integer or character data.
Chapter s (Approximations of Special Functions) now includes a suite of functions for evaluating various option pricing formulae. This chapter also contains new functions for computing the scaled complement of the error function (erfcx), a scaled gamma function and computing elliptic integrals in the classical Legendre form.
Plots of example program results have been added to many function documents. In some cases the example program has been modified slightly to produce a larger set of results giving a more representative plot of the solution profile produced.

2  New Functions

The 153 new user-callable functions included in the NAG C Library at Mark 9 are as follows.
Function
Name

Purpose
a00adc Library identification, details of implementation, major and minor marks
c05agc Zero of continuous function, Brent algorithm, from given starting value, binary search for interval
c05avc Binary search for interval containing zero of continuous function (reverse communication)
c05axc Zero of continuous function by continuation method, from given starting value (reverse communication)
c05azc Zero in given interval of continuous function by Brent algorithm (reverse communication)
c05bac Real values of Lambert's W function, W(x)
c09aac Wavelet filter initialization
c09cac one-dimensional discrete wavelet transform
c09cbc one-dimensional inverse discrete wavelet transform
c09ccc one-dimensional multi-level discrete wavelet transform
c09cdc one-dimensional inverse multi-level discrete wavelet transform
d02mcc DASSL method continuation resetting function
d02mwc Implicit ordinary differential equations/DAEs, initial value problem, setup for nag_dae_ivp_dassl_gen (d02nec)
d02nec Implicit ordinary differential equations/DAEs, initial value problem, DASSL method integrator
d02npc Implicit ordinary differential equations/DAEs, initial value problem linear algebra setup routine for nag_dae_ivp_dassl_gen (d02nec)
e04cbc Unconstrained minimization using simplex algorithm, function of several variables using function values only
e05jac Initialization function for nag_glopt_bnd_mcs_solve (e05jbc)
e05jbc Global optimization by multi-level coordinate search, simple bounds, using function values only
e05jcc Supply optional argument values for nag_glopt_bnd_mcs_solve (e05jbc) from external file
e05jdc Set a single optional argument for nag_glopt_bnd_mcs_solve (e05jbc) from a character string
e05jec Set a single optional argument for nag_glopt_bnd_mcs_solve (e05jbc) from an ‘ON’/‘OFF’-valued character argument
e05jfc Set a single optional argument for nag_glopt_bnd_mcs_solve (e05jbc) from an integer argument
e05jgc Set a single optional argument for nag_glopt_bnd_mcs_solve (e05jbc) from a real argument
e05jhc Determine whether an optional argument for nag_glopt_bnd_mcs_solve (e05jbc) has been set by you or not
e05jkc Get the setting of an Integer valued optional argument of nag_glopt_bnd_mcs_solve (e05jbc)
e05jlc Get the setting of a real valued optional argument of nag_glopt_bnd_mcs_solve (e05jbc)
f01ecc Real matrix exponential
f01edc Real symmetric matrix exponential
f02wgc Computes leading terms in the singular value decomposition of a real general matrix; also computes corresponding left and right singular vectors
f08vac Computes the generalized singular value decomposition of a real matrix pair
f08vnc Computes the generalized singular value decomposition of a complex matrix pair
f08zac Solves the real linear equality-constrained least-squares (LSE) problem
f08zbc Solves a real general Gauss–Markov linear model (GLM) problem
f08znc Solves the complex linear equality-constrained least-squares (LSE) problem
f08zpc Solves a complex general Gauss–Markov linear model (GLM) problem
f16dlc Sum elements of integer vector
f16dnc Maximum value and location, integer vector
f16dpc Minimum value and location, integer vector
f16dqc Maximum absolute value and location, integer vector
f16drc Minimum absolute value and location, integer vector
f16ehc Real scaled vector addition preserving input
f16elc Sum elements of real vector
f16ghc Complex scaled vector addition preserving input
f16glc Sum elements of complex vector
f16jnc Maximum value and location, real vector
f16jpc Minimum value and location, real vector
f16jqc Maximum absolute value and location, real vector
f16jrc Minimum absolute value and location, real vector
f16jsc Maximum absolute value and location, complex vector
f16jtc Minimum absolute value and location, complex vector
g01amc Quantiles of a set of unordered values
g01kac Calculates the value for the probability density function of the Normal distribution at a chosen point.
g01kfc Calculates the value for the probability density function of the γ distribution at a chosen point.
g02aac Computes the nearest correlation matrix to a real square matrix, using the method of Qi and Sun
g02gpc Computes a predicted value and its associated standard error based on a previously fitted generalized linear model.
g02jcc Hierarchical mixed effects regression, initialization
g02jdc Hierarchical mixed effects regression using restricted maximum likelihood
g02jec Hierarchical mixed effects regression using maximum likelihood
g02kac Ridge regression, optimizing a ridge regression parameter
g02kbc Ridge regression using a number of supplied ridge regression parameters
g02lac Partial least-squares (PLS) regression using singular value decomposition
g02lbc Partial least-squares (PLS) regression using Wold's iterative method
g02lcc PLS parameter estimates following partial least-squares regression by nag_pls_orth_scores_svd (g02lac) or nag_pls_orth_scores_wold (g02lbc)
g02ldc PLS predictions based on parameter estimates from nag_pls_orth_scores_fit (g02lcc)
g03bdc ProMax rotations
g05kfc Initializes a pseudorandom number generator to give a repeatable sequence
g05kgc Initializes a pseudorandom number generator to give a non-repeatable sequence
g05khc Primes a pseudorandom number generator for generating multiple streams using leap-frog
g05kjc Primes a pseudorandom number generator for generating multiple streams using skip-ahead
g05ncc Pseudorandom permutation of an integer vector
g05ndc Pseudorandom sample from an integer vector
g05pdc Generates a realization of a time series from a GARCH process with asymmetry of the form (εt - 1 + γ)2
g05pec Generates a realization of a time series from a GARCH process with asymmetry of the form (|εt - 1| + γεt - 1)2
g05pfc Generates a realization of a time series from an asymmetric Glosten, Jagannathan and Runkle (GJR) GARCH process
g05pgc Generates a realization of a time series from an exponential GARCH (EGARCH) process
g05phc Generates a realization of a time series from an ARMA model
g05pjc Generates a realization of a multivariate time series from a VARMA model
g05pmc Generates a realization of a time series from an exponential smoothing model
g05pxc Generates a random orthogonal matrix
g05pyc Generates a random correlation matrix
g05pzc Generates a random two-way table
g05rcc Generates a matrix of pseudorandom numbers from a Student's t-copula
g05rdc Generates a matrix of pseudorandom numbers from a Gaussian copula
g05rec Generates a matrix of pseudorandom numbers from a bivariate Clayton/Cook–Johnson copula
g05rfc Generates a matrix of pseudorandom numbers from a bivariate Frank copula
g05rgc Generates a matrix of pseudorandom numbers from a bivariate Plackett copula
g05rhc Generates a matrix of pseudorandom numbers from a multivariate Clayton/Cook–Johnson copula
g05rjc Generates a matrix of pseudorandom numbers from a multivariate Frank copula
g05rkc Generates a matrix of pseudorandom numbers from a Gumbel–Hougaard copula
g05ryc Generates a matrix of pseudorandom numbers from a multivariate Student's t-distribution
g05rzc Generates a matrix of pseudorandom numbers from a multivariate Normal distribution
g05sac Generates a vector of pseudorandom numbers from a uniform distribution over (0,1]
g05sbc Generates a vector of pseudorandom numbers from a beta distribution
g05scc Generates a vector of pseudorandom numbers from a Cauchy distribution
g05sdc Generates a vector of pseudorandom numbers from a χ2 distribution
g05sec Generates a vector of pseudorandom numbers from a Dirichlet distribution
g05sfc Generates a vector of pseudorandom numbers from an exponential distribution
g05sgc Generates a vector of pseudorandom numbers from an exponential mix distribution
g05shc Generates a vector of pseudorandom numbers from an F-distribution
g05sjc Generates a vector of pseudorandom numbers from a gamma distribution
g05skc Generates a vector of pseudorandom numbers from a Normal distribution
g05slc Generates a vector of pseudorandom numbers from a logistic distribution
g05smc Generates a vector of pseudorandom numbers from a log-normal distribution
g05snc Generates a vector of pseudorandom numbers from a Student's t-distribution
g05spc Generates a vector of pseudorandom numbers from a triangular distribution
g05sqc Generates a vector of pseudorandom numbers from a uniform distribution over [a,b]
g05src Generates a vector of pseudorandom numbers from a von Mises distribution
g05ssc Generates a vector of pseudorandom numbers from a Weibull distribution
g05tac Generates a vector of pseudorandom integers from a binomial distribution
g05tbc Generates a vector of pseudorandom logical values
g05tcc Generates a vector of pseudorandom integers from a geometric distribution
g05tdc Generates a vector of pseudorandom integers from a general discrete distribution
g05tec Generates a vector of pseudorandom integers from a hypergeometric distribution
g05tfc Generates a vector of pseudorandom integers from a logarithmic distribution
g05tgc Generates a vector of pseudorandom integers from a multinomial distribution
g05thc Generates a vector of pseudorandom integers from a negative binomial distribution
g05tjc Generates a vector of pseudorandom integers from a Poisson distribution
g05tkc Generates a vector of pseudorandom integers from a Poisson distribution with varying mean
g05tlc Generates a vector of pseudorandom integers from a uniform distribution
g05yjc Generates a Normal quasi-random number sequence
g05ykc Generates a log-normal quasi-random number sequence
g05ylc Initializes a quasi-random number generator
g05ymc Generates a uniform quasi-random number sequence
g05ync Initializes a scrambled quasi-random number generator
g07bfc Estimates parameter values of the generalized Pareto distribution
g13amc Univariate time series, exponential smoothing
m01nac Binary search in set of real numbers
m01nbc Binary search in set of integer numbers
m01ncc Binary search in set of character data
s14ahc Scaled log gamma function lnG(x), where G(x) = γ(x + 1) / (x / e)
s15agc Scaled complement of error function, erfcx(x)
s21bec Elliptic integral of 1st kind, Legendre form, F(φ|m)
s21bfc Elliptic integral of 2nd kind, Legendre form, E(φ|m)
s21bgc Elliptic integral of 3rd kind, Legendre form, Π(n ; φ|m)
s21bhc Complete elliptic integral of 1st kind, Legendre form, K(m)
s21bjc Complete elliptic integral of 2nd kind, Legendre form, E(m)
s30aac Black–Scholes–Merton option pricing formula
s30abc Black–Scholes–Merton option pricing formula with Greeks
s30bac Floating-strike lookback option pricing formula
s30bbc Floating-strike lookback option pricing formula with Greeks
s30cac Binary option: cash-or-nothing pricing formula
s30cbc Binary option: cash-or-nothing pricing formula with Greeks
s30ccc Binary option: asset-or-nothing pricing formula
s30cdc Binary option: asset-or-nothing pricing formula with Greeks
s30fac Standard barrier option pricing formula
s30jac Jump-diffusion, Merton's model, option pricing formula
s30jbc Jump-diffusion, Merton's model, option pricing formula with Greeks
s30nac Heston's model option pricing formula
s30qcc American option: Bjerksund and Stensland pricing formula
s30sac Asian option: geometric continuous average rate pricing formula
s30sbc Asian option: geometric continuous average rate pricing formula with Greeks
x04aec Open file mentioned on command line and return associated file pointer
x04ndc Returns the string error name corresponding to a C Libary exit error code

3  Functions Scheduled for Withdrawal

The functions listed below are scheduled for withdrawal from the NAG C Library, because improved functions have now been included in the Library. You are advised to stop using functions which are scheduled for withdrawal and to use recommended replacement functions instead. See the document ‘Advice on Replacement Calls for Withdrawn/Superseded Functions’ for more detailed guidance, including advice on how to change a call to the old function into a call to its recommended replacement.
The following functions will be withdrawn at Mark 10.
Functions Scheduled
for Withdrawal

Replacement Function(s)
e01sac nag_2d_shep_interp (e01sgc) or nag_2d_triang_interp (e01sjc)
e01sbc nag_2d_shep_eval (e01shc) or nag_2d_triang_eval (e01skc)
e01szc No replacement routine required
e04hcc No longer required
e04hdc No longer required
e04jbc nag_opt_nlp_solve (e04wdc)
e04kbc nag_opt_nlp_solve (e04wdc)
f06pac nag_dgemv (f16pac)
f06pbc nag_dgbmv (f16pbc)
f06pcc nag_dsymv (f16pcc)
f06pdc nag_dsbmv (f16pdc)
f06pec nag_dspmv (f16pec)
f06pfc nag_dtrmv (f16pfc)
f06pgc nag_dtbmv (f16pgc)
f06phc nag_dtpmv (f16phc)
f06pjc nag_dtrsv (f16pjc)
f06pkc nag_dtbsv (f16pkc)
f06plc nag_dtpsv (f16plc)
f06pmc nag_dger (f16pmc)
f06ppc nag_dsyr (f16ppc)
f06pqc nag_dspr (f16pqc)
f06prc nag_dsyr2 (f16prc)
f06psc nag_dspr2 (f16psc)
f06sac nag_zgemv (f16sac)
f06sbc nag_zgbmv (f16sbc)
f06scc nag_zhemv (f16scc)
f06sdc nag_zhbmv (f16sdc)
f06sec nag_zhpmv (f16sec)
f06sfc nag_ztrmv (f16sfc)
f06sgc nag_ztbmv (f16sgc)
f06shc nag_ztpmv (f16shc)
f06sjc nag_ztrsv (f16sjc)
f06skc nag_ztbsv (f16skc)
f06slc nag_ztpsv (f16slc)
f06smc nag_zger (f16smc)
f06snc nag_zger (f16smc)
f06spc nag_zher (f16spc)
f06sqc nag_zhpr (f16sqc)
f06src nag_zher2 (f16src)
f06ssc nag_zhpr2 (f16ssc)
f06yac nag_dgemm (f16yac)
f06ycc nag_dsymm (f16ycc)
f06yfc nag_dtrmm (f16yfc)
f06yjc nag_dtrsm (f16yjc)
f06ypc nag_dsyrk (f16ypc)
f06yrc nag_dsyr2k (f16yrc)
f06zac nag_zgemm (f16zac)
f06zcc nag_zhemm (f16zcc)
f06zfc nag_ztrmm (f16zfc)
f06zjc nag_ztrsm (f16zjc)
f06zpc nag_zherk (f16zpc)
f06zrc nag_zher2k (f16zrc)
f06ztc nag_zsymm (f16ztc)
f06zuc nag_zsyrk (f16zuc)
f06zwc nag_zsyr2k (f16zwc)
The following functions have been superseded, but will not be withdrawn from the Library until Mark 11 at the earliest.
Superseded
Function

Replacement Function(s)
c05adc nag_zero_cont_func_bd_1 (c05sdc)
c05nbc nag_zero_nonlin_eqns_1 (c05tbc)
c05pbc nag_zero_nonlin_eqns_deriv_1 (c05ubc)
c05zbc nag_check_deriv_1 (c05zcc)
d01ajc nag_1d_quad_gen_1 (d01sjc)
d01akc nag_1d_quad_osc_1 (d01skc)
d01alc nag_1d_quad_brkpts_1 (d01slc)
d01amc nag_1d_quad_inf_1 (d01smc)
d01apc nag_1d_quad_wt_alglog_1 (d01spc)
d01aqc nag_1d_quad_wt_cauchy_1 (d01sqc)
d01asc nag_1d_quad_inf_wt_trig_1 (d01ssc)
d01bac nag_1d_quad_gauss_1 (d01tac)
d01fcc nag_multid_quad_adapt_1 (d01wcc)
d01gbc nag_multid_quad_monte_carlo_1 (d01xbc)
e04ccc nag_opt_simplex_easy (e04cbc)
g01cec nag_deviates_normal (g01fac)
g05cac nag_rand_basic (g05sac)
g05cbc nag_rand_init_repeatable (g05kfc)
g05ccc nag_rand_init_nonrepeatable (g05kgc)
g05cfc No replacement routine required
g05cgc No replacement routine required
g05dac nag_rand_uniform (g05sqc)
g05dbc nag_rand_exp (g05sfc)
g05ddc nag_rand_normal (g05skc)
g05dyc nag_rand_discrete_uniform (g05tlc)
g05eac nag_rand_matrix_multi_normal (g05rzc)
g05ecc nag_rand_poisson (g05tjc)
g05edc nag_rand_binomial (g05tac)
g05ehc nag_rand_permute (g05ncc)
g05ejc nag_rand_sample (g05ndc)
g05exc nag_rand_gen_discrete (g05tdc)
g05eyc nag_rand_gen_discrete (g05tdc)
g05ezc nag_rand_matrix_multi_normal (g05rzc)
g05fec nag_rand_beta (g05sbc)
g05ffc nag_rand_gamma (g05sjc)
g05hac nag_rand_arma (g05phc)
g05hkc nag_rand_agarchI (g05pdc)
g05hlc nag_rand_agarchII (g05pec)
g05hmc nag_rand_garchGJR (g05pfc)
g05kac nag_rand_basic (g05sac)
g05kbc nag_rand_init_repeatable (g05kfc)
g05kcc nag_rand_init_nonrepeatable (g05kgc)
g05kec nag_rand_logical (g05tbc)
g05lac nag_rand_normal (g05skc)
g05lbc nag_rand_students_t (g05snc)
g05lcc nag_rand_chi_sq (g05sdc)
g05ldc nag_rand_f (g05shc)
g05lec nag_rand_beta (g05sbc)
g05lfc nag_rand_gamma (g05sjc)
g05lgc nag_rand_uniform (g05sqc)
g05lhc nag_rand_triangular (g05spc)
g05ljc nag_rand_exp (g05sfc)
g05lkc nag_rand_lognormal (g05smc)
g05llc nag_rand_cauchy (g05scc)
g05lmc nag_rand_weibull (g05ssc)
g05lnc nag_rand_logistic (g05slc)
g05lpc nag_rand_von_mises (g05src)
g05lqc nag_rand_exp_mix (g05sgc)
g05lxc nag_rand_matrix_multi_students_t (g05ryc)
g05lyc nag_rand_matrix_multi_normal (g05rzc)
g05lzc nag_rand_matrix_multi_normal (g05rzc)
g05mac nag_rand_discrete_uniform (g05tlc)
g05mbc nag_rand_geom (g05tcc)
g05mcc nag_rand_neg_bin (g05thc)
g05mdc nag_rand_logarithmic (g05tfc)
g05mec nag_rand_compd_poisson (g05tkc)
g05mjc nag_rand_binomial (g05tac)
g05mkc nag_rand_poisson (g05tjc)
g05mlc nag_rand_hypergeometric (g05tec)
g05mrc nag_rand_gen_multinomial (g05tgc)
g05mzc nag_rand_gen_discrete (g05tdc)
g05nac nag_rand_permute (g05ncc)
g05nbc nag_rand_sample (g05ndc)
g05pac nag_rand_arma (g05phc)
g05pcc nag_rand_varma (g05pjc)
g05qac nag_rand_orthog_matrix (g05pxc)
g05qbc nag_rand_corr_matrix (g05pyc)
g05qdc nag_rand_2_way_table (g05pzc)
g05rac nag_rand_copula_normal (g05rdc)
g05rbc nag_rand_copula_students_t (g05rcc)
g05yac nag_quasi_init (g05ylc) and nag_quasi_rand_uniform (g05ymc)
g05ybc nag_quasi_rand_normal (g05yjc) and nag_quasi_init (g05ylc)
x02dac No longer required

NAG C Library News, Mark 9 (PDF version)
NAG C Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009