|
double | NAV::math::calcEllipticalIntegral (double phi, double m) |
| Calculates the incomplete elliptical integral of the second kind.
|
|
template<typename T , typename = std::enable_if_t<std::is_floating_point_v<T>>> |
T | NAV::math::csc (const T &x) |
| Calculates the cosecant of a value (csc(x) = sec(pi/2 - x) = 1 / sin(x))
|
|
uint64_t | NAV::math::factorial (uint64_t n) |
| Calculates the factorial of an unsigned integer.
|
|
template<typename Out , size_t Bits, typename In , typename = std::enable_if_t<std::is_integral_v<Out>>, typename = std::enable_if_t<std::is_integral_v<In>>> |
constexpr Out | NAV::math::interpretAs (In in) |
| Interprets the input integer with certain amount of Bits as Output type. Takes care of sign extension.
|
|
template<typename Derived > |
Derived::PlainObject | NAV::math::lerp (const Eigen::MatrixBase< Derived > &a, const Eigen::MatrixBase< Derived > &b, const typename Derived::Scalar &t) |
| Linear interpolation between vectors.
|
|
template<typename Derived > |
std::pair< Eigen::Matrix< typename Derived::Scalar, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime >, Eigen::Vector< typename Derived::Scalar, Derived::RowsAtCompileTime > > | NAV::math::LtDLdecomp_choleskyFact (const Eigen::MatrixBase< Derived > &Q) |
| Find (L^T D L)-decomposition of Q-matrix via a backward Cholesky factorization in a bordering method formulation.
|
|
template<typename Derived > |
std::pair< Eigen::Matrix< typename Derived::Scalar, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime >, Eigen::Vector< typename Derived::Scalar, Derived::RowsAtCompileTime > > | NAV::math::LtDLdecomp_outerProduct (const Eigen::MatrixBase< Derived > &Qmatrix) |
| Find (L^T D L)-decomposition of Q-matrix via outer product method.
|
|
double | NAV::math::normalCDF (double value) |
| Calculates the cumulative distribution function (CDF) of the standard normal distribution.
|
|
template<typename T , typename = std::enable_if_t<std::is_floating_point_v<T>>> |
constexpr T | NAV::math::round (const T &value, size_t digits) |
| Round the number to the specified amount of digits.
|
|
template<typename T , typename = std::enable_if_t<std::is_floating_point_v<T>>> |
constexpr T | NAV::math::roundSignificantDigits (T value, size_t digits) |
| Round the number to the specified amount of significant digits.
|
|
template<typename T , typename = std::enable_if_t<std::is_floating_point_v<T>>> |
T | NAV::math::sec (const T &x) |
| Calculates the secant of a value (sec(x) = csc(pi/2 - x) = 1 / cos(x))
|
|
template<typename T > |
int | NAV::math::sgn (const T &val) |
| Returns the sign of the given value.
|
|
template<typename T > |
T | NAV::math::sign (const T &x, const T &y) |
| Change the sign of x according to the value of y.
|
|
template<typename Derived > |
Eigen::Matrix< typename Derived::Scalar, 3, 3 > | NAV::math::skewSymmetricMatrix (const Eigen::MatrixBase< Derived > &a) |
| Calculates the skew symmetric matrix of the given vector. This is needed to perform the cross product with a scalar product operation.
|
|
template<typename Derived > |
Eigen::Matrix< typename Derived::Scalar, 3, 3 > | NAV::math::skewSymmetricMatrixSquared (const Eigen::MatrixBase< Derived > &a) |
| Calculates the square of a skew symmetric matrix of the given vector.
|
|
template<typename DerivedA , typename DerivedQ > |
DerivedA::Scalar | NAV::math::squaredNormVectorMatrix (const Eigen::MatrixBase< DerivedA > &a, const Eigen::MatrixBase< DerivedQ > &Q) |
| Calculates the squared norm of the vector and matrix.
|
|
double NAV::math::normalCDF |
( |
double | value | ) |
|
Calculates the cumulative distribution function (CDF) of the standard normal distribution.
\begin{equation} \label{eq:eq-normalDistCDF}
\Phi(x) = \int\displaylimits_{-\infty}^x \frac{1}{\sqrt{2\pi}} \exp{\left(-\frac{1}{2} v^2\right)} \text{d}v
\end{equation}
which can be expressed with the error function
\begin{equation} \label{eq:eq-normalDistCDF-erf}
\Phi(x) = \frac{1}{2} \left[ 1 + \text{erf}{\left(\frac{x}{\sqrt{2}}\right)} \right]
\end{equation}
Using the property
\begin{equation} \label{eq:eq-erf-minus}
\text{erf}{\left( -x \right)} = -\text{erf}{\left( x \right)}
\end{equation}
and the complementary error function
\begin{equation} \label{eq:eq-erfc}
\text{erfc}{\left( x \right)} = 1 - \text{erf}{\left( x \right)}
\end{equation}
we can simplify equation eq-normalDistCDF-erf to
\begin{equation} \label{eq:eq-normalDistCDF-erfc}
\begin{aligned}
\Phi(x) &= \frac{1}{2} \left[ 1 - \text{erf}{\left(-\frac{x}{\sqrt{2}}\right)} \right] \\
&= \frac{1}{2} \text{erfc}{\left(-\frac{x}{\sqrt{2}}\right)}
\end{aligned}
\end{equation}
- Parameters
-
value | Value to calculate the CDF for |