Repository navigation
Pin vcov()'s diagonal fallback against a zero variance (A64 follow-up) - #67
Merged
Merged
Conversation
vcov() falls back to a diagonal built from the REPORTED standard errors when no Hessian can be inverted, so A64's clamp reached it too: a negative-variance parameter arrived as 0 and contributed an exact zero variance -- the same claim of infinite precision, one level up. This is a characterization test, not a regression test, and the comment says so: vcov() itself is unchanged, and given the NA the test constructs it passes on main as well. What changed upstream is which value arrives. It is worth pinning because the fallback squares whatever it is handed, so a zero-fill or a pmax reintroduced there would restore the defect silently. Constructed rather than fitted, so it cannot depend on an optimizer landing point. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pin
vcov()'s diagonal fallback against a zero varianceA follow-up to #62, one test file and no code change.
When no Hessian can be inverted,
vcov.sfareg()falls back to a diagonal builtby squaring the reported standard errors (
R/sfareg_methods.R:209). A64'sclamp therefore reached it too: a parameter whose variance estimate came back
negative arrived here as
0and contributed an exact zero variance — the sameclaim of infinite precision, one level up. Since #62 it arrives as
NA.This is a characterization test, not a regression test, and the comment in it
says so.
vcov()itself is unchanged, so given theNAthe test constructs,it passes on
mainas well; what #62 changed is which value arrives. It isworth pinning because the fallback squares whatever it is handed, so a
zero-fill or a
pmax()reintroduced there would restore the defect silentlywith every other A64 test still green.
The object is constructed rather than fitted, so — unlike #62's end-to-end
case, which had to be gated on
skip_if_not(any(v < 0), ...)after all five CIplatforms disagreed with this Mac about whether the design reaches a negative
variance — this one cannot depend on an optimizer landing point.
test-a64-negative-variance-se.R: 19 of 19 pass against themainbuild at5163c44. NoR/file is touched.🤖 Generated with Claude Code