Skip to content

Commit

Permalink
Minor additions to the docs (#95)
Browse files Browse the repository at this point in the history
* Clarify output to confidence interval calculation
* Update docstring for `confint` (except Student)
* Update docstring (use non-deprecated function)
  • Loading branch information
hdavid16 committed Nov 5, 2023
1 parent eb406fe commit 7401c8d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ estimated bias and standard error of our statistic.
```

Furthermore, we can estimate confidence intervals (CIs) for our statistic of
interest, based on the bootstrapped samples.
interest, based on the bootstrapped samples. `confint` returns a `Tuple` of `Tuples`,
where each `Tuple` is of the form `(statistic_value, upper_confidence_bound, lower_confidence_bound)`.
A confidence interval is returned for each variable in the bootstrap model.

```julia
## calculate 95% confidence intervals
Expand Down
2 changes: 1 addition & 1 deletion src/bootsampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ nrun(bs::BootstrapSample) = nrun(sampling(bs))
Return the statistic function of a `BootstrapSample`
```julia
bs = bootstrap(randn(20), mean, BasicSampling(100))
bs = bootstrap(mean, randn(20), BasicSampling(100))
statistic(bs)
```
Expand Down
7 changes: 7 additions & 0 deletions src/confint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ StudentConfInt() = StudentConfInt(_level)

level(cim::ConfIntMethod) = cim.level

"""
confint(bs::BootstrapSample, cim::ConfIntMethod, [i::Int])
Return the confidence interval for the bootstrapped sample `bs` with the
method defined by `cim`. If `i` is specified, only the confidence interval
for the `ith` variable is returned.
"""
function confint(bs::BootstrapSample, cim::ConfIntMethod)
tuple([confint(bs, cim, i) for i in 1:nvar(bs)]...)
end
Expand Down

0 comments on commit 7401c8d

Please sign in to comment.