Skip to content

Fast likelihood-based OLS calculations with the same regressor matrix.

License

Notifications You must be signed in to change notification settings

tpapp/BatchOLS.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BatchOLS

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Build Status Coverage Status codecov.io

Maximum likelihood estimation and likelihood calculations for regressions of the form

y = X⋅β + ϵ

ϵ ∼ Normal(0, v), IID

where β are the coefficients and v is the variance of the error term.

The key features are

  1. type stability, also for ForwardDiff.Dual numbers,

  2. fast calculations for regressions using the same X.

Example:

import BatchOLS # no exported symbols

N = 100
K = 3
X = randn(N, K)
rhs = BatchOLS.RHS(X)

## maximum likelihood estimation
for _ in 1:100
    y = randn(N)
    β, v = BatchOLS.ML_βv(y, rhs)
end

## loglikelihood calculation
β′ = randn(K)
y = randn(N)
ℓ = BatchOLS.loglikelihood(y, rhs, β′, 1.0)

The code is fairly trivial, I put it in a package to allow rigorous automated testing after optimizations, especially for type inference.

About

Fast likelihood-based OLS calculations with the same regressor matrix.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages