Please sign in to comment.
Add Bayesian linear regression and type synonyms for readability
- Loading branch information...
Showing with 34 additions and 7 deletions.
|@@ -1,12 +1,13 @@|
|-- | Basis functions of various kinds, useful for e.g. use with the LinearRegression module|
|module Algorithms.MachineLearning.BasisFunctions where|
|-- | /Unnormalized/ 1D Gaussian, suitable for use as a basis function.|
|-gaussianBasis :: Double -- ^ Mean of the Gaussian|
|- -> Double -- ^ Standard deviation of the Gaussian|
|- -> Double -- ^ Point on X axis to sample|
|+gaussianBasis :: Mean -- ^ Mean of the Gaussian|
|+ -> Variance -- ^ Variance of the Gaussian|
|+ -> Double -- ^ Point on X axis to sample|
|-gaussianBasis mean stdev x = exp (negate $ (square (x - mean)) / (2 * (square stdev)))|
|+gaussianBasis mean variance x = exp (negate $ (square (x - mean)) / (2 * variance))|