Skip to content

Commit

Permalink
fix links in docs (#11)
Browse files Browse the repository at this point in the history
* fix xlinks

* add strict=true
  • Loading branch information
palday authored Aug 29, 2023
1 parent 94cea60 commit 5e27992
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ using BoxCox
makedocs(; root=joinpath(dirname(pathof(BoxCox)), "..", "docs"),
sitename="BoxCox",
doctest=true,
strict=true,
pages=["index.md", "api.md"])

deploydocs(; repo="github.com/palday/BoxCox.jl", push_preview=true, devbranch="main")
14 changes: 10 additions & 4 deletions src/BoxCox.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using StatsAPI
using StatsBase
using StatsFuns

# XXX I have no idea why this is necessary, but otherwise isdefined(BoxCox, :params) returns false
using StatsAPI: params

export BoxCoxTransformation,
Expand All @@ -36,7 +37,7 @@ abstract type PowerTransformation end
# struct BickelDoksumTransformation <: PowerTransformation end

"""
struct BoxCoxTransformation <: PowerTransformation
BoxCoxTransformation <: PowerTransformation
# Fields
Expand Down Expand Up @@ -85,7 +86,7 @@ Compare the λ parameter of `x` and `y` for approximate equality.
Other internal structures of `BoxCoxTransformation` are not compared.
"""
function Base.isapprox(x::BoxCoxTransformation, y::BoxCoxTransformation; kwargs...)
return isapprox(x.λ, y.λ; kwargs...)
return all(isapprox.(params(x), params(y); kwargs...))
end

"""
Expand All @@ -98,7 +99,7 @@ Compute the Box-Cox transformation of x for the parameter value λ.
The one argument variant curries and creates a one-argument function of `x` for the given λ.
See also [BoxCoxTransformation](@ref).
See also [`BoxCoxTransformation`](@ref).
# References
Expand All @@ -120,7 +121,7 @@ end
Apply the estimated BoxCox transformation `t` to the number `x`.
See also [`BoxCox`](@ref).
See also [`boxcox`](@ref).
"""
function (t::BoxCoxTransformation)(x::Number)
return boxcox(t.λ, x)
Expand Down Expand Up @@ -323,6 +324,11 @@ end

StatsAPI.nobs(bc::BoxCoxTransformation) = length(bc.y)

"""
StatsAPI.params(bc::BoxCoxTransformation)
Return a vector of all parameters, i.e. `[λ]`.
"""
StatsAPI.params(bc::BoxCoxTransformation) = [bc.λ]

# function _pvalue(bc::BoxCoxTransformation)
Expand Down

0 comments on commit 5e27992

Please sign in to comment.