package numerics
Contains several standard numerical functions as MappingUFuncs,
- Alphabetic
- By Inheritance
- numerics
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Package Members
Type Members
- trait Scaling extends AnyRef
Scaling utilities.
Scaling utilities.
Often, in order to avoid underflow, we can offload some of the exponent of a double into an int. To make things more efficient, we can actually share that exponent between doubles.
The scales used in this trait are in log space: they can be safely added and subtracted.
Value Members
- val Inf: Double
- val NaN: Double
- def closeTo(a: Double, b: Double, relDiff: Double = 1E-4): Boolean
closeTo for Doubles.
- val inf: Double
- val nan: Double
- def polyval(coefs: Array[Double], x: Double): Double
Computes the polynomial P(x) with coefficients given in the passed in array.
Computes the polynomial P(x) with coefficients given in the passed in array. coefs(i) is the coef for the x_i term.
- object Bessel
Implementations of the Bessel functions, based on Numerical Recipes
- object Conversions
Package for common unit conversions.
- object I extends ZeroPreservingUFunc
The indicator function.
The indicator function. 1.0 iff b, else 0.0 For non-boolean arguments, 1.0 iff b != 0, else 0.0
- object IntMath
- object Scaling extends Scaling
- object abs extends ZeroPreservingUFunc
- object acos extends MappingUFunc
- object acosh extends MappingUFunc
- object asin extends ZeroPreservingUFunc
- object asinh extends ZeroPreservingUFunc
- object atan extends ZeroPreservingUFunc
- object atan2 extends MappingUFunc
- object atanh extends ZeroPreservingUFunc
- object cbrt extends ZeroPreservingUFunc
- object ceil extends ZeroPreservingUFunc
- object cos extends MappingUFunc
- object cosh extends MappingUFunc
- object digamma extends MappingUFunc
The derivative of the log gamma function
- object erf extends ZeroPreservingUFunc
An approximation to the error function
- object erfc extends MappingUFunc
An approximation to the complementary error function: erfc(x) = 1 - erfc(x)
- object erfcinv extends MappingUFunc
Inverse erfc
- object erfi extends MappingUFunc
The imaginary error function for real argument x.
The imaginary error function for real argument x.
Adapted from http://www.mathworks.com/matlabcentral/newsreader/view_thread/24120 verified against mathematica
- object erfinv extends MappingUFunc
Inverse erf
- object exp extends MappingUFunc
- object expm1 extends ZeroPreservingUFunc
- object floor extends ZeroPreservingUFunc
- object gammp extends MappingUFunc
regularized incomplete gamma function \int_0x \exp(-t)pow(t,a-1) dt / Gamma(a)
regularized incomplete gamma function \int_0x \exp(-t)pow(t,a-1) dt / Gamma(a)
- See also
http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/special/Gamma.html#regularizedGammaP(double, double)
- object gammq extends MappingUFunc
regularized incomplete gamma function \int_0x \exp(-t)pow(t,a-1) dt / Gamma(a)
regularized incomplete gamma function \int_0x \exp(-t)pow(t,a-1) dt / Gamma(a)
- See also
http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/special/Gamma.html#regularizedGammaP(double, double)
- object isEven extends MappingUFunc
Whether a number is even.
Whether a number is even. For Double and Float, isEven also implies that the number is an integer, and therefore does not necessarily equal !isOdd for fractional input.
- object isFinite extends MappingUFunc
- object isNonfinite extends ZeroPreservingUFunc
- object isOdd extends ZeroPreservingUFunc
Whether a number is odd.
Whether a number is odd. For Double and Float, isOdd also implies that the number is an integer, and therefore does not necessarily equal !isEven for fractional input.
- object lbeta extends UFunc
Evaluates the log of the generalized beta function.
Evaluates the log of the generalized beta function. \sum_a lgamma(c(a))- lgamma(c.sum)
- object lgamma extends MappingUFunc
Computes the log of the gamma function.
Computes the log of the gamma function. The two parameter version is the log Incomplete gamma function = \log \int_0x \exp(-t)pow(t,a-1) dt
- returns
an approximation of the log of the Gamma function of x.
- object log extends MappingUFunc
- object log10 extends MappingUFunc
- object log1p extends MappingUFunc
- object log2 extends MappingUFunc
- object logI extends UFunc with MappingUFunc
The indicator function in log space: 0.0 iff b else Double.NegativeInfinity
- object logit extends MappingUFunc
The logit (inverse sigmoid) function: -log((1/x) - 1)
- object multidigamma extends MappingUFunc
Multivariate Digamma
- object multidigammalog extends MappingUFunc
Multivariate digamma log
- object multiloggamma extends MappingUFunc
- object nextExponent extends MappingUFunc
- object nextExponent10 extends MappingUFunc
- object nextExponent2 extends MappingUFunc
- object nextPower extends MappingUFunc
- object nextPower10 extends MappingUFunc
- object nextPower2 extends MappingUFunc
- object pow extends MappingUFunc
- object relu extends ZeroPreservingUFunc
The Relu function: max(0, x)
The Relu function: max(0, x)
- See also
https://en.wikipedia.org/wiki/Rectifier_(neural_networks)
- object rint extends ZeroPreservingUFunc
- object round extends ZeroPreservingUFunc
- object sech extends MappingUFunc
- object sigmoid extends MappingUFunc
The sigmoid function: 1/(1 + exp(-x))
- object signum extends ZeroPreservingUFunc
- object sin extends ZeroPreservingUFunc
- object sinc extends MappingUFunc
The sine cardinal (sinc) function, as defined by sinc(0)=1, sinc(n != 0)=sin(x)/x.
The sine cardinal (sinc) function, as defined by sinc(0)=1, sinc(n != 0)=sin(x)/x. Note that this differs from some signal analysis conventions, where sinc(n != 0) is defined by sin(Pi*x)/(Pi*x). This variant is provided for convenience as breeze.numerics.sincpi. Use it instead when translating from numpy.sinc..
- object sincpi extends MappingUFunc
The pi-normalized sine cardinal (sinc) function, as defined by sinc(0)=1, sinc(n != 0)=sin(Pi*x)/(Pi*x).
The pi-normalized sine cardinal (sinc) function, as defined by sinc(0)=1, sinc(n != 0)=sin(Pi*x)/(Pi*x). See also breeze.numerics.sinc.
- object sinh extends ZeroPreservingUFunc
- object sqrt extends ZeroPreservingUFunc
- object step extends MappingUFunc
The Step function: if (x > 0) 1 else 0
The Step function: if (x > 0) 1 else 0
- See also
https://en.wikipedia.org/wiki/Step_function
- object tan extends ZeroPreservingUFunc
- object tanh extends ZeroPreservingUFunc
- object toDegrees extends ZeroPreservingUFunc
- object toRadians extends ZeroPreservingUFunc
- object trigamma extends MappingUFunc
The second derivative of the log gamma function