mlpack
master
|
A class that represents a univariate conditionally Gaussian distribution. More...
Public Member Functions | |
RegressionDistribution () | |
Default constructor, which creates a Gaussian with zero dimension. More... | |
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... | |
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... | |
void | Predict (const arma::mat &points, arma::vec &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 unsigned int) |
Serialize the distribution. More... | |
void | Train (const arma::mat &observations) |
Estimate the Gaussian distribution directly from the given observations. More... | |
void | Train (const arma::mat &observations, const arma::vec &weights) |
Estimate parameters using provided observation weights. More... | |
Private Attributes | |
GaussianDistribution | err |
Error distribution. More... | |
regression::LinearRegression | rf |
Regression function for representing conditional mean. 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 30 of file regression_distribution.hpp.
|
inline |
Default constructor, which creates a Gaussian with zero dimension.
Definition at line 42 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 51 of file regression_distribution.hpp.
References mlpack::regression::LinearRegression::ComputeError(), and mlpack::distribution::GaussianDistribution::Covariance().
|
inline |
Return the dimensionality.
Definition at line 123 of file regression_distribution.hpp.
References mlpack::regression::LinearRegression::Parameters().
|
inline |
Return error distribution.
Definition at line 77 of file regression_distribution.hpp.
References err.
|
inline |
Modify error distribution.
Definition at line 79 of file regression_distribution.hpp.
References err, Probability(), and Train().
|
inline |
Evaluate log probability density function of given observation.
observation | point to evaluate log probability at |
Definition at line 107 of file regression_distribution.hpp.
References Predict(), and Probability().
|
inline |
Return the parameters (the b vector).
Definition at line 120 of file regression_distribution.hpp.
References mlpack::regression::LinearRegression::Parameters().
void mlpack::distribution::RegressionDistribution::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 LogProbability().
double mlpack::distribution::RegressionDistribution::Probability | ( | const arma::vec & | observation | ) | const |
Evaluate probability density function of given observation.
observation | point to evaluate probability at |
Referenced by Err(), and LogProbability().
|
inline |
Return regression function.
Definition at line 72 of file regression_distribution.hpp.
References rf.
|
inline |
Modify regression function.
Definition at line 74 of file regression_distribution.hpp.
References rf.
|
inline |
Serialize the distribution.
Definition at line 65 of file regression_distribution.hpp.
References mlpack::data::CreateNVP().
void mlpack::distribution::RegressionDistribution::Train | ( | const arma::mat & | observations | ) |
Estimate the Gaussian distribution directly from the given observations.
observations | List of observations. |
Referenced by Err().
void mlpack::distribution::RegressionDistribution::Train | ( | const arma::mat & | observations, |
const arma::vec & | weights | ||
) |
Estimate parameters using provided observation weights.
weights | probability that given observation is from distribution |
|
private |
|
private |
Regression function for representing conditional mean.
Definition at line 34 of file regression_distribution.hpp.
Referenced by Rf().