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

ERROR: Throw not defined #19

Closed
BigCrunsh opened this issue Sep 23, 2014 · 6 comments
Closed

ERROR: Throw not defined #19

BigCrunsh opened this issue Sep 23, 2014 · 6 comments

Comments

@BigCrunsh
Copy link

Hey

I was running the following code:

using Distributions
f=x->cdf(Beta(2,2),x)-0.015
fzero(f, eps())

Unfortunately, this throws a blank error message. Has somebody an idea?

Thanks, Christoph

@stevengj
Copy link
Member

I get an fzero not defined error. fzero is not a built-in function in Julia. Are you using some other package too?

@simonster
Copy link
Member

@stevengj fzero is a function in Roots, so you also need using Roots. I get:

ERROR: Throw not defined
 in SOLVE at /home/simon/.julia/Roots/src/SOLVE.jl:45
 in derivative_free at /home/simon/.julia/Roots/src/derivative_free.jl:308
 in fzero at /home/simon/.julia/Roots/src/Roots.jl:114

It looks like this line should call throw and not Throw (edit: fixed in 141e2f1). Then you get a PossibleExtremaReached error. The beta distribution only has support on [0, 1], so you probably want to call fzero(f, 0, 1).

@simonster
Copy link
Member

However, this seems like a bug:

julia> fzero(f, eps(), [0.0, 1.0])
-0.014999999999999777

@jverzani
Copy link
Member

That's definitely a bug. The extra starting point isn't even that helpful, so perhaps its best to deprecate starting points when there is a bracket specified.

julia> fzero(f,  [0.0, 1.0])
0.07248365539489167

@BigCrunsh
Copy link
Author

thx @simonster

@jverzani
Copy link
Member

Calling with a bracket and initial point should work now:

julia> fzero(f, eps(), [0.0, 1.0])
0.07248365539489167

Thanks

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

No branches or pull requests

4 participants