Skip to content

Commit

Permalink
Cleanup work related to doc transition (#112)
Browse files Browse the repository at this point in the history
* Add toc to documentation

* Assorted docstring updates

* Update index.md
  • Loading branch information
BenjaminBorn authored and ararslan committed Aug 29, 2017
1 parent 6a984aa commit dfb41d4
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 22 deletions.
5 changes: 5 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# HypothesisTests package

This package implements several hypothesis tests in Julia.

```@contents
Pages = ["methods.md", "parametric.md", "nonparametric.md", "time_series.md"]
Depth = 2
```
4 changes: 2 additions & 2 deletions src/augmented_dickey_fuller.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ Critical values and asymptotic p-values are computed based on response surface r
following MacKinnon (2010) and MacKinnon (1994), respectively. These may differ slightly
from those reported in other regression packages as different algorithms might be used.
References
# References
* James G. MacKinnon, 2010, "Critical values for cointegration tests,"
QED Working Paper No. 1227, 2010, [link](http://ideas.repec.org/p/qed/wpaper/1227.html).
* James G. MacKinnon, 1994, "Approximate Asymptotic Distribution Functions for
Unit-Root and Cointegration Tests", Journal of Business & Economic Statistics,
Vol. 12, No. 2, pp. 167-176, [link](http://www.jstor.org/stable/1391481).
External links
# External links
* [Augmented Dickey-Fuller test on Wikipedia](https://en.wikipedia.org/wiki/Augmented_Dickey–Fuller_test)
"""
Expand Down
2 changes: 1 addition & 1 deletion src/binomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ probability is not equal to `p`.
Computed confidence intervals ([`confint`](@ref)) by default are Clopper-Pearson intervals.
Implements: [`pvalue`](@ref), [`confint`](@ref)
Implements: [`pvalue`](@ref), [`confint(::BinomialTest)`](@ref)
"""
BinomialTest(x::AbstractVector{Bool}, p=0.5) =
BinomialTest(sum(x), length(x), p)
Expand Down
8 changes: 4 additions & 4 deletions src/box_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ testing the residuals of an estimated model, `dof` has to be set to the number
of estimated parameters. E.g., when testing the residuals of an ARIMA(p,0,q)
model, set `dof=p+q`.
External links
# External links
* [Box-Pierce test on Wikipedia](https://en.wikipedia.org/wiki/Ljung–Box_test#Box-Pierce_test)
* [Box-Pierce test on Wikipedia](https://en.wikipedia.org/wiki/Ljung–Box_test#Box-Pierce_test)
"""
function BoxPierceTest(y::AbstractVector{T}, lag::Int, dof::Int=0) where T<:Real
if dof>=lag
Expand Down Expand Up @@ -94,9 +94,9 @@ testing the residuals of an estimated model, `dof` has to be set to the number
of estimated parameters. E.g., when testing the residuals of an ARIMA(p,0,q)
model, set `dof=p+q`.
External links
# External links
* [Ljung-Box test on Wikipedia](https://en.wikipedia.org/wiki/Ljung–Box_test)
* [Ljung-Box test on Wikipedia](https://en.wikipedia.org/wiki/Ljung–Box_test)
"""
function LjungBoxTest(y::AbstractVector{T}, lag::Int, dof::Int=0) where T<:Real
if dof>=lag
Expand Down
4 changes: 2 additions & 2 deletions src/breusch_godfrey.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ Set `start0` to specify how the starting values for the lagged residuals are han
`start0 = true` (default) sets them to zero (as in Godfrey, 1978); `start0 = false`
uses the first `lag` residuals as starting values, i.e. shortening the sample by `lag`.
External links
# External links
* [Breusch-Godfrey test on Wikipedia](https://en.wikipedia.org/wiki/Breusch–Godfrey_test)
* [Breusch-Godfrey test on Wikipedia](https://en.wikipedia.org/wiki/Breusch–Godfrey_test)
"""
function BreuschGodfreyTest(xmat::AbstractArray{T}, e::AbstractVector{T},
lag::Int, start0::Bool=true) where T<:Real
Expand Down
21 changes: 10 additions & 11 deletions src/durbin_watson.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ DW = \\frac{\\sum_{t=2}^n (e_t - e_{t-1})^2}{\\sum_{t=1}^n e_t^2}
```
where `n` is the number of observations.
By default, the choice of approach to compute p-values depends on the sample size (`p_compute=:ndep`). For small samples (n<100), Pan's algorithm (Farebrother, 1980) is
By default, the choice of approach to compute p-values depends on the sample size
(`p_compute=:ndep`). For small samples (n<100), Pan's algorithm (Farebrother, 1980) is
employed. For larger samples, a normal approximation is used (Durbin and Watson, 1950). To
always use Pan's algorithm, set `p_compute=:exact`. `p_compute=:approx` will always use the
normal approximation.
Expand All @@ -57,21 +58,19 @@ and `:right` (positive serial correlation).
# References
* J. Durbin and G. S. Watson, 1951, "Testing for Serial Correlation in Least Squares
Regression: II", Biometrika, Vol. 38, No. 1/2, pp. 159-177,
[http://www.jstor.org/stable/2332325](http://www.jstor.org/stable/2332325).
Regression: II", Biometrika, Vol. 38, No. 1/2, pp. 159-177,
[http://www.jstor.org/stable/2332325](http://www.jstor.org/stable/2332325).
* J. Durbin and G. S. Watson, 1950, "Testing for Serial Correlation in Least Squares
Regression: I", Biometrika, Vol. 37, No. 3/4, pp. 409-428,
[http://www.jstor.org/stable/2332391](http://www.jstor.org/stable/2332391).
Regression: I", Biometrika, Vol. 37, No. 3/4, pp. 409-428,
[http://www.jstor.org/stable/2332391](http://www.jstor.org/stable/2332391).
* R. W. Farebrother, 1980, "Algorithm AS 153: Pan's Procedure for the Tail Probabilities
of the Durbin-Watson Statistic", Journal of the Royal Statistical Society, Series C
(Applied Statistics), Vol. 29, No. 2, pp. 224-227,
[http://www.jstor.org/stable/2986316](http://www.jstor.org/stable/2986316).
of the Durbin-Watson Statistic", Journal of the Royal Statistical Society, Series C
(Applied Statistics), Vol. 29, No. 2, pp. 224-227,
[http://www.jstor.org/stable/2986316](http://www.jstor.org/stable/2986316).
# External links
* [Durbin-Watson test on Wikipedia:
https://en.wikipedia.org/wiki/Durbin–Watson_statistic
](https://en.wikipedia.org/wiki/Durbin–Watson_statistic)
* [Durbin-Watson test on Wikipedia](https://en.wikipedia.org/wiki/Durbin–Watson_statistic)
"""
function DurbinWatsonTest(xmat::AbstractArray{T}, e::AbstractArray{T};
p_compute::Symbol = :ndep) where T<:Real
Expand Down
2 changes: 1 addition & 1 deletion src/fisher.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The contingency table is structured as:
odds ratio rather than the sample odds ratio; it maximizes the likelihood given by
Fisher's non-central hypergeometric distribution.
Implements: [`pvalue`](@ref), [`confint`](@ref)
Implements: [`pvalue(::FisherExactTest)`](@ref), [`confint(::FisherExactTest)`](@ref)
# References
Expand Down
2 changes: 1 addition & 1 deletion src/power_divergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ real number determining the nature of the test to be performed:
Under regularity conditions, the asymptotic distributions are identical (see Drost et. al.
1989). The ``χ^2`` null approximation works best for ``λ`` near ``2/3``.
Implements: [`pvalue`](@ref), [`confint`](@ref)
Implements: [`pvalue`](@ref), [`confint(::PowerDivergenceTest)`](@ref)
# References
Expand Down

0 comments on commit dfb41d4

Please sign in to comment.