Skip to content
Open
Changes from 1 commit
Commits
Show all changes
208 commits
Select commit Hold shift + click to select a range
1754cbd
WIP
gragusa Jun 10, 2022
1d778a5
WIP
gragusa Jun 15, 2022
12121a3
WIP
gragusa Jun 15, 2022
4363ba4
Taking weights seriously
gragusa Jun 17, 2022
ca702dc
WIP
gragusa Jun 18, 2022
e2b2d12
Taking weights seriously
gragusa Jun 21, 2022
bc8709a
Merge branch 'master' of https://github.com/JuliaStats/GLM.jl into Ju…
gragusa Jun 21, 2022
84cd990
Add depwarn for passing wts with Vector
gragusa Jun 22, 2022
cbc329f
Cosmettic changes
gragusa Jun 22, 2022
23d67f5
WIP
gragusa Jun 23, 2022
f4d90a9
Fix loglik for weighted models
gragusa Jul 4, 2022
6b7d95c
Fix remaining issues
gragusa Jul 15, 2022
c236b82
Final commit
gragusa Jul 15, 2022
d4bd0c2
Merge branch 'master'
gragusa Jul 15, 2022
8bdfb55
Fix merge
gragusa Jul 15, 2022
3eb2ca4
Fix nulldeviance
gragusa Jul 16, 2022
63c8358
Bypass crossmodelmatrix drom StatsAPI
gragusa Jul 16, 2022
e93a919
Delete momentmatrix.jl
gragusa Jul 16, 2022
7bb0959
Delete scratch.jl
gragusa Jul 16, 2022
ded17a8
Delete settings.json
gragusa Jul 16, 2022
3346774
AbstractWeights are required to be real
gragusa Sep 5, 2022
7376e78
Update src/glmfit.jl
gragusa Sep 5, 2022
a738268
Apply suggestions from code review
gragusa Sep 5, 2022
c9459e7
Merge pull request #2 from JuliaStats/master
gragusa Sep 5, 2022
6af3ca5
Throw error if GlmResp are not AbastractWeights
gragusa Sep 5, 2022
0ded1d4
Addressing review comments
gragusa Sep 5, 2022
d923e48
Reexport aweights, pweights, fweights
gragusa Sep 5, 2022
84f27d1
Fixed remaining issues with null loglikelihood
gragusa Sep 6, 2022
8804dc1
Fix nullloglikelihood tests
gragusa Sep 6, 2022
7f3aa36
Do not dispatch on Weights but use if
gragusa Sep 6, 2022
f67a8e0
Do not dispatch on Weights use if
gragusa Sep 6, 2022
23a3e87
Fix inferred test
gragusa Sep 6, 2022
5481284
Use if instead of dispatching on Weights
gragusa Sep 6, 2022
d12222e
Add doc for weights and fix output
gragusa Sep 7, 2022
a17e812
Fix docs failures
gragusa Sep 7, 2022
58dec0c
Fix pweights stderror even for rank deficient des
gragusa Sep 7, 2022
a6f5c66
Add test for pweights stderror
gragusa Sep 7, 2022
92ddb1e
Export UnitWeights
gragusa Sep 7, 2022
0c61fff
Fix documentation
gragusa Sep 7, 2022
8b0e8e1
Mkae cooksdistance work with rank deficient design
gragusa Sep 7, 2022
f609f06
Test cooksdistance with rank deficient design
gragusa Sep 7, 2022
23f3d03
Fix CholeskyPivoted signature in docs
gragusa Sep 8, 2022
2749b84
Make nancolidx v1.0 and v1.1 friendly
gragusa Sep 8, 2022
82e472b
Fix signatures
gragusa Sep 9, 2022
2d6aaed
Correct implementation of momentmatrix
gragusa Sep 9, 2022
dbc9ae9
Test moment matrix
gragusa Sep 9, 2022
e0d9cdf
Apply suggestions from code review
gragusa Sep 23, 2022
46e8f92
Incorporate suggestions of reviewer
gragusa Sep 23, 2022
6df401b
Deals with review comments
gragusa Sep 24, 2022
ca15eb8
Small fix
gragusa Sep 24, 2022
0c18ae9
Small fix
gragusa Sep 25, 2022
54d68d1
Apply suggestions from code review
gragusa Oct 3, 2022
422a8cd
Merge branch 'master' into JuliaStats-master
gragusa Oct 3, 2022
d6d4e6b
Fix vcov dispatch for vcov
gragusa Oct 3, 2022
b457d74
Fix dispatch of _vcov
gragusa Oct 3, 2022
b087679
Revert changes
gragusa Oct 3, 2022
a44e137
Update src/glmfit.jl
gragusa Oct 3, 2022
11db2c4
Fix weighted keyword in modelmatrix
gragusa Oct 3, 2022
b649d4f
perf in nulldeviance for unweighted models
gragusa Oct 3, 2022
170148c
Merge branch 'JuliaStats-master' of github.com:gragusa/GLM.jl into Ju…
gragusa Oct 3, 2022
29c43cb
Fixed std error for probability weights
gragusa Oct 19, 2022
279e533
Getting there (& switch Analytics to Importance)
gragusa Oct 20, 2022
afb145e
.= instead of copy!
gragusa Oct 20, 2022
2cead0a
Remove comments
gragusa Oct 20, 2022
a1ec49f
up
gragusa Oct 20, 2022
97bf28d
Speedup cooksdistance
gragusa Oct 23, 2022
9ce2d89
Revert back to AnalyticWeights
gragusa Oct 24, 2022
9bddf63
Add extensive tests for AnalyticWeights
gragusa Oct 24, 2022
3fe045a
Add extensive tests for AnalyticWeights
gragusa Oct 24, 2022
852e307
Delete scratch.jl
gragusa Oct 25, 2022
d1ba3e5
Delete analytic_weights.jl
gragusa Oct 25, 2022
831f280
Follow reviewer suggestions [Batch 1]
gragusa Nov 15, 2022
b00dc16
Follow reviewer's suggestions [Batch 2]
gragusa Nov 15, 2022
0825324
probability weights vcov uses momentmatrix
gragusa Nov 15, 2022
48d15fb
Fix ProbabilityWeights vcov and tests
gragusa Nov 16, 2022
3338eab
Use leverage from StasAPI
gragusa Nov 17, 2022
c27c749
Merge branch 'master' into JuliaStats-master
gragusa Nov 17, 2022
970e26e
Rebase against master
gragusa Nov 17, 2022
8832e9d
Fix test
gragusa Nov 17, 2022
9eb2390
Merge remote-tracking branch 'origin/master' into JuliaStats-master
gragusa Dec 20, 2022
587c129
Test on 1.6
gragusa Dec 20, 2022
fa63a9a
Address reviwer comments
gragusa Dec 29, 2022
807731a
Merge branch 'master' of github.com:JuliaStats/GLM.jl into JuliaStats…
gragusa Jun 16, 2023
72996fc
Merge branch 'master' into JuliaStats-master
andreasnoack Nov 19, 2024
1ee383a
Merge remote-tracking branch 'upstream/master' into JuliaStats-master
gragusa Nov 19, 2024
ba52ce9
Merge from origin
gragusa Nov 19, 2024
5e790df
Fix broken test of dof_residual
gragusa Nov 19, 2024
50c1a96
Fix testing issues
gragusa Nov 19, 2024
c4f7959
Fix docs
gragusa Nov 19, 2024
d2b5cb0
Added tests for ftest. They throw for pweights
gragusa Nov 25, 2024
cd165d7
Make ftest throw if a model weighted by pweights is passed
gragusa Nov 25, 2024
606a419
Fix how loglikelihood throws for pweights weighted models
gragusa Nov 25, 2024
a1a1e10
Merge branch 'master' of github.com:JuliaStats/GLM.jl into JuliaStats…
gragusa Nov 25, 2024
5d948de
Remove StatsPlots dependence.
gragusa Nov 25, 2024
4fb18df
Fix weighting with :qr method.
gragusa Nov 25, 2024
56d81ae
Add filter to jldoctest string
gragusa Dec 11, 2024
a2357cf
Fix problem with docstrings
gragusa Dec 11, 2024
6068d2a
Update docs/src/index.md
gragusa Dec 12, 2024
930a8cb
Remove trailing white spaces
gragusa Dec 12, 2024
107d17d
Add mention of UnitWeights in the weights discussion
gragusa Dec 12, 2024
a003b10
Remove trailing white spaces
gragusa Dec 12, 2024
1c06c7e
Change delbeta! signature
gragusa Dec 12, 2024
b41cce7
Add tests for dropcollinear=false
gragusa Dec 12, 2024
2730277
Minor cosmethic changes
gragusa Dec 12, 2024
cdeb1a3
Add weighting information in COMMON_FIT_KWARGS_DOCS
gragusa Dec 12, 2024
95d506e
Add test for leverage
gragusa Dec 13, 2024
f124589
[wip] work on leverage
gragusa Dec 13, 2024
cbdadbc
Use inverse
gragusa Dec 13, 2024
2386ab9
Test leverage
gragusa Dec 13, 2024
36326ff
Comment cookdistance
gragusa Dec 13, 2024
f26bc0e
Committed by mistake
gragusa Dec 13, 2024
2bc2138
leverage returns a vec
gragusa Dec 13, 2024
0569600
Fix cookdistance return type
gragusa Dec 13, 2024
dd1b4a8
Update docs/src/index.md
gragusa Dec 18, 2024
1c5953d
Update docs/src/index.md
gragusa Dec 18, 2024
cd39578
Update src/glmfit.jl
gragusa Dec 18, 2024
574ec69
Update src/linpred.jl
gragusa Dec 18, 2024
60f43a8
Adress outstanding issues
gragusa Mar 31, 2025
cb7b0a0
Merge branch 'JuliaStats-master' of github.com:gragusa/GLM.jl into Ju…
gragusa Mar 31, 2025
a8a4a34
Merge branch 'master' into JuliaStats-master
gragusa Apr 11, 2025
0f27b2f
Merge recent PRs
gragusa Apr 11, 2025
9f778ff
The final frontier
gragusa Apr 12, 2025
cb0a518
Merge branch 'master' into JuliaStats-master
gragusa Apr 12, 2025
ce6d8fd
The true final frontier
gragusa Apr 12, 2025
4d33245
Dealete dead code
gragusa Apr 13, 2025
9d63624
Update test/runtests.jl
gragusa Apr 13, 2025
214ce5e
Remove alien file
gragusa Apr 13, 2025
d6a5757
Merge branch 'JuliaStats-master' of github.com:gragusa/GLM.jl into Ju…
gragusa Apr 13, 2025
59781e2
Update test/runtests.jl
gragusa Apr 14, 2025
5023d30
Update src/lm.jl
gragusa Apr 14, 2025
992dcaa
Update docs/src/examples.md
gragusa Apr 14, 2025
4948b5a
Update src/linpred.jl
gragusa Apr 14, 2025
a005614
Merge branch 'JuliaStats-master' of github.com:gragusa/GLM.jl into Ju…
gragusa Apr 14, 2025
841da03
General cleanup [ci skip]
gragusa Apr 15, 2025
1d27c53
Add tests [ci skip]
gragusa Apr 15, 2025
6c2f3e5
Fix sparse GLM
gragusa Apr 15, 2025
4e9b765
Changes to make sparse reuse code
gragusa Apr 15, 2025
89a1d7b
Add tests for sparse and other corner cases
gragusa Apr 15, 2025
e661db9
Do not access private API for weights [no ci]
gragusa Apr 15, 2025
8db3d07
Re-add description of weights
gragusa Apr 15, 2025
e06acb5
Remove leftover [no ci]
gragusa Apr 15, 2025
c2a9103
Update probability_weights.jl
gragusa Apr 15, 2025
36997f1
Delete .vscode directory [no ci]
gragusa Apr 15, 2025
c0263aa
Update glmfit.jl
gragusa Apr 15, 2025
960f2fd
Update glmfit.jl [no ci]
gragusa Apr 15, 2025
9db9bf4
Update analytic_weights.jl
gragusa Apr 15, 2025
8a1bafb
Fix test_logs of warning in the binomial case
gragusa Apr 16, 2025
b977dd1
Update src/glmfit.jl
gragusa Apr 17, 2025
3901150
FIx sparse (broken in master) and make loglikelihood error for analyt…
gragusa Apr 17, 2025
6086c74
Improve Sparse case (vcov uses the dense code). Add tests for the spa…
gragusa Apr 17, 2025
e42d452
Update src/glmtools.jl [no ci]
gragusa Apr 18, 2025
74ce605
Update ext/GLMSparseArraysExt.jl [no ci]
gragusa Apr 18, 2025
cfa10d2
Update src/glmfit.jl [no ci]
gragusa Apr 18, 2025
02383cd
Add test for Sparse LM with probability weighted
gragusa Apr 18, 2025
025d10c
Format code
gragusa Apr 18, 2025
78db11d
Merge branch 'master' into JuliaStats-master
gragusa Apr 18, 2025
b7fec95
Implement cookdistance for glm. More testing.
gragusa Apr 18, 2025
0a78140
Merge branch 'JuliaStats-master' of github.com:gragusa/GLM.jl into Ju…
gragusa Apr 18, 2025
5a2af1c
Last commit.
gragusa Apr 18, 2025
5dbd074
Update src/glmfit.jl [no ci]
gragusa Apr 18, 2025
18d653a
Update src/lm.jl [no ci]
gragusa Apr 18, 2025
0ff9ecb
Update src/lm.jl [no ci]
gragusa Apr 18, 2025
328e898
Update src/lm.jl [no ci]
gragusa Apr 18, 2025
c06a174
Update src/glmfit.jl [no ci]
gragusa Apr 18, 2025
3b07d1e
Update src/glmfit.jl [no ci]
gragusa Apr 18, 2025
6efda93
Test residuals
gragusa Apr 18, 2025
ce6d39e
Merge branch 'JuliaStats-master' of github.com:gragusa/GLM.jl into Ju…
gragusa Apr 18, 2025
92b6894
Correct how we test for wts
gragusa Apr 18, 2025
4cef4c5
Add tests. Remove RDatasets from deps.
gragusa Apr 18, 2025
88d4767
Fix negbin and add more tests
gragusa Apr 19, 2025
caa8c0f
Update src/glmfit.jl [no ci]
gragusa Apr 21, 2025
3709d5e
Update src/glmfit.jl [no ci]
gragusa Apr 21, 2025
18e8f4c
Update src/lm.jl [no ci]
gragusa Apr 23, 2025
7ef083b
Update test/analytic_weights.jl [no ci]
gragusa Apr 23, 2025
419c835
Update test/analytic_weights.jl [no ci]
gragusa Apr 23, 2025
8507db1
Update src/lm.jl [no ci]
gragusa Apr 23, 2025
c6852a9
Update src/lm.jl [no ci]
gragusa Apr 23, 2025
a88b247
Update test/probability_weights.jl [no ci]
gragusa Apr 23, 2025
6d66c88
Update src/glmfit.jl [no ci]
gragusa Apr 23, 2025
d4a9a51
Update src/linpred.jl [no ci]
gragusa Apr 23, 2025
175b130
Update src/linpred.jl [no ci]
gragusa Apr 23, 2025
740ddb7
Update src/linpred.jl [no ci]
gragusa Apr 23, 2025
8f06f2a
Update src/linpred.jl [no ci]
gragusa Apr 23, 2025
8668eb6
Update src/linpred.jl [no ci]
gragusa Apr 23, 2025
a1c1a99
Update src/linpred.jl [no ci]
gragusa Apr 23, 2025
9523ae6
Update src/linpred.jl [no ci]
gragusa Apr 23, 2025
e7fbeac
Update src/linpred.jl [no ci]
gragusa Apr 23, 2025
c36c526
Update src/linpred.jl [no ci]
gragusa Apr 23, 2025
ce233b4
Update src/linpred.jl [no ci]
gragusa Apr 23, 2025
a3ff516
Update src/lm.jl [no ci]
gragusa Apr 23, 2025
81299f1
Update src/lm.jl [no ci]
gragusa Apr 23, 2025
fa23a79
Update src/negbinfit.jl [no ci]
gragusa Apr 23, 2025
28a950c
Update src/glmfit.jl [no ci]
gragusa Apr 23, 2025
38ff9a2
Update src/glmfit.jl [no ci]
gragusa Apr 23, 2025
064ad35
Update src/glmfit.jl [no ci]
gragusa Apr 23, 2025
7635b10
Update src/glmfit.jl [no ci]
gragusa Apr 23, 2025
53c2f8c
Update src/glmfit.jl [no ci]
gragusa Apr 23, 2025
125a44f
Update src/glmfit.jl [no ci]
gragusa Apr 23, 2025
5a5ae3d
Update src/glmfit.jl [no ci]
gragusa Apr 23, 2025
b839090
Fix comment in GlmResp
gragusa Apr 23, 2025
9ecf9b5
Fix how wts are checked for empty size
gragusa Apr 23, 2025
efbcbf6
Fix formatting [noci]
gragusa Apr 29, 2025
94d1044
Remove loglil_apweights_obs for Bernoulli and Binomial
gragusa Apr 29, 2025
ef6c86b
Fix formatting
gragusa Apr 29, 2025
786dd99
Fix formatting
gragusa Apr 29, 2025
a3d68bc
Test linkinv with CauchitLink
gragusa Apr 29, 2025
aff48d6
Fix CauchitLink linkinv
gragusa Apr 29, 2025
39300ab
Update src/lm.jl [no ci]
gragusa Apr 30, 2025
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
4 changes: 2 additions & 2 deletions src/lm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@
return -n / 2 * (log(2π * deviance(r) / n) + 1)
end

