A toolkit for working with phylogenetic data.
v0.24.0
slr.hpp File Reference
#include "genesis/utils/math/common.hpp"
#include <cassert>
#include <cmath>
#include <cstddef>

Go to the source code of this file.

Classes

struct  LinearFunction
 Data structer to keep the two parameters of a linear function: its slope, and its intercept. More...
 

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::utils
 

Functions

template<class ForwardIteratorA , class ForwardIteratorB >
double fraction_of_variance_unexplained (ForwardIteratorA first_x, ForwardIteratorA last_x, ForwardIteratorB first_y, ForwardIteratorB last_y, LinearFunction lin_fct)
 Calculate the fraction of unexplained variance resulting from a linear fit of the input variables. More...
 
template<class ForwardIteratorA , class ForwardIteratorB >
double mean_squared_error (ForwardIteratorA first_x, ForwardIteratorA last_x, ForwardIteratorB first_y, ForwardIteratorB last_y, LinearFunction lin_fct)
 Calculate the mean squared error obtained from a linear fit of the input variables. More...
 
template<class ForwardIteratorA , class ForwardIteratorB >
LinearFunction simple_linear_regression (ForwardIteratorA first_x, ForwardIteratorA last_x, ForwardIteratorB first_y, ForwardIteratorB last_y)
 Simple linear regression, for predicting the dependent variable y given the independent variable x, using ordinary least squares regression. More...