Go to the documentation of this file.
45 template <
class VECTORLIKE1,
class MATLIKE1,
class USERPARAM,
class VECTORLIKE2,
46 class VECTORLIKE3,
class MATLIKE2>
48 const VECTORLIKE1& x_mean,
const MATLIKE1& x_cov,
50 const VECTORLIKE1&
x,
const USERPARAM& fixed_param, VECTORLIKE3&
y),
51 const USERPARAM& fixed_param, VECTORLIKE2& y_mean, MATLIKE2& y_cov,
52 const bool* elem_do_wrap2pi =
nullptr,
const double alpha = 1e-3,
53 const double K = 0,
const double beta = 2.0)
56 const size_t Nx = x_mean.size();
57 const double lambda =
alpha *
alpha * (Nx + K) - Nx;
58 const double c = Nx + lambda;
61 const double Wi = 0.5 /
c;
62 std::vector<double> W_mean(1 + 2 * Nx, Wi), W_cov(1 + 2 * Nx, Wi);
63 W_mean[0] = lambda /
c;
64 W_cov[0] = W_mean[0] + (1 -
alpha *
alpha + beta);
68 const bool valid = x_cov.chol(L);
70 throw std::runtime_error(
71 "transform_gaussian_unscented: Singular covariance matrix in "
79 VECTORLIKE1 X = x_mean;
80 functor(X, fixed_param, Y[0]);
84 for (
size_t i = 0; i < Nx; i++)
86 L.extractRowAsCol(i, delta);
89 functor(X, fixed_param, Y[
row++]);
92 functor(X, fixed_param, Y[
row++]);
97 Y, y_cov, y_mean, &W_mean, &W_cov, elem_do_wrap2pi);
112 template <
class VECTORLIKE1,
class MATLIKE1,
class USERPARAM,
class VECTORLIKE2,
113 class VECTORLIKE3,
class MATLIKE2>
115 const VECTORLIKE1& x_mean,
const MATLIKE1& x_cov,
117 const VECTORLIKE1&
x,
const USERPARAM& fixed_param, VECTORLIKE3&
y),
118 const USERPARAM& fixed_param, VECTORLIKE2& y_mean, MATLIKE2& y_cov,
119 const size_t num_samples = 1000,
125 samples_x, num_samples, x_cov, &x_mean);
127 for (
size_t i = 0; i < num_samples; i++)
128 functor(samples_x[i], fixed_param, samples_y[i]);
132 out_samples_y->clear();
133 samples_y.swap(*out_samples_y);
148 template <
class VECTORLIKE1,
class MATLIKE1,
class USERPARAM,
class VECTORLIKE2,
149 class VECTORLIKE3,
class MATLIKE2>
151 const VECTORLIKE1& x_mean,
const MATLIKE1& x_cov,
153 const VECTORLIKE1&
x,
const USERPARAM& fixed_param, VECTORLIKE3&
y),
154 const USERPARAM& fixed_param, VECTORLIKE2& y_mean, MATLIKE2& y_cov,
155 const VECTORLIKE1& x_increments)
159 functor(x_mean, fixed_param, y_mean);
161 Eigen::Matrix<double, VECTORLIKE3::RowsAtCompileTime,
162 VECTORLIKE1::RowsAtCompileTime>
165 x_mean, std::function<
void(
166 const VECTORLIKE1&
x,
const USERPARAM& fixed_param,
167 VECTORLIKE3&
y)>(functor),
168 x_increments, fixed_param, H);
169 H.multiply_HCHt(x_cov, y_cov);
void covariancesAndMeanWeighted(const VECTOR_OF_VECTORS &elements, MATRIXLIKE &covariances, VECTORLIKE &means, const VECTORLIKE2 *weights_mean, const VECTORLIKE3 *weights_cov, const bool *elem_do_wrap2pi=nullptr)
Computes covariances and mean of any vector of containers, given optional weights for the different s...
void drawGaussianMultivariateMany(VECTOR_OF_VECTORS &ret, size_t desiredSamples, const COVMATRIX &cov, const typename VECTOR_OF_VECTORS::value_type *mean=nullptr)
Generate a given number of multidimensional random samples according to a given covariance matrix.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLclampf GLclampf GLclampf alpha
std::vector< T, mrpt::aligned_allocator_cpp11< T > > aligned_std_vector
CRandomGenerator & getRandomGenerator()
A static instance of a CRandomGenerator class, for use in single-thread applications.
GLenum GLenum GLvoid * row
void estimateJacobian(const VECTORLIKE &x, const std::function< void(const VECTORLIKE &x, const USERPARAM &y, VECTORLIKE3 &out)> &functor, const VECTORLIKE2 &increments, const USERPARAM &userParam, MATRIXLIKE &out_Jacobian)
Estimate the Jacobian of a multi-dimensional function around a point "x", using finite differences of...
void covariancesAndMean(const VECTOR_OF_VECTORS &elements, MATRIXLIKE &covariances, VECTORLIKE &means, const bool *elem_do_wrap2pi=nullptr)
Computes covariances and mean of any vector of containers.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |