Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 648 Bytes

README.md

File metadata and controls

40 lines (27 loc) · 648 Bytes

differential

The goal of differential is to provide Automatic Differentiation for arbitrary R code.

Installation

You can install the development version of differential from GitHub with:

# install.packages("pak")
pak::pkg_install("fangzhou-xie/differential")

Example

Automatic differentiation

library(differential)

e <- quote(3*x^2)
gradient(e, wrt(e))
#> 6 * x

(Simple) Algebraic Simplification

e <- quote(3*x^2+a*x^2)
simplify(e)
#> x^2 * (3 + a)