Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nignatiadis/aurora.jl
Empirical Bayes mean estimation with nonparametric errors via order statistic regression in Julia (https://arxiv.org/abs/1911.05970)
https://github.com/nignatiadis/aurora.jl
Last synced: 26 days ago
JSON representation
Empirical Bayes mean estimation with nonparametric errors via order statistic regression in Julia (https://arxiv.org/abs/1911.05970)
- Host: GitHub
- URL: https://github.com/nignatiadis/aurora.jl
- Owner: nignatiadis
- License: mit
- Created: 2021-01-30T01:08:48.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-08T02:40:37.000Z (over 3 years ago)
- Last Synced: 2024-12-10T00:10:18.288Z (27 days ago)
- Language: Julia
- Size: 93.8 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Aurora: Averages of Units by Regressing on Ordered Replicates Adaptively.
[![Build Status](https://github.com/nignatiadis/Aurora.jl/workflows/CI/badge.svg)](https://github.com/nignatiadis/Aurora.jl/actions)
[![Coverage](https://codecov.io/gh/nignatiadis/Aurora.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/nignatiadis/Aurora.jl)Julia implementation of
> Ignatiadis, N., Saha, S., Sun D. L., & Muralidharan, O. (2019). **Empirical Bayes mean estimation with nonparametric errors via order statistic regression.** [[arXiv]](https://arxiv.org/abs/1911.05970)
## Installation
The package is available on the Julia registry, and may be installed as follows:
```julia
using Pkg
Pkg.add("Aurora")
```## Example usage
Example code for Auroral (Aurora with linear regression) and AuroraKNN (Aurora with k-Nearest Neighbor regression)
```julia
julia> using Aurora
julia> using Distributions
julia> using Random
julia> Random.seed!(100)# generate true means
julia> μs = rand(DiscreteNonParametric([-1, 1, 2], [1/3,1/3,1/3]), 20_000);
# 10 noisy observations for each mean
julia> zs = sqrt(5) .* rand(Laplace(), 20_000, 10) .+ μs;
# Aurora.jl wrapper of replicates
julia> Zs = ReplicatedSample.(zs);# Fitting
julia> auroral_fit = fit(Auroral(), Zs);
julia> auroraknn_fit = fit(AuroraKNN(), Zs);# Mean squared error (against ground truth)
julia> mean(abs2, μs .- predict(auroral_fit)) # MSE of Auroral
0.4837658847631636julia> mean(abs2, μs .- predict(auroraknn_fit)) # MSE of AuroraKNN
0.41354273158179894julia> mean(abs2, μs .- mean.(Zs)) # Compare to MSE of row-wise mean
0.9779579821238457
```Plot learned coefficients of Auroral:
```julia
julia> using Plots
julia> plot(auroral_fit)
```
![Auroral coefficients](auroral_coefs.png)