Package: nabla 0.7.2

Alexander Towell

nabla: Exact Derivatives via Automatic Differentiation

Automatic differentiation for R functions written with supported scalar arithmetic and mathematical operations. Provides a composable derivative operator D that computes gradients, Hessians, Jacobians, and arbitrary-order derivative tensors at machine precision. D(D(f)) gives Hessians, D(D(D(f))) gives third-order tensors for skewness of maximum likelihood estimators, and so on to higher orders. Supports loops and executed branches composed of supported operations. Uses nested dual numbers without finite difference truncation error; floating-point rounding and conditioning still affect results.

Authors:Alexander Towell [aut, cre]

nabla_0.7.2.tar.gz
nabla_0.7.2.zip(r-4.7-any)nabla_0.7.2.zip(r-4.6-any)
nabla_0.7.2.tar.gz(r-4.7-any)nabla_0.7.2.tar.gz(r-4.6-any)
nabla_0.7.2.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
nabla/json (API)

# Install 'nabla' in R:
install.packages('nabla', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/queelius/nabla/issues

On CRAN:

Conda:

3.70 score 8 scripts 163 downloads 26 exports 0 dependencies

Last updated from:2c225a419a. Checks:6 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-develOK152
source / vignettesOK178
linux-releaseOK151
windows-develOK71
windows-releaseOK109
wasm-releaseOK86

Exports:atan2betaDderivderiv_ndifferentiate_ndualdual_constantdual_constant_ndual_variabledual_variable_ndual_vectorerferfcgradienthessianis_dualjacobianlbetaMathMath2OpspsigammashowSummaryvalue

Dependencies:

Gradient and Hessian Computation with nabla
Helper: finite difference utilities | Normal log-likelihood: known sigma, unknown mu | Normal log-likelihood: unknown mu and sigma | Poisson log-likelihood: unknown lambda | Visualizing the gradient | Gamma log-likelihood: unknown shape, known rate | Logistic regression: 2 predictors | Newton-Raphson optimizer | Contour plot: Normal(mu, sigma) log-likelihood surface | Newton-Raphson convergence path | jacobian(): differentiating a vector-valued function | Summary

Last update: 2026-02-10
Started: 2026-02-10

Higher-Order Derivatives
The D operator | Curvature analysis | Visualizing curvature along sin(x) | Taylor expansion | Connection to MLE: exact Hessians for standard errors | How it works: nested duals | Summary

Last update: 2026-02-10
Started: 2026-02-10

Higher-Order MLE Analysis
Motivation | The Gamma model | Finding the MLE | Score and observed information | Third-order derivative tensor | Asymptotic skewness of the MLE | Monte Carlo validation | Visualizing MLE asymmetry | Summary

Last update: 2026-02-10
Started: 2026-02-10

Introduction to nabla
What is nabla? | Quick start | Works through any R code | Multi-parameter functions | Quick comparison: three ways to differentiate | Why exact derivatives matter | How it works: dual numbers | What's next?

Last update: 2026-02-10
Started: 2026-02-10

Optimizer Integration
Introduction | optim() with AD gradients | nlminb() with AD gradient + Hessian | Logistic regression example | Standard errors from the Hessian | Convergence comparison | Summary

Last update: 2026-02-10
Started: 2026-02-10

Readme and manuals

Help Manual

Help pageTopics
nabla: Exact Derivatives via Automatic Differentiationnabla-package nabla
Beta function for dual numbersbeta beta,ANY,ANY-method beta,numeric,numeric-method
Composable total derivative operatorD
Extract the derivative (tangent) part of a dual numberderiv deriv,dualr-method deriv,numeric-method
Extract the k-th derivative from a nested dual resultderiv_n
Compute a function value and all derivatives up to order ndifferentiate_n
Create a dual numberdual
Create a dual constant (derivative seed = 0)dual_constant
Create a constant dual for n-th order differentiationdual_constant_n
Create a dual variable (derivative seed = 1)dual_variable
Create a dual seeded for n-th order differentiationdual_variable_n
Create a vector of dual numbersdual_vector
Indexing and length for dual_vectordual_vector-access length,dual_vector-method [,dual_vector,numeric-method
Dual Number Vectordual_vector-class
Arithmetic and comparison operators for dual numbers!,dualr-method *,dualr,dualr-method *,dualr,numeric-method *,numeric,dualr-method +,dualr,dualr-method +,dualr,missing-method +,dualr,numeric-method +,numeric,dualr-method -,dualr,dualr-method -,dualr,missing-method -,dualr,numeric-method -,numeric,dualr-method /,dualr,dualr-method /,dualr,numeric-method /,numeric,dualr-method dual-arithmetic Ops,dualr,dualr-method Ops,dualr,numeric-method Ops,numeric,dualr-method ^,dualr,dualr-method ^,dualr,numeric-method ^,numeric,dualr-method
Two-argument arctangent for dual numbersatan2,dualr,dualr-method atan2,dualr,numeric-method atan2,numeric,dualr-method dual-atan2
Coerce dual to numericas.numeric,dualr-method dual-coerce
Combine dual numbers into a dual_vectorc,dualr-method dual-combine
Check if a dual number is numericdual-is-numeric is.numeric,dualr-method
Logarithm with optional base for dual numbersdual-log log,dualr-method
Math group generic for dual numbersdual-math exp,dualr-method Math,dualr-method sqrt,dualr-method
Math2 group generic for dual numbersdual-math2 Math2,dualr-method
Piecewise max and min for dual numbersdual-maxmin max,dualr-method min,dualr-method
Display a dual numberdual-show show,dualr-method show,dual_vector-method
Summary group generic for dual numbersdual-summary Summary,dualr-method
Dual Number Class for Automatic Differentiationdualr-class
Error functionerf erf,dualr-method erf,numeric-method
Complementary error functionerfc erfc,dualr-method erfc,numeric-method
Compute the gradient of a scalar-valued functiongradient
Compute the Hessian of a scalar-valued functionhessian
Test whether an object is a dual numberis_dual
Compute the Jacobian of a vector-valued functionjacobian
Log-beta function for dual numberslbeta lbeta,dualr,dualr-method lbeta,dualr,numeric-method lbeta,numeric,dualr-method lbeta,numeric,numeric-method
Polygamma function for dual numberspsigamma psigamma,dualr-method psigamma,numeric-method
Extract the value (primal) part of a dual numbervalue value,dualr-method value,numeric-method