Module math

Source
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 and rep 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)
ExponentialInterpolator
Exponential Interpolator.
Gamma
Gamma distribution
Gaussian
Gaussian (normal) distribution: X ~ N(mu, sigma^2) https://en.wikipedia.org/wiki/Normal_distribution
GradientDescent
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.
GradientDescentResult
Result of the gradient descent optimization.
LinearInterpolator
Linear Interpolator.
Poisson
Poisson distribution: X ~ Pois(lambda)
PortfolioMeasures
Portfolio struct for risk-reward measures.
Uniform
Uniform distribution: X ~ Uni(a, b)

Enums§

DistributionClass
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.
InterpolationIndex
Trait describing requirements to be an index of interpolation.
InterpolationValue
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 to b. 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