Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix links in docs #11

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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