Open michaellindon opened 8 years ago
Did you import _rand!
?
What Andreas said.
Also, what's the output of lassofc <: Sampleable
? Using the current API, rand
is only defined for sampleable distributions. If you need to be able to sample from your distribution, I think you'll have to declare the type as type lassofc <: Sampleable{Univariate}
(or Multivariate
or whatever, also immutable
rather than type
as appropriate). Could be wrong on that though.
I tried
julia> import Base._rand!
WARNING: could not import Base._rand! into Main
and lassofc appears to be a subtype of Sampleable
julia> lassofc <: Sampleable
true
You'd have to import Distributions._rand!
I am following the docs to implement a multivariate distribution, however, once defining _rand! I assumed rand would also work, but this turns out not to be the case:
According to the error message
_rand!
has no method matching _rand!(::lassofc, ::Array{Float64,1}), but then why does my first line work perfectly? Im confused.