Rmath version 0.4.0 has the following methods for dbeta:
julia> methods(dbeta)
# 2 methods for generic function "dbeta":
dbeta(x::Number, p1::Number, p2::Number) in Rmath at Rmath\src\Rmath.jl:192
dbeta(x::Number, p1::Number, p2::Number, give_log::Bool) in Rmath at Rmath\src\Rmath.jl:209
Which shows you that dbeta expects a scalar as its firs argument. Actually you get this hint when you run dbeta(x, 1, 25):
julia> dbeta(x, 1, 25)
ERROR: MethodError: no method matching dbeta(::Array{Float64,2}, ::Int64, ::Int64)
Closest candidates are:
dbeta(::Number, ::Number, ::Number) at \Rmath\src\Rmath.jl:192
dbeta(::Number, ::Number, ::Number, ::Bool) at v0.6\Rmath\src\Rmath.jl:209
which guides you at the proper method signatures.
So how to solve your problem - this is pretty simple. Use broadcasting with . like this:
dbeta.(x, 1, 25)
and all works as expected. In general you can expect that this pattern should be used in almost all functions in Julia, like sin or cos in base, i.e. by default they accept scalars and you should use broadcasting with . to apply them to a vector. This is explained here https://docs.julialang.org/en/latest/manual/functions/#man-vectorized-1 in the Julia manual.
xis of typeArray{Float64,2}which means it's actually a1 x 100matrix, so you needvec(x)for converting it to a vector.100x1and1x100arrays are both matrices. Never the less, no arrays or vectors are accepted as inputs here. And there doesn't exist alistdata structure. Perhaps he's thinking oftuple, which won't work either.