From c04cd557ae5d63302d2c0d3e24a5c2d980231784 Mon Sep 17 00:00:00 2001 From: CompatHelper Julia Date: Sat, 16 Sep 2023 00:26:46 +0000 Subject: [PATCH 1/5] CompatHelper: bump compat for Documenter to 1 for package docs, (keep existing compat) --- docs/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Project.toml b/docs/Project.toml index 3a52a5db..88bd3c8a 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -2,4 +2,4 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" [compat] -Documenter = "0.27" +Documenter = "0.27, 1" From 033e24465dccae9f23e2068c5509ea6e21b4263a Mon Sep 17 00:00:00 2001 From: Milan Bouchet-Valat Date: Sat, 16 Sep 2023 22:37:42 +0200 Subject: [PATCH 2/5] Fix docstrings --- docs/src/methods.md | 7 ++++++- src/anderson_darling.jl | 4 ++-- src/durbin_watson.jl | 39 ++++++++++++++++++--------------------- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/docs/src/methods.md b/docs/src/methods.md index 413a5379..6464ce2b 100644 --- a/docs/src/methods.md +++ b/docs/src/methods.md @@ -1,6 +1,6 @@ # Methods -This page documents the generic `confint` and `pvalue` methods which are supported +This page documents the generic `confint`, `pvalue` and `testname` methods which are supported by most tests. Some particular tests support additional arguments: see the documentation for the relevant methods provided in sections covering these tests. @@ -13,3 +13,8 @@ confint ```@docs pvalue ``` + +## Test name +```@docs +testname +``` diff --git a/src/anderson_darling.jl b/src/anderson_darling.jl index 807f396d..67d7b699 100644 --- a/src/anderson_darling.jl +++ b/src/anderson_darling.jl @@ -131,7 +131,7 @@ function show_params(io::IO, x::KSampleADTest, ident = "") x.nsim != 0 && println(io, ident, "number of simulations: $(x.nsim)") end -"""Monte-Carlo simulation of the p-value for AD test""" +# Monte-Carlo simulation of the p-value for AD test function pvaluesim(x::KSampleADTest) Z = sort(x.samples) Z⁺ = unique(Z) @@ -172,7 +172,7 @@ const TK = [-1.1926243990804033 -1.1743913869790086 -1.165614653421677 -1.13925 -2.569928572144317 -2.4656196647138655 -2.4014758345752387 -2.236262068336355 -2.158516518380391 -1.923673308482446 -1.7979065748604046 -1.5997846679626186 -1.4103321257056918 -1.2784135432631765 -1.1717696031635132 -0.8499132658320339 -0.5943484194811337 -0.35694312707262416 -0.1214887880639173 0.13112100670750404 0.4191870332071281 0.7814077014565005 1.3316584559236748 1.5432210796311716 1.8266084594238228 2.2920622811804403 2.856304977260614 3.0300396084181944 3.2684205939333277 3.664624203263345 4.176983049634148 4.326393560377753 4.552857168246306 4.92111391208768 5.502216961106142 5.636662090993625 5.850215772428456 6.1557325597112955 6.609738032513054; -2.972701482938346 -2.812945948534419 -2.7269368807141112 -2.505073465280368 -2.3962139122991437 -2.099707039134466 -1.9451305240930674 -1.7042574729580975 -1.4825402524085212 -1.330796855221357 -1.2110926561356254 -0.8546019664189122 -0.5788952082877374 -0.33039963362646674 -0.08728908009829067 0.16763773343275448 0.4519318546878791 0.8027235952910927 1.3216636485933564 1.5182514190293643 1.7792399561819003 2.196289357383261 2.704436161637905 2.8602211164423332 3.071314876385227 3.4161591494006935 3.856086976310044 3.999063549670627 4.180960369206441 4.484057207941962 4.871734136391144 5.018239006694096 5.187665970098557 5.479057559707716 5.841992903950639] -"""Asymptotic evaluation of the p-value for Anderson-Darling test""" +# Asymptotic evaluation of the p-value for Anderson-Darling test function pvalueasym(x::KSampleADTest) # Computational Details: # diff --git a/src/durbin_watson.jl b/src/durbin_watson.jl index 3815f6d5..1bcf23e3 100644 --- a/src/durbin_watson.jl +++ b/src/durbin_watson.jl @@ -91,27 +91,24 @@ function show_params(io::IO, x::DurbinWatsonTest, ident) println(io, ident, "DW statistic: ", x.DW) end -""" - pan_algorithm(a::AbstractArray, x::Float64, m::Int, n::Int) - -Compute exact p-values for the Durbin-Watson statistic using Pan's algorithm (Farebrother, -1980). - -`a` is the vector of non-zero Eigenvalues of ``(I-(X(X'X)^{-1}X'))A`` (see Durbin and -Watson, 1971, p. 2), `x` is the value of the Durbin-Watson statistic, `m` the number of -elements in `a`, and `n` the number of approximation terms (see Farebrother, 1980, eq. 5). - -# References - - * J. Durbin and G. S. Watson, 1971, "Testing for Serial Correlation in Least Squares - Regression: III", Biometrika, Vol. 58, No. 1, pp. 1-19, - [http://www.jstor.org/stable/2334313](http://www.jstor.org/stable/2334313). - * 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). - -""" +# pan_algorithm(a::AbstractArray, x::Float64, m::Int, n::Int) +# +# Compute exact p-values for the Durbin-Watson statistic using Pan's algorithm (Farebrother, +# 1980). +# +# `a` is the vector of non-zero Eigenvalues of ``(I-(X(X'X)^{-1}X'))A`` (see Durbin and +# Watson, 1971, p. 2), `x` is the value of the Durbin-Watson statistic, `m` the number of +# elements in `a`, and `n` the number of approximation terms (see Farebrother, 1980, eq. 5). +# +# # References +# +# * J. Durbin and G. S. Watson, 1971, "Testing for Serial Correlation in Least Squares +# Regression: III", Biometrika, Vol. 58, No. 1, pp. 1-19, +# [http://www.jstor.org/stable/2334313](http://www.jstor.org/stable/2334313). +# * 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). function pan_algorithm(a::AbstractArray, x::Float64, m::Int, n::Int) ν = findfirst(ai -> ai >= x, a) From 0410f2c4ad5cf644bdf4bff802c17f5163d9d8e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Sun, 17 Sep 2023 14:07:51 +0200 Subject: [PATCH 3/5] Update docs/Project.toml Co-authored-by: Milan Bouchet-Valat --- docs/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Project.toml b/docs/Project.toml index 88bd3c8a..1814eb33 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -2,4 +2,4 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" [compat] -Documenter = "0.27, 1" +Documenter = "1" From a6df9e3522ef0722d0ea88d4c6ab6d16ecda8a0a Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Mon, 20 May 2024 17:17:36 -0700 Subject: [PATCH 4/5] Undo conversion of docstrings to comments --- src/anderson_darling.jl | 4 ++-- src/durbin_watson.jl | 39 +++++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/anderson_darling.jl b/src/anderson_darling.jl index 67d7b699..807f396d 100644 --- a/src/anderson_darling.jl +++ b/src/anderson_darling.jl @@ -131,7 +131,7 @@ function show_params(io::IO, x::KSampleADTest, ident = "") x.nsim != 0 && println(io, ident, "number of simulations: $(x.nsim)") end -# Monte-Carlo simulation of the p-value for AD test +"""Monte-Carlo simulation of the p-value for AD test""" function pvaluesim(x::KSampleADTest) Z = sort(x.samples) Z⁺ = unique(Z) @@ -172,7 +172,7 @@ const TK = [-1.1926243990804033 -1.1743913869790086 -1.165614653421677 -1.13925 -2.569928572144317 -2.4656196647138655 -2.4014758345752387 -2.236262068336355 -2.158516518380391 -1.923673308482446 -1.7979065748604046 -1.5997846679626186 -1.4103321257056918 -1.2784135432631765 -1.1717696031635132 -0.8499132658320339 -0.5943484194811337 -0.35694312707262416 -0.1214887880639173 0.13112100670750404 0.4191870332071281 0.7814077014565005 1.3316584559236748 1.5432210796311716 1.8266084594238228 2.2920622811804403 2.856304977260614 3.0300396084181944 3.2684205939333277 3.664624203263345 4.176983049634148 4.326393560377753 4.552857168246306 4.92111391208768 5.502216961106142 5.636662090993625 5.850215772428456 6.1557325597112955 6.609738032513054; -2.972701482938346 -2.812945948534419 -2.7269368807141112 -2.505073465280368 -2.3962139122991437 -2.099707039134466 -1.9451305240930674 -1.7042574729580975 -1.4825402524085212 -1.330796855221357 -1.2110926561356254 -0.8546019664189122 -0.5788952082877374 -0.33039963362646674 -0.08728908009829067 0.16763773343275448 0.4519318546878791 0.8027235952910927 1.3216636485933564 1.5182514190293643 1.7792399561819003 2.196289357383261 2.704436161637905 2.8602211164423332 3.071314876385227 3.4161591494006935 3.856086976310044 3.999063549670627 4.180960369206441 4.484057207941962 4.871734136391144 5.018239006694096 5.187665970098557 5.479057559707716 5.841992903950639] -# Asymptotic evaluation of the p-value for Anderson-Darling test +"""Asymptotic evaluation of the p-value for Anderson-Darling test""" function pvalueasym(x::KSampleADTest) # Computational Details: # diff --git a/src/durbin_watson.jl b/src/durbin_watson.jl index 1bcf23e3..3815f6d5 100644 --- a/src/durbin_watson.jl +++ b/src/durbin_watson.jl @@ -91,24 +91,27 @@ function show_params(io::IO, x::DurbinWatsonTest, ident) println(io, ident, "DW statistic: ", x.DW) end -# pan_algorithm(a::AbstractArray, x::Float64, m::Int, n::Int) -# -# Compute exact p-values for the Durbin-Watson statistic using Pan's algorithm (Farebrother, -# 1980). -# -# `a` is the vector of non-zero Eigenvalues of ``(I-(X(X'X)^{-1}X'))A`` (see Durbin and -# Watson, 1971, p. 2), `x` is the value of the Durbin-Watson statistic, `m` the number of -# elements in `a`, and `n` the number of approximation terms (see Farebrother, 1980, eq. 5). -# -# # References -# -# * J. Durbin and G. S. Watson, 1971, "Testing for Serial Correlation in Least Squares -# Regression: III", Biometrika, Vol. 58, No. 1, pp. 1-19, -# [http://www.jstor.org/stable/2334313](http://www.jstor.org/stable/2334313). -# * 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). +""" + pan_algorithm(a::AbstractArray, x::Float64, m::Int, n::Int) + +Compute exact p-values for the Durbin-Watson statistic using Pan's algorithm (Farebrother, +1980). + +`a` is the vector of non-zero Eigenvalues of ``(I-(X(X'X)^{-1}X'))A`` (see Durbin and +Watson, 1971, p. 2), `x` is the value of the Durbin-Watson statistic, `m` the number of +elements in `a`, and `n` the number of approximation terms (see Farebrother, 1980, eq. 5). + +# References + + * J. Durbin and G. S. Watson, 1971, "Testing for Serial Correlation in Least Squares + Regression: III", Biometrika, Vol. 58, No. 1, pp. 1-19, + [http://www.jstor.org/stable/2334313](http://www.jstor.org/stable/2334313). + * 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). + +""" function pan_algorithm(a::AbstractArray, x::Float64, m::Int, n::Int) ν = findfirst(ai -> ai >= x, a) From b25907e749618de314590cfeffc0fd2fd014806b Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Mon, 20 May 2024 17:19:53 -0700 Subject: [PATCH 5/5] Use `makedocs(; ..., checkdocs=:exports)` --- docs/make.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index dd0e5cfb..f2855f46 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -10,7 +10,8 @@ makedocs( "nonparametric.md", "time_series.md", "multivariate.md", - ] + ], + checkdocs = :exports ) deploydocs(