Liking cljdoc? Tell your friends :D

emmy.calculus.derivative

This namespace implements a number of differential operators like D, and the machinery to apply D to various structures.

This namespace implements a number of differential operators like [[D]], and
the machinery to apply [[D]] to various structures.
raw docstring

Dclj/s

Derivative operator. Takes some function f and returns a function whose value at some point can multiply an increment in the arguments, to produce the best linear estimate of the increment in the function value.

For univariate functions, D computes a derivative. For vector-valued functions, D computes the Jacobian of f.

The related [[Grad]] returns a function that produces a structure of the opposite orientation as D. Both of these functions use forward-mode automatic differentiation.

Derivative operator. Takes some function `f` and returns a function
whose value at some point can multiply an increment in the arguments, to
produce the best linear estimate of the increment in the function value.

For univariate functions, [[D]] computes a derivative. For vector-valued
functions, [[D]] computes
the [Jacobian](https://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant)
of `f`.

The related [[Grad]] returns a function that produces a structure of the
opposite orientation as [[D]]. Both of these functions use forward-mode
automatic differentiation.
sourceraw docstring

D-as-matrixclj/s

(D-as-matrix F)
source

derivativeclj/s

(derivative f)

Returns a single-argument function of that, when called with an argument x, returns the derivative of f at x using forward-mode automatic differentiation.

For numerical differentiation, see emmy.numerical.derivative/D-numeric.

f must be built out of generic operations that know how to handle [[d/Differential]] inputs in addition to any types that a normal (f x) call would present. This restriction does not apply to operations like putting x into a container or destructuring; just primitive function calls.

Returns a single-argument function of that, when called with an argument `x`,
returns the derivative of `f` at `x` using forward-mode automatic
differentiation.

For numerical differentiation,
see [[emmy.numerical.derivative/D-numeric]].

`f` must be built out of generic operations that know how to
handle [[d/Differential]] inputs in addition to any types that a normal `(f
x)` call would present. This restriction does _not_ apply to operations like
putting `x` into a container or destructuring; just primitive function calls.
sourceraw docstring

partialclj/s

(partial & selectors)

Returns an operator that, when applied to a function f, produces a function that computes the partial derivative of f at the (zero-based) slot index provided via selectors.

Returns an operator that, when applied to a function `f`, produces a function
that computes the partial derivative of `f` at the (zero-based) slot index
provided via `selectors`.
sourceraw docstring

symbolic-taylor-seriesclj/s

(symbolic-taylor-series f)
(symbolic-taylor-series f & xs)

Similar to taylor-series, except f is evaluated with symbolic arguments, and these arguments are only replaced with the values xs after Taylor series expansion.

Please see the docs for taylor-series!

Similar to [[taylor-series]], except `f` is evaluated with symbolic arguments,
and these arguments are only replaced with the values `xs` after Taylor series
expansion.

Please see the docs for [[taylor-series]]!
sourceraw docstring

taylor-seriesclj/s

(taylor-series f)
(taylor-series f & xs)

Given a differentiable function f and any number of arguments xs, returns a [[emmy.series/PowerSeries]] representing the Taylor series of the function f expanded at xs.

Calling taylor-series with no arguments will return the Maclaurin series of f, i.e., the Taylor series expansion at (= x 0).

Calling the returned power series with incremental argument dx will produce a [[emmy.series/Series]] representing the terms of the Taylor series of f expanded at x and evaluated at x+dx.

NOTE: Just like the D operator, functions f of multiple-arguments are treated as a function of a single structural argument. If you pass multiple arguments xs, you'll have to manually wrap your multiple-argument dx in a emmy.structure/up or a vector before passing it to the returned power series.

NOTE: The typical definition of a Taylor series of f expanded around some point x is

$$T(p) = f(x) + \frac{f'(x)}{1!}(p-x) + \frac{f''(x)}{2!} (p-x)^2 + \ldots,$$

where p is the evaluation point. When (= p x), all derivatives of the Taylor series expansion of f will exactly match the derivatives of f itself.

The Taylor series returned here (call it $T'$) is actually a function of dx, where

$$T'(dx) = T(x+dx) = f(x) + \frac{f'(x)}{1!}(dx) + \frac{f''(x)}{2!} (dx)^2 + \ldots.$$

Given a differentiable function `f` and any number of arguments `xs`, returns
a [[emmy.series/PowerSeries]] representing the [Taylor
series](https://en.wikipedia.org/wiki/Taylor_series) of the function `f`
expanded at `xs`.

Calling [[taylor-series]] with no arguments will return the [Maclaurin
series](https://en.wikipedia.org/wiki/Taylor_series#List_of_Maclaurin_series_of_some_common_functions)
of `f`, i.e., the Taylor series expansion at `(= x 0)`.

Calling the returned power series with incremental argument `dx` will produce
a [[emmy.series/Series]] representing the terms of the Taylor series of
`f` expanded at `x` and evaluated at `x+dx`.

NOTE: Just like the [[D]] operator, functions `f` of multiple-arguments are
treated as a function of a single structural argument. If you pass multiple
arguments `xs`, you'll have to manually wrap your multiple-argument `dx` in
a [[emmy.structure/up]] or a vector before passing it to the returned
power series.

NOTE: The typical definition of a Taylor series of `f` expanded around some
point `x` is

$$T(p) = f(x) + \frac{f'(x)}{1!}(p-x) + \frac{f''(x)}{2!} (p-x)^2 + \ldots,$$

where `p` is the evaluation point. When `(= p x)`, all derivatives of the
Taylor series expansion of `f` will exactly match the derivatives of `f`
itself.

The Taylor series returned here (call it $T'$) is actually a function of `dx`,
where

$$T'(dx) = T(x+dx) = f(x) + \frac{f'(x)}{1!}(dx) + \frac{f''(x)}{2!} (dx)^2 + \ldots.$$
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close