Do I need to define a random Sampler?

Hey all, I am getting the following error when I run my code:

ERROR: LoadError: MethodError: no method matching &(::TagState, ::UInt8)
Closest candidates are:
  &(::Any, ::Any, ::Any, ::Any...) at operators.jl:529
  &(::Missing, ::Integer) at missing.jl:157
  &(::T, ::T) where T<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8} at int.jl:293
  ...
Stacktrace:
 [1] randexp(::MersenneTwister) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Random/src/normal.jl:101
 [2] efraimidis_aexpj_wsample_norep!(::MersenneTwister, ::Array{}, ::Array{}) at /Users/chandlerkilpatrick/.julia/packages/StatsBase/DyWPR/src/sampling.jl:715
 [3] #sample!#153(::Bool, ::Bool, ::typeof(sample!), ::MersenneTwister, ::Array{{TagState},1}, ::StatsBase.ProbabilityWeights{Float64,Float64,Array{Float64,1}}, ::Array{{TagState},1}) at /Users/chandlerkilpatrick/.julia/packages/StatsBase/DyWPR/src/sampling.jl:775

Is this indicative of the fact that I need to write a custom Random sampler or is there something else going on here?

Would definitely help if you post a full MWE or at a minimum the line that errors.

1 Like

It is confidential code sadly which makes it hard to get help on this stuff. What I can say is that the error propagates from when I call: StatsBase.sample(). I will update above with a little more of the stack trace.

It is difficult to answer this from the code you posted.