Accurate Numerical Derivatives

Methods for calculating (usually) accurate numerical first and second order derivatives. Accurate calculations are done using 'Richardson''s' extrapolation or, when applicable, a complex step derivative is available. A simple difference method is also provided. Simple difference is (usually) less accurate but is much quicker than 'Richardson''s' extrapolation and provides a useful cross-check. Methods are provided for real scalar and vector valued functions.


News

Known BUGS

o the hessian function in numDeriv does not accept method="simple".

o When method="Richardson", it does not work when r=1, because of subscripting issues. Should fix this such that it does a central difference approximation, without any extrapolation.

Changes in numDeriv version 2016.8-1

o simplification of hessian.default() call to jacobian() and grad() in the case of method 'complex' (pointed out by Andreas Rappold).

o added argument 'side=NULL' in the hessian.default() call to jacobian() and grad() in the case of method 'complex' to ensure proper passing of ... arguments to the function for which the hessian is being calculated (pointed out by Andreas Rappold).

Changes in numDeriv version 2014.2-1

o added argument 'side' to allow one-sided first derivatives (grad and jacobian) for simple and Richardson methods.

o minor documentation improvements.

Changes in numDeriv version 2013.2-1

o updated R dependency from 1.8.1 to 2.11.1 because of complex step derivative dependency on a fix to exponentiation with integers (pointed out by Hans W. Borchers).

o added flag in DESCRIPTION to ByteComple.

Changes in numDeriv version 2012.9-1

o added complex step derivatives (from Ravi Varadhan) and related tests.

o changed method.args to an empty list in the default methods, as the real defaults depend on the approximation, and are documented in details.

Changes in numDeriv version 2012.3-1

o no real changes, but bumping version for new CRAN suitability check.

Changes in numDeriv version 2011.11-2

o fixed genD documentation error for denominator in f" (d^2 rather than 2*d noticed by Yilun Wang)

Changes in numDeriv version 2011.11-1

o updated maintainer email address.

Changes in numDeriv version 2010.11-1

o Added warning in the documentation regarding trying to pass arguments in ... with the same names as numDeriv function arguments.

Changes in numDeriv version 2010.2-1

o Added more graceful failure in the case of NA returned by a function (thanks to Adam Kramer).

Changes in numDeriv version 2009.2-2

o Standardized NEWS format for new function news().

Changes in numDeriv version 2009.2-1

o argument zero.tol was added to grad, jacobian and genD, and is used to test if parameters are zero in order to determine if eps should be used in place of d. Previous tests using == did not work for very small values.

o defaults argument d to grad was 0.0001, but specification made it appear to be 0.1. Specification was changed to make default clear.

o unnecessary hessian.default argument setting was removed (they are just passed to genD which duplicated the setting).

o Some documentation links to [stats]numericDeriv mistakenly called numericalDeriv were fixed.

Changes in numDeriv version 2006.4-1

o First released version.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("numDeriv")

2016.8-1 by Paul Gilbert, 2 years ago


http://optimizer.r-forge.r-project.org/


Browse source code at https://github.com/cran/numDeriv


Authors: Paul Gilbert and Ravi Varadhan


Documentation:   PDF Manual  


Task views: Numerical Mathematics


GPL-2 license



Imported by ARCensReg, ARpLMEC, AssetCorr, BIGL, BLPestimatoR, BMhyb, BMhyd, BayesianTools, BinaryEPPM, CIAAWconsensus, CensSpatial, Countr, CountsEPPM, DoubleExpSeq, EKMCMC, Epi, FDGcopulas, FENmlm, GAS, GB2, GB2group, GDINA, GJRM, GPvam, HAC, HRQoL, ICcalib, IPEC, Infusion, IsoriX, LAM, MIIVsem, MPTinR, MSGARCH, MixGHD, OUwie, PLmixed, PROreg, PSM, PrevMap, ProbitSpatial, Rcgmin, RealVAMS, Renext, SIRE, SIfEK, SPAS, StVAR, StableEstim, SurvRegCensCov, TKF, Temporal, ThreeArmedTrials, ThresholdROC, VCA, WeMix, ZOIP, antitrust, apollo, automultinomial, bbmle, blackbox, brglm2, carfima, chandwich, climwin, clusteredinterference, cmpprocess, condGEE, copula, corHMM, coxphMIC, ctmcd, ctmm, dynr, equateMultiple, fastR2, fdapace, finiteruinprob, flexCWM, frailtyEM, frailtySurv, gamCopula, geex, geostatsp, gim, glmmsr, gofCopula, greybox, gsg, highfrequency, indelmiss, inferference, intccr, ivtools, kergp, lacm, lava, lavaan, lbfgsb3c, lmerTest, lsbs, mafs, marcher, marked, markophylo, mccmeiv, metRology, metaSEM, metaplus, mets, mev, mexhaz, mfGARCH, midasr, milr, misclassGLM, misreport, mlt, mlt.docreg, momentuHMM, moveHMM, mpath, mrds, multicmp, mvglmmRank, mvord, nlmixr, optimr, optimx, ordinal, pacotest, phenofit, phytools, pifpaf, predictmeans, pssm, ptmixed, rERR, robmixglm, robustBLME, robustloggamma, robustvarComp, rodd, rugarch, sarima, sars, sdprisk, sensR, seqHMM, sklarsomega, skyscapeR, smam, sn, sns, spfrontier, stdReg, stochprofML, strandCet, survey, tcpl, temperatureresponse, timereg, touchard, umx, vcrpart, xmeta.

Depended on by B2Z, BiProbitPartial, CBPS, CompDist, CompLognormal, DIMORA, DOBAD, HPbayes, QRM, SemiMarkov, SpeciesMix, alabama, bayesDccGarch, bnormnlr, catIrt, compound.Cox, copCAR, dsm, embryogrowth, fgof, fishmethods, fracprolif, ghyp, lbfgsb3, lcpm, lmeNB, ltbayes, mederrRank, mgpd, mipfp, mixlink, nmw, optextras, phenology, rxSeq, sgt, ssym, tbd, turboEM, wnl.

Suggested by BB, DiceKriging, DoseFinding, GauPro, IGP, KFKSDS, LambertW, OpenMx, ROI, RSSL, SuperGauss, TMB, TestFunctions, VineCopula, aster, cccp, discSurv, diversitree, docopulae, emdbook, flacco, flexsurv, gcKrig, glmx, gof, hhh4contacts, lavaSearch2, lfe, lme4, meta, metafor, miceadds, mlr, msm, nlmrt, nlsr, optimParallel, pso, psychomix, regsem, riskParityPortfolio, rpf, schumaker, smooth, smovie, sna, sparseHessianFD, stsm, stsm.class, surveillance, ucminf.


See at CRAN