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 };
KeyedLeastSquaresResult< Scalar, StateKeyType > solveLinearLeastSquaresUncertainties(const KeyedMatrixX< Scalar, MeasKeyType, StateKeyType > &H, const KeyedVectorX< Scalar, MeasKeyType > &dz)
Finds the "least squares" solution for the equation .
Definition KeyedLeastSquares.hpp:62
KeyedVectorX< Scalar, StateKeyType > solveLinearLeastSquares(const KeyedMatrixX< Scalar, MeasKeyType, StateKeyType > &H, const KeyedVectorX< Scalar, MeasKeyType > &dz)
Finds the "least squares" solution for the equation .
Definition KeyedLeastSquares.hpp:36
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)
Definition KeyedLeastSquares.hpp:49
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.
Definition KeyedLeastSquares.hpp:104
#define LOG_DATA
All output which occurs repeatedly every time observations are received.
Definition Logger.hpp:29
const std::vector< ColKeyType > & colKeys() const
Returns the col keys.
Definition KeyedMatrix.hpp:225
decltype(auto) cols() const
Return the cols of the underlying Eigen matrix.
Definition KeyedMatrix.hpp:222
decltype(auto) rows() const
Return the rows of the underlying Eigen matrix.
Definition KeyedMatrix.hpp:77
Least Squares Uncertainties return value.
Definition KeyedLeastSquares.hpp:24
KeyedMatrixX< Scalar, StateKeyType, StateKeyType > variance
Least squares variance.
Definition KeyedLeastSquares.hpp:26
KeyedVectorX< Scalar, StateKeyType > solution
Least squares solution.
Definition KeyedLeastSquares.hpp:25
Matrix which can be accessed by keys.
KeyedMatrix< Scalar, RowKeyType, ColKeyType, Eigen::Dynamic, Eigen::Dynamic > KeyedMatrixX
Dynamic size KeyedMatrix.
Definition KeyedMatrix.hpp:2308
KeyedVector< Scalar, RowKeyType, Eigen::Dynamic > KeyedVectorX
Dynamic size KeyedVector.
Definition KeyedMatrix.hpp:2344
static const internal::all_t all
Used to request all rows or columns in KeyedMatrices.
Definition KeyedMatrix.hpp:1457