Skip to content

Empirical Bayes mean estimation with nonparametric errors via order statistic regression in Julia (https://arxiv.org/abs/1911.05970)

License

Notifications You must be signed in to change notification settings

nignatiadis/Aurora.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aurora: Averages of Units by Regressing on Ordered Replicates Adaptively.

Build Status Coverage

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]

Installation

The package is available on the Julia registry, and may be installed as follows:

using Pkg
Pkg.add("Aurora")

Example usage

Example code for Auroral (Aurora with linear regression) and AuroraKNN (Aurora with k-Nearest Neighbor regression)

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.4837658847631636

julia> mean(abs2, μs .- predict(auroraknn_fit)) # MSE of AuroraKNN
0.41354273158179894

julia> mean(abs2, μs .- mean.(Zs)) # Compare to MSE of row-wise mean
0.9779579821238457

Plot learned coefficients of Auroral:

julia> using Plots
julia> plot(auroral_fit)

Auroral coefficients

About

Empirical Bayes mean estimation with nonparametric errors via order statistic regression in Julia (https://arxiv.org/abs/1911.05970)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages