# ChisqTest parameter theta0 not recognized

**URL:** <https://discourse.julialang.org/t/chisqtest-parameter-theta0-not-recognized/40348>\
**Category:** Statistics\
**Tags:** hypothesis-tests\
**Created:** [May 28, 2020, 3:59pm UTC](https://discourse.julialang.org/t/chisqtest-parameter-theta0-not-recognized/40348 "2020-05-28T15:59:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![leclere](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leclere/32/3644_2.png) [@leclere](https://discourse.julialang.org/u/leclere)\
**Post date:** [May 28, 2020, 3:59pm UTC](https://discourse.julialang.org/t/chisqtest-parameter-theta0-not-recognized/40348/1 "2020-05-28T15:59:51Z")

</div>

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:

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

```

Output :

```julia
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"

```

---

<div class="post-metadata">

**Author:** ![junder873](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@junder873](https://discourse.julialang.org/u/junder873)\
**Post date:** [May 29, 2020, 12:54am UTC](https://discourse.julialang.org/t/chisqtest-parameter-theta0-not-recognized/40348/2 "2020-05-29T00:54:44Z")

</div>

`theta0` is not a keyword in the function:

```julia
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

```julia
ChisqTest([25, 25, 25, 25])

```

For the same result.

---

<div class="post-metadata">

**Author:** ![leclere](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leclere/32/3644_2.png) [@leclere](https://discourse.julialang.org/u/leclere)\
**Post date:** [May 29, 2020, 9:47am UTC](https://discourse.julialang.org/t/chisqtest-parameter-theta0-not-recognized/40348/3 "2020-05-29T09:47:42Z")

</div>

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.
