36#ifndef STK_MULTILEASTSQUARE_H
37#define STK_MULTILEASTSQUARE_H
46template<
class ArrayB,
class ArrayA>
class MultiLeastSquare;
52template<
class ArrayB_,
class ArrayA_>
79template<
class ArrayB,
class ArrayA>
99 template<
class Weights>
103template<
class ArrayB,
class ArrayA>
111 rank_ = decomp.rank();
113 if (a_.sizeRows() < b_.sizeCols())
114 { x_ = (decomp.ginv(prod) * a_.transpose()) * b_;}
116 { x_ = decomp.ginv(prod) * (a_.transpose() * b_);}
121template<
class ArrayB,
class ArrayA>
122template<
class Weights>
131 rank_ = decomp.rank();
133 if (a_.sizeRows() < b_.sizeCols())
134 { x_ = (decomp.ginv(prod) * a_.transpose()) *
weights.diagonalize() * b_;}
136 { x_ = decomp.ginv(prod) * (a_.transpose() *
weights.diagonalize() * b_);}
In this file we implement the final class CArraySquare.
In this file we define the interface class ILeastSquare.
#define STK_STATIC_ASSERT_ONE_DIMENSION_ONLY(EXPR)
In this file we define the SymEigen class (for a symmetric matrix).
TransposeOperator< Derived > const transpose() const
The class ILeastSquare is an interface class for the methods solving the least-square problem.
ArrayB b_
Array or vector of the left hand side.
Integer rank_
rank of matrix A
hidden::AlgebraTraits< MultiLeastSquare< ArrayB, ArrayA > >::ArrayB ArrayB
ArrayA a_
Array of the right hand side.
ArrayB x_
Array of the solution (a vector if b is a vector, a matrix otherwise)
hidden::AlgebraTraits< MultiLeastSquare< ArrayB, ArrayA > >::ArrayA ArrayA
virtual bool run()
run the computations.
The class MultiLeastSQquare solve the least square problem when the response b is multidimensional.
MultiLeastSquare(ArrayB const &b, ArrayA const &a, bool isBref=false, bool isAref=false)
constructor
bool runImpl()
compute the multidimensional regression
ILeastSquare< MultiLeastSquare< ArrayB, ArrayA > > Base
virtual ~MultiLeastSquare()
Destructor.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
The namespace STK is the main domain space of the Statistical ToolKit project.
traits class for the algebra methods.