function loglikelihood(r::LmResp{T,<:AnalyticWeights}) where {T}
N = length(r.y)
n = sum(log, weights(r))
return (n - N * (log(2π * deviance(r) / N) + 1)) / 2

Check warning on line 93 in src/lm.jl

View check run for this annotation

Codecov / codecov/patch

src/lm.jl#L90-L93

Added lines #L90 - L93 were not covered by tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs testing too.

end

function loglikelihood(r::LmResp{T,<:ProbabilityWeights}) where {T}
Expand Down Expand Up @@ -169,7 +169,7 @@
:fit)
fweights(wts)
else
throw(ArgumentError("`wts` should be an `AbstractVector` coercible to `AbstractWeights`"))

Check warning on line 172 in src/lm.jl

View check run for this annotation

Codecov / codecov/patch

src/lm.jl#L172

Added line #L172 was not covered by tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also worth testing.

end
end

Expand All @@ -178,12 +178,12 @@
dropcollinear::Bool=true, method::Symbol=:qr)
# For backward compatibility accept wts as AbstractArray and coerce them to FrequencyWeights
_wts = convert_weights(wts)
if !(wts isa AbstractWeights && isempty(_wts))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you revert this because it doesn't work?

if isempty(_wts)
Base.depwarn("Using `wts` of zero length for unweighted regression is deprecated in favor of " *

Check warning on line 182 in src/lm.jl

View check run for this annotation

Codecov / codecov/patch

src/lm.jl#L182

Added line #L182 was not covered by tests
"explicitly using `UnitWeights(length(y))`." *
" Proceeding by coercing `wts` to UnitWeights of size $(length(y)).",
:fit)
_wts = uweights(length(y))

Check warning on line 186 in src/lm.jl

View check run for this annotation

Codecov / codecov/patch

src/lm.jl#L186

Added line #L186 was not covered by tests
end

if method === :cholesky
Expand All @@ -202,7 +202,7 @@
contrasts::AbstractDict{Symbol}=Dict{Symbol,Any}())
f, (y, X) = modelframe(f, data, contrasts, LinearModel)
_wts = convert_weights(wts)
_wts = !(wts isa AbstractWeights) && isempty(_wts) ? uweights(length(y)) : _wts
_wts = isempty(_wts) ? uweights(length(y)) : _wts
if method === :cholesky
fit!(LinearModel(LmResp(y, _wts), cholpred(X, dropcollinear, _wts), f))
elseif method === :qr
Expand Down
Loading