Copyright | (c) Fabricio Olivetti 2021 - 2024 |
---|---|
License | BSD3 |
Maintainer | fabricio.olivetti@gmail.com |
Stability | experimental |
Portability | ConstraintKinds |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Functions to calculate different likelihood functions, their gradient, and Hessian matrices.
Synopsis
- data Distribution
- type PVector = Array S Ix1 Double
- type SRMatrix = Array S Ix2 Double
- sse :: SRMatrix -> PVector -> Fix SRTree -> PVector -> Double
- mse :: SRMatrix -> PVector -> Fix SRTree -> PVector -> Double
- rmse :: SRMatrix -> PVector -> Fix SRTree -> PVector -> Double
- nll :: Distribution -> Maybe Double -> SRMatrix -> PVector -> Fix SRTree -> PVector -> Double
- predict :: Distribution -> Fix SRTree -> PVector -> SRMatrix -> SRVector
- gradNLL :: Distribution -> Maybe Double -> SRMatrix -> PVector -> Fix SRTree -> PVector -> (Double, SRVector)
- gradNLLNonUnique :: Distribution -> Maybe Double -> SRMatrix -> PVector -> Fix SRTree -> PVector -> (Double, SRVector)
- fisherNLL :: Distribution -> Maybe Double -> SRMatrix -> PVector -> Fix SRTree -> PVector -> SRVector
- getSErr :: Num a => Distribution -> a -> Maybe a -> a
- hessianNLL :: Distribution -> Maybe Double -> SRMatrix -> PVector -> Fix SRTree -> PVector -> SRMatrix
Documentation
data Distribution #
Supported distributions for negative log-likelihood
Instances
Bounded Distribution # | |
Defined in Algorithm.SRTree.Likelihoods | |
Enum Distribution # | |
Defined in Algorithm.SRTree.Likelihoods succ :: Distribution -> Distribution # pred :: Distribution -> Distribution # toEnum :: Int -> Distribution # fromEnum :: Distribution -> Int # enumFrom :: Distribution -> [Distribution] # enumFromThen :: Distribution -> Distribution -> [Distribution] # enumFromTo :: Distribution -> Distribution -> [Distribution] # enumFromThenTo :: Distribution -> Distribution -> Distribution -> [Distribution] # | |
Read Distribution # | |
Defined in Algorithm.SRTree.Likelihoods readsPrec :: Int -> ReadS Distribution # readList :: ReadS [Distribution] # | |
Show Distribution # | |
Defined in Algorithm.SRTree.Likelihoods showsPrec :: Int -> Distribution -> ShowS # show :: Distribution -> String # showList :: [Distribution] -> ShowS # |
type PVector = Array S Ix1 Double #
Vector of parameter values. Needs to be strict to be readily accesible.
sse :: SRMatrix -> PVector -> Fix SRTree -> PVector -> Double #
Sum-of-square errors or Sum-of-square residues
nll :: Distribution -> Maybe Double -> SRMatrix -> PVector -> Fix SRTree -> PVector -> Double #
Gaussian distribution
Negative log-likelihood
predict :: Distribution -> Fix SRTree -> PVector -> SRMatrix -> SRVector #
Prediction for different distributions
gradNLL :: Distribution -> Maybe Double -> SRMatrix -> PVector -> Fix SRTree -> PVector -> (Double, SRVector) #
Gradient of the negative log-likelihood
gradNLLNonUnique :: Distribution -> Maybe Double -> SRMatrix -> PVector -> Fix SRTree -> PVector -> (Double, SRVector) #
Gradient of the negative log-likelihood
fisherNLL :: Distribution -> Maybe Double -> SRMatrix -> PVector -> Fix SRTree -> PVector -> SRVector #
Fisher information of negative log-likelihood
getSErr :: Num a => Distribution -> a -> Maybe a -> a #
get the standard error from a Maybe Double if it is Nothing, estimate from the ssr, otherwise use the current value For distributions other than Gaussian, it defaults to a constant 1