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 GaussianDistribution & | Err () const |
Return error distribution. More... | |
GaussianDistribution & | Err () |
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::LinearRegression & | Rf () const |
Return regression function. More... | |
regression::LinearRegression & | Rf () |
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... | |
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.
|
inline |
Default constructor, which creates a Gaussian with zero dimension.
Definition at line 43 of file regression_distribution.hpp.
|
inline |
Create a Conditional Gaussian distribution with conditional mean function obtained by running RegressionFunction on predictors, responses.
predictors | Matrix of predictors (X). |
responses | Vector of responses (y). |
Definition at line 52 of file regression_distribution.hpp.
|
inline |
Create a Conditional Gaussian distribution with conditional mean function obtained by running RegressionFunction on predictors, responses.
predictors | Matrix of predictors (X). |
responses | Vector of responses (y). |
Definition at line 64 of file regression_distribution.hpp.
References LinearRegression::ComputeError(), GaussianDistribution::Covariance(), and LinearRegression::Train().
|
inline |
Return the dimensionality.
Definition at line 156 of file regression_distribution.hpp.
References LinearRegression::Parameters().
|
inline |
Return error distribution.
Definition at line 90 of file regression_distribution.hpp.
|
inline |
Modify error distribution.
Definition at line 92 of file regression_distribution.hpp.
References mlpack_deprecated, RegressionDistribution::Probability(), and RegressionDistribution::Train().
|
inline |
Evaluate log probability density function of given observation.
observation | Point to evaluate log probability at. |
Definition at line 130 of file regression_distribution.hpp.
References mlpack_deprecated, RegressionDistribution::Predict(), and RegressionDistribution::Probability().
|
inline |
Return the parameters (the b vector).
Definition at line 153 of file regression_distribution.hpp.
References LinearRegression::Parameters().
mlpack_deprecated void Predict | ( | const arma::mat & | points, |
arma::vec & | predictions | ||
) | const |
Calculate y_i for each data point in points.
points | The data points to calculate with. |
predictions | Y, will contain calculated values on completion. |
Referenced by RegressionDistribution::LogProbability().
void Predict | ( | const arma::mat & | points, |
arma::rowvec & | predictions | ||
) | const |
Calculate y_i for each data point in points.
points | The data points to calculate with. |
predictions | Y, will contain calculated values on completion. |
double Probability | ( | const arma::vec & | observation | ) | const |
Evaluate probability density function of given observation.
observation | Point to evaluate probability at. |
Referenced by RegressionDistribution::Err(), and RegressionDistribution::LogProbability().
|
inline |
Return regression function.
Definition at line 85 of file regression_distribution.hpp.
|
inline |
Modify regression function.
Definition at line 87 of file regression_distribution.hpp.
|
inline |
Serialize the distribution.
Definition at line 78 of file regression_distribution.hpp.
void Train | ( | const arma::mat & | observations | ) |
Estimate the Gaussian distribution directly from the given observations.
observations | List of observations. |
Referenced by RegressionDistribution::Err().
mlpack_deprecated void Train | ( | const arma::mat & | observations, |
const arma::vec & | weights | ||
) |
Estimate parameters using provided observation weights.
observations | List of observations. |
weights | Probability that given observation is from distribution. |
void Train | ( | const arma::mat & | observations, |
const arma::rowvec & | weights | ||
) |
Estimate parameters using provided observation weights.
observations | List of observations. |
weights | Probability that given observation is from distribution. |