Commit f2d160a8 authored by ale's avatar ale

bug in doc pvalue

parent 94873c2c
...@@ -1196,8 +1196,7 @@ The p-value for a given `\chi^2` is the probability of, given the data you have, ...@@ -1196,8 +1196,7 @@ The p-value for a given `\chi^2` is the probability of, given the data you have,
have the data well described by the fit function. `nmc` is the number of MC samples used to estimate the p-value integral, default is 5000. have the data well described by the fit function. `nmc` is the number of MC samples used to estimate the p-value integral, default is 5000.
By now it only works with a vector for weights (containing the diagonal of W) By now it only works with a vector for weights (containing the diagonal of W)
Example: ```@example
function fit_defs(f::Function,x,W) function fit_defs(f::Function,x,W)
chisq(p,d)=sum((d-f(x,p)).^2 .*W) chisq(p,d)=sum((d-f(x,p)).^2 .*W)
return chisq return chisq
...@@ -1213,7 +1212,7 @@ wpm[1] = [-1.0,-1.0,4-0,-1.0] ...@@ -1213,7 +1212,7 @@ wpm[1] = [-1.0,-1.0,4-0,-1.0]
Q = pvalue(chisq, chi2, value.(up), y, wpm; W = 1.0 ./ err.(y) .^ 2, nmc=10000) Q = pvalue(chisq, chi2, value.(up), y, wpm; W = 1.0 ./ err.(y) .^ 2, nmc=10000)
#Q = pvalue(chisq, chi2, value.(up), y; W = 1.0 ./ err.(y) .^ 2, nmc=10000) #Q = pvalue(chisq, chi2, value.(up), y; W = 1.0 ./ err.(y) .^ 2, nmc=10000)
#Q = pvalue(chisq, chi2, value.(up), y) #Q = pvalue(chisq, chi2, value.(up), y)
```
""" """
function pvalue(chisq::Function, function pvalue(chisq::Function,
chi2::Float64, chi2::Float64,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment