22template<
typename Scalar,
typename StateKeyType>
35template<
typename Scalar,
typename StateKeyType,
typename MeasKeyType>
48template<
typename Scalar,
typename StateKeyType,
typename MeasKeyType>
60template<
typename Scalar,
typename StateKeyType,
typename MeasKeyType>
61KeyedLeastSquaresResult<Scalar, StateKeyType>
65 auto m =
static_cast<int>(H.
rows());
67 auto n =
static_cast<int>(H.
cols());
79 double RSS = std::pow(dz(
all).norm(), 2);
87 double sigma2 = RSS /
static_cast<double>(dof);
94 return { .solution = dx, .variance = Q };
102template<
typename Scalar,
typename StateKeyType,
typename MeasKeyType>
103KeyedLeastSquaresResult<Scalar, StateKeyType>
107 auto m =
static_cast<int>(H.
rows());
109 auto n =
static_cast<int>(H.
cols());
122 double RSS = dz(
all).transpose() * W(
all,
all) * dz(
all);
130 double sigma2 = RSS /
static_cast<double>(dof);
137 return { .solution = dx, .variance = Q };
#define LOG_DATA
All output which occurs repeatedly every time observations are received.
const std::vector< ColKeyType > & colKeys() const
Returns the col keys.
decltype(auto) cols() const
Return the cols of the underlying Eigen matrix.
decltype(auto) rows() const
Return the rows of the underlying Eigen matrix.
KeyedLeastSquaresResult< Scalar, StateKeyType > solveLinearLeastSquaresUncertainties(const KeyedMatrixX< Scalar, MeasKeyType, StateKeyType > &H, const KeyedVectorX< Scalar, MeasKeyType > &dz)
Finds the "least squares" solution for the equation .
KeyedMatrix< Scalar, RowKeyType, ColKeyType, Eigen::Dynamic, Eigen::Dynamic > KeyedMatrixX
Dynamic size KeyedMatrix.
KeyedVectorX< Scalar, StateKeyType > solveLinearLeastSquares(const KeyedMatrixX< Scalar, MeasKeyType, StateKeyType > &H, const KeyedVectorX< Scalar, MeasKeyType > &dz)
Finds the "least squares" solution for the equation .
KeyedVectorX< Scalar, StateKeyType > solveWeightedLinearLeastSquares(const KeyedMatrixX< Scalar, MeasKeyType, StateKeyType > &H, const KeyedMatrixX< Scalar, MeasKeyType, MeasKeyType > &W, const KeyedVectorX< Scalar, MeasKeyType > &dz)
Finds the "weighted least squares" solution (see LeastSquares.hpp)
KeyedLeastSquaresResult< Scalar, StateKeyType > solveWeightedLinearLeastSquaresUncertainties(const KeyedMatrixX< Scalar, MeasKeyType, StateKeyType > &H, const KeyedMatrixX< Scalar, MeasKeyType, MeasKeyType > &W, const KeyedVectorX< Scalar, MeasKeyType > &dz)
Finds the "weighted least squares" solution.
KeyedVector< Scalar, RowKeyType, Eigen::Dynamic > KeyedVectorX
Dynamic size KeyedVector.
static const internal::all_t all
Used to request all rows or columns in KeyedMatrices.
Least Squares Uncertainties return value.
KeyedMatrixX< Scalar, StateKeyType, StateKeyType > variance
Least squares variance.
KeyedVectorX< Scalar, StateKeyType > solution
Least squares solution.
Matrix which can be accessed by keys.