Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fit_mle for Laplace with weights #807

Open
yakir12 opened this issue Jan 8, 2019 · 1 comment
Open

fit_mle for Laplace with weights #807

yakir12 opened this issue Jan 8, 2019 · 1 comment

Comments

@yakir12
Copy link

yakir12 commented Jan 8, 2019

In the docs it looks like fitting Laplace to a dataset with weights would work, but:

n = 100
x = rand(n)
w = rand(n)
fit_mle(Normal, x, w) # works
fit_mle(Laplace, x, w) # doesn't work

errors out with:

ERROR: suffstats is not implemented for (Laplace, Array{Float64,1}, Array{Float64,1}).                 
Stacktrace:
 [1] suffstats(::Type{Laplace}, ::Array{Float64,1}, ::Array{Float64,1}) at /home/yakir/.julia/packages/Distributions/yz3Bc/src/genericfit.jl:5
 [2] fit_mle(::Type{Laplace}, ::Array{Float64,1}, ::Array{Float64,1}) at /home/yakir/.julia/packages/Distributions/yz3Bc/src/genericfit.jl:28
 [3] top-level scope at none:0

I didn't check all the other distributions but there are probably more that don't work with weights. A quick fix might be to change the docs to "only the Normal distribution can be fitted with weights".

@matbesancon
Copy link
Member

PR welcome if this is a simple doc change :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants