ChisqTest parameter theta0 not recognized

I am trying to use the ChisqTest function to check adequation between my empirical repartition and a theoretical probability distribution. Unfortunately it seems that parameter theta0 is not recognized.

MWE:

ChisqTest([25,25,25,25],theta0=[0.25,0.25,0.25,0.25])

Output :

MethodError: no method matching ChisqTest(::Array{Int64,1}; theta0=[0.25, 0.25, 0.25, 0.25])
Closest candidates are:
  ChisqTest(::AbstractArray{T,1}) where T<:Integer at /home/vincent.leclerev/.julia/packages/HypothesisTests/5rgiE/src/power_divergence.jl:385 got unsupported keyword argument "theta0"
  ChisqTest(::AbstractArray{T,1}, !Matched::Array{U,1}) where {T<:Integer, U<:AbstractFloat} at /home/vincent.leclerev/.julia/packages/HypothesisTests/5rgiE/src/power_divergence.jl:385 got unsupported keyword argument "theta0"
  ChisqTest(::AbstractArray{T,1}, !Matched::AbstractArray{T,1}, !Matched::Tuple{UnitRange{T},UnitRange{T}}) where T<:Integer at /home/vincent.leclerev/.julia/packages/HypothesisTests/5rgiE/src/power_divergence.jl:376 got unsupported keyword argument "theta0"
2 Likes

theta0 is not a keyword in the function:

ChisqTest([25, 25, 25, 25], [0.25, 0.25, 0.25, 0.25])

works.

Note that the standard function used for calculating theta0 in the function is ones(length(x))/length(x) which would be [0.25, 0.25, 0.25, 0.25] in this case anyway, so you can do

ChisqTest([25, 25, 25, 25])

For the same result.

1 Like

Ok thanks for your answer. I think the problem was that I am misreading the doc which specify theta0=ones(ones(length(x))/length(x)) and thought it was a keyword named theta0.