Skip to content

Commit

Permalink
Merge branch 'JuliaStats:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
gragusa authored Oct 15, 2024
2 parents c3460ae + a97d7c3 commit 93f8742
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "daily"
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand All @@ -41,15 +41,15 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
file: lcov.info
# docs:
# name: Documentation
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: julia-actions/setup-julia@v1
# - uses: actions/checkout@v4
# - uses: julia-actions/setup-julia@v2
# with:
# version: '1'
# - run: |
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StatsAPI"
uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
authors = ["Milan Bouchet-Valat <[email protected]"]
version = "1.5.0"
version = "1.7.0"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
17 changes: 17 additions & 0 deletions src/StatsAPI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,21 @@ function pairwise end
# of the default definition.
function pairwise! end

"""
HypothesisTest
Abstract supertype for all statistical hypothesis tests.
Subtypes must implement [`pvalue`](@ref) at a minimum and may also
implement functions such as [`confint`](@ref), [`nobs`](@ref), and
[`dof`](@ref) as appropriate.
"""
abstract type HypothesisTest end

"""
pvalue(test)
Compute the p-value for a given significance test.
"""
function pvalue end

end # module
47 changes: 47 additions & 0 deletions src/regressionmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,50 @@ function linearpredictor end
In-place version of [`linearpredictor`](@ref), storing the result in `storage`.
"""
function linearpredictor! end

"""
vif(m::RegressionModel)
Compute the variance inflation factor (VIF).
The [VIF](https://en.wikipedia.org/wiki/Variance_inflation_factor) measures
the increase in the variance of a parameter's estimate in a model with multiple parameters relative to
the variance of a parameter's estimate in a model containing only that parameter.
See also [`gvif`](@ref).
!!! warning
This method will fail if there is (numerically) perfect multicollinearity,
i.e. rank deficiency. In that case though, the VIF
is not particularly informative anyway.
"""
function vif end
# This generic function is owned by StatsModels.jl, which is the sole provider
# of the default definition.

"""
gvif(m::RegressionModel; scale=false)
Compute the generalized variance inflation factor (GVIF).
If `scale=true`, then each GVIF is scaled by the degrees of freedom
for (number of coefficients associated with) the predictor: ``GVIF^(1 / (2*df))``.
The [GVIF](https://doi.org/10.2307/2290467)
measures the increase in the variance of a (group of) parameter's estimate in a model
with multiple parameters relative to the variance of a parameter's estimate in a
model containing only that parameter. For continuous, numerical predictors, the GVIF
is the same as the VIF, but for categorical predictors, the GVIF provides a single
number for the entire group of contrast-coded coefficients associated with a categorical
predictor.
See also [`vif`](@ref).
## References
Fox, J., & Monette, G. (1992). Generalized Collinearity Diagnostics.
Journal of the American Statistical Association, 87(417), 178. doi:10.2307/2290467
"""
function gvif end
# This generic function is owned by StatsModels.jl, which is the sole provider
# of the default definition.

0 comments on commit 93f8742

Please sign in to comment.