https://github.com/tpapp/batchols.jl
Fast likelihood-based OLS calculations with the same regressor matrix.
https://github.com/tpapp/batchols.jl
Last synced: 4 months ago
JSON representation
Fast likelihood-based OLS calculations with the same regressor matrix.
- Host: GitHub
- URL: https://github.com/tpapp/batchols.jl
- Owner: tpapp
- License: other
- Created: 2017-08-23T19:23:50.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-12-20T09:13:11.000Z (over 5 years ago)
- Last Synced: 2026-01-20T20:04:08.197Z (5 months ago)
- Language: Julia
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# BatchOLS
[](http://www.repostatus.org/#wip)
[](https://travis-ci.org/tpapp/BatchOLS.jl)
[](https://coveralls.io/github/tpapp/BatchOLS.jl?branch=master)
[](http://codecov.io/github/tpapp/BatchOLS.jl?branch=master)
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:
```julia
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.