|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_UTILS_MATH_REGRESSION_HELPER_H_
2 #define GENESIS_UTILS_MATH_REGRESSION_HELPER_H_
72 auto const ri =
static_cast<long>( rank );
74 return vi - mi + ei - ri;
89 std::vector<double>
const& y_input,
90 std::vector<double>
const& weights,
91 std::vector<size_t>
const& strata,
94 std::vector<double>& y_output
106 std::vector<double>
const& x_input,
107 std::vector<double>
const& y_input,
108 std::vector<double>
const& weights,
109 std::vector<double>& y_output
118 std::vector<double>
const& x_input,
119 std::vector<double>
const& weights = std::vector<double>{}
129 std::vector<double>
const& x_input,
130 std::vector<double>
const& y_input,
131 std::vector<double>
const& weights = std::vector<double>{}
140 std::vector<double>
const& x_input,
141 std::vector<double>
const& weights = std::vector<double>{}
147 #endif // include guard
double weighted_inner_product(std::vector< double > const &x_input, std::vector< double > const &y_input, std::vector< double > const &weights)
(Weighted) inner product of two vectors.
GlmFreedom weighted_mean_centering(std::vector< double > const &y_input, std::vector< double > const &weights, std::vector< size_t > const &strata, bool with_intercept, bool centering, std::vector< double > &y_output)
(Weighted) mean and centering.
double weighted_residuals(std::vector< double > const &x_input, std::vector< double > const &y_input, std::vector< double > const &weights, std::vector< double > &y_output)
Calculate the residuals from (weighted) regression through the origin.
Internal helper structure for GLMs to calcualte the residual degrees of freedom.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
size_t valid_entries
Number of valid priors (Nu).
size_t max_stratum
Maximum stratum found (S).
long degrees_of_freedom(size_t rank) const
Calculate the degrees of freedom (dfr).
double weighted_sum_of_squares(std::vector< double > const &x_input, std::vector< double > const &weights)
(Weighted) sum of squares.
size_t empty_strata
Number of empty strata.
double weighted_sum(std::vector< double > const &x_input, std::vector< double > const &weights)
(Weighted) sum of a vector of values.