RegressionDistribution Class Reference

A class that represents a univariate conditionally Gaussian distribution. More...

Public Member Functions

 RegressionDistribution ()
 Default constructor, which creates a Gaussian with zero dimension. More...

 
mlpack_deprecated RegressionDistribution (const arma::mat &predictors, const arma::vec &responses)
 Create a Conditional Gaussian distribution with conditional mean function obtained by running RegressionFunction on predictors, responses. More...

 
 RegressionDistribution (const arma::mat &predictors, const arma::rowvec &responses)
 Create a Conditional Gaussian distribution with conditional mean function obtained by running RegressionFunction on predictors, responses. More...

 
size_t Dimensionality () const
 Return the dimensionality. More...

 
const GaussianDistributionErr () const
 Return error distribution. More...

 
GaussianDistributionErr ()
 Modify error distribution. More...

 
double LogProbability (const arma::vec &observation) const
 Evaluate log probability density function of given observation. More...

 
const arma::vec & Parameters () const
 Return the parameters (the b vector). More...

 
mlpack_deprecated void Predict (const arma::mat &points, arma::vec &predictions) const
 Calculate y_i for each data point in points. More...

 
void Predict (const arma::mat &points, arma::rowvec &predictions) const
 Calculate y_i for each data point in points. More...

 
double Probability (const arma::vec &observation) const
 Evaluate probability density function of given observation. More...

 
const regression::LinearRegressionRf () const
 Return regression function. More...

 
regression::LinearRegressionRf ()
 Modify regression function. More...

 
template
<
typename
Archive
>
void serialize (Archive &ar, const uint32_t)
 Serialize the distribution. More...

 
void Train (const arma::mat &observations)
 Estimate the Gaussian distribution directly from the given observations. More...

 
mlpack_deprecated void Train (const arma::mat &observations, const arma::vec &weights)
 Estimate parameters using provided observation weights. More...

 
void Train (const arma::mat &observations, const arma::rowvec &weights)
 Estimate parameters using provided observation weights. More...

 

Detailed Description

A class that represents a univariate conditionally Gaussian distribution.

Can be used as an emission distribution with the hmm class to implement HMM regression (HMMR) as described in https://www.ima.umn.edu/preprints/January1994/1195.pdf The hmm observations should have the dependent variable in the first row, with the independent variables in the other rows.

Definition at line 31 of file regression_distribution.hpp.

Constructor & Destructor Documentation

◆ RegressionDistribution() [1/3]

Default constructor, which creates a Gaussian with zero dimension.

Definition at line 43 of file regression_distribution.hpp.

◆ RegressionDistribution() [2/3]

mlpack_deprecated RegressionDistribution ( const arma::mat &  predictors,
const arma::vec &  responses 
)
inline

Create a Conditional Gaussian distribution with conditional mean function obtained by running RegressionFunction on predictors, responses.

Parameters
predictorsMatrix of predictors (X).
responsesVector of responses (y).

Definition at line 52 of file regression_distribution.hpp.

◆ RegressionDistribution() [3/3]

RegressionDistribution ( const arma::mat &  predictors,
const arma::rowvec &  responses 
)
inline

Create a Conditional Gaussian distribution with conditional mean function obtained by running RegressionFunction on predictors, responses.

Parameters
predictorsMatrix of predictors (X).
responsesVector of responses (y).

Definition at line 64 of file regression_distribution.hpp.

References LinearRegression::ComputeError(), GaussianDistribution::Covariance(), and LinearRegression::Train().

Member Function Documentation

◆ Dimensionality()

size_t Dimensionality ( ) const
inline

Return the dimensionality.

Definition at line 156 of file regression_distribution.hpp.

References LinearRegression::Parameters().

◆ Err() [1/2]

const GaussianDistribution& Err ( ) const
inline

Return error distribution.

Definition at line 90 of file regression_distribution.hpp.

◆ Err() [2/2]

GaussianDistribution& Err ( )
inline

Modify error distribution.

Definition at line 92 of file regression_distribution.hpp.

References mlpack_deprecated, RegressionDistribution::Probability(), and RegressionDistribution::Train().

◆ LogProbability()

double LogProbability ( const arma::vec &  observation) const
inline

Evaluate log probability density function of given observation.

Parameters
observationPoint to evaluate log probability at.

Definition at line 130 of file regression_distribution.hpp.

References mlpack_deprecated, RegressionDistribution::Predict(), and RegressionDistribution::Probability().

◆ Parameters()

const arma::vec& Parameters ( ) const
inline

Return the parameters (the b vector).

Definition at line 153 of file regression_distribution.hpp.

References LinearRegression::Parameters().

◆ Predict() [1/2]

mlpack_deprecated void Predict ( const arma::mat &  points,
arma::vec &  predictions 
) const

Calculate y_i for each data point in points.

Parameters
pointsThe data points to calculate with.
predictionsY, will contain calculated values on completion.

Referenced by RegressionDistribution::LogProbability().

◆ Predict() [2/2]

void Predict ( const arma::mat &  points,
arma::rowvec &  predictions 
) const

Calculate y_i for each data point in points.

Parameters
pointsThe data points to calculate with.
predictionsY, will contain calculated values on completion.

◆ Probability()

double Probability ( const arma::vec &  observation) const

Evaluate probability density function of given observation.

Parameters
observationPoint to evaluate probability at.

Referenced by RegressionDistribution::Err(), and RegressionDistribution::LogProbability().

◆ Rf() [1/2]

const regression::LinearRegression& Rf ( ) const
inline

Return regression function.

Definition at line 85 of file regression_distribution.hpp.

◆ Rf() [2/2]

Modify regression function.

Definition at line 87 of file regression_distribution.hpp.

◆ serialize()

void serialize ( Archive &  ar,
const uint32_t   
)
inline

Serialize the distribution.

Definition at line 78 of file regression_distribution.hpp.

◆ Train() [1/3]

void Train ( const arma::mat &  observations)

Estimate the Gaussian distribution directly from the given observations.

Parameters
observationsList of observations.

Referenced by RegressionDistribution::Err().

◆ Train() [2/3]

mlpack_deprecated void Train ( const arma::mat &  observations,
const arma::vec &  weights 
)

Estimate parameters using provided observation weights.

Parameters
observationsList of observations.
weightsProbability that given observation is from distribution.

◆ Train() [3/3]

void Train ( const arma::mat &  observations,
const arma::rowvec &  weights 
)

Estimate parameters using provided observation weights.

Parameters
observationsList of observations.
weightsProbability that given observation is from distribution.

The documentation for this class was generated from the following file: