We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
using Random, Distributions p = rand(10) p = p / sum(p) a = zeros(10) rand!(a, Multinomial(100, p))
Results in an error,
ERROR: StackOverflowError: Stacktrace: [1] rand!(rng::TaskLocalRNG, A::Vector{Float64}, X::Distributions.MultinomialSampler{Float64}) (repeats 79984 times) @ Random ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Random/src/Random.jl:268
The text was updated successfully, but these errors were encountered:
The arguments of rand! are incorrectly ordered in your example: https://juliastats.org/Distributions.jl/stable/multivariate/#Random.rand!-Tuple{AbstractRNG,%20MultivariateDistribution,%20AbstractArray}
rand!
julia> rand!(Multinomial(100, p), a) 10-element Vector{Float64}: 3.0 13.0 16.0 5.0 12.0 17.0 7.0 24.0 1.0 2.0
Sorry, something went wrong.
I missed that. Isn't this order different from the one at Base? https://docs.julialang.org/en/v1/stdlib/Random/#Random.rand!
Base
Yes: #1316
No branches or pull requests
Results in an error,
The text was updated successfully, but these errors were encountered: