From 7bb69e4183dda6dff56719b0f63c168670d5cbd0 Mon Sep 17 00:00:00 2001 From: Krishna Vedala Date: Tue, 26 May 2020 01:17:12 -0400 Subject: [PATCH] added documentation equations --- .../ordinary_least_squares_regressor.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/computer_oriented_statistical_methods/ordinary_least_squares_regressor.cpp b/computer_oriented_statistical_methods/ordinary_least_squares_regressor.cpp index 41acfa10a..06bd4ea52 100644 --- a/computer_oriented_statistical_methods/ordinary_least_squares_regressor.cpp +++ b/computer_oriented_statistical_methods/ordinary_least_squares_regressor.cpp @@ -294,7 +294,8 @@ std::vector> get_transpose( } /** - * Perform Ordinary Least Squares curve fit. + * Perform Ordinary Least Squares curve fit. This operation is defined as + * \f[\beta = \left(X^TXX^T\right)Y\f] * \param X feature matrix with rows representing sample vector of features * \param Y known regression value for each sample * \returns fitted regression model polynomial coefficients @@ -322,9 +323,11 @@ std::vector fit_OLS_regressor(std::vector> const &X, /** * Given data and OLS model coeffficients, predict - * regression estimates. + * regression estimates. This operation is defined as + * \f[y_{\text{row}=i} = \sum_{j=\text{columns}}\beta_j\cdot X_{i,j}\f] + * * \param X feature matrix with rows representing sample vector of features - * \param \f$\beta\f$ fitted regression model + * \param beta fitted regression model * \return vector with regression values for each sample **/ template