Expand description
The math
module.
Modules§
- distributions
- Statistical distributions.
- fft
- Fast fourier transform.
- integration
- Numerical integration routines. The primary (useful) integrator is the Tanh-Sinh (double exponential) implementation. This module contains functions for numerical integration.
- interpolation
- Interpolation routines.
- optimization
- Numerical optimization and root-finding routines.
- risk_
reward - Simple risk/reward measures.
- rootfinding
- Root-finding routines.
- sequences
- Sequences of numbers and associated functions.
Sequences of numbers in the style of R’s
seq
andrep
functions. - statistic
- Statistic trait.
Structs§
- Bernoulli
- Bernoulli distribution: X ~ Bern(p)
- Binomial
- Binomial distribution: X ~ Bin(n, p)
- ChiSquared
- Chi-Squared distribution: X ~ ChiSq(k)
- Exponential
- Exponential distribution: X ~ Exp(lambda)
- Exponential
Interpolator - Exponential Interpolator.
- Gamma
- Gamma distribution
- Gaussian
- Gaussian (normal) distribution: X ~ N(mu, sigma^2) https://en.wikipedia.org/wiki/Normal_distribution
- Gradient
Descent - Gradient descent optimizer. NOTE: Only for functions $f: \mathbb{R}^n \rightarrow \mathbb{R}$ for now. The gradient descent optimizer is an iterative algorithm that finds the local minimum of a function. The algorithm starts with an initial guess for the local minimum and moves iteratively in the direction of the negative gradient until the gradient is close to zero.
- Gradient
Descent Result - Result of the gradient descent optimization.
- Linear
Interpolator - Linear Interpolator.
- Poisson
- Poisson distribution: X ~ Pois(lambda)
- Portfolio
Measures - Portfolio struct for risk-reward measures.
- Uniform
- Uniform distribution: X ~ Uni(a, b)
Enums§
- Distribution
Class - Distribution class/type.
Constants§
- ABSCISSAE
- Abscissae: the nodes for the sum evaluation.
- N
- Standard-Normal distribution convenience constant.
- WEIGHTS
- Weights for the sum evaluation.
- i
- Imaginary unit.
Traits§
- Distribution
- Base trait for all distributions. Provides common methods for all distributions. All distributions must implement this trait.
- Interpolation
Index - Trait describing requirements to be an index of interpolation.
- Interpolation
Value - Trait describing requirements to be interpolated.
- Interpolator
- Interpolator trait. This trait is implemented by all interpolation models.
- Sequence
- Trait for generating sequences of numbers.
- Statistic
- Statistics trait for vectors of floating point numbers.
Functions§
- fft_
complex - Complex FFT and returns a new vector,
x
length must be a power of 2 - fft_
complex_ inplace - Complex FFT inplace,
x
length must be a power of 2 - fft_
real - Real FFT and returns a new vector,
x
length must be a power of 2 - fft_
real_ inplace - Real FFT inplace,
x
length must be a power of 2 - integrate
- Integrates a function from
a
tob
. Uses the Tanh-Sinh quadrature over [-1, +1] and then transforms to an integral over [a, b]. - is_
valid_ length - Helper function to check if a vector length is a power of 2