Develop PR - #42
Open
OllieSClark wants to merge 38 commits into
Open
Conversation
…as such all tests fail
…fy whether qr decomp and hatvalues are needed for computation
…ersion, adjustment functions (prefix AS_), DD. Tested.
…rho used. Only tested on lizard binomial logit link with simple test trust_test still mising dispersion
…ion based as not factored in. Passing roughly 90 tests. Fully using algo 11.5
…hat is not understood but working on lizards with logit
…m objective function. Current implementation still active change comments in main iteration loop (lines 290-319) to change.
…s true so delta doesnt usually increase even when rho is large
…rds and Endometrial on all types and to significant tolerance. Passes all 4 binomials tests but hangs on bracl
…roximation that seems numerically close but takes 1208 iterations to converge on endometrial AS_mean
…is still a dominating concern with currently not good convergence times. Infrequent hatvalue computation has initially proved inefficient. Small change to helper file to includde d3mus
…and using precomputed fisher information. Matrix free operaters removed as the overhead in most cases seems larger than using the precomputed matrix but there is examples in the new solution where matrix free will be explored. New solution uses Jacobi preconditioning using the diag of the fishers info that rescales the system being solved and reduces the number of inner iterations (CG steps). Had a play around with tolerances (Adaptive, Eisenstat-Walker esque, fixed) with levels of success. Needs further testing with tests still failing on dispersion. Step halving is still not incorporated
…is very lightweight and defaults to 1 whenever not specified, essentially running the previous method. I expect this to change in the future possibly to an in solution adaptive approach (with opportunity for override). Following testing there is a definite trade off between less freq (faster runtime) implying less precise coeficients but this trade off should and will be studied further
…tem from the reduction not being equivalent in the trust region problem. The other tests need further debugging
…trisation and cleaning up small incorrect algebra in adaptive tolerance and rho calculation
…rglmFit and probably most importantly changes to test-median-binomial that ensures test passing by relaxing a tolerance and upping maxit
…ge and found new vectorised median method. Still need to fix type correct but benchmarking has taken up all of my available time
…test Trust-region converges cleanly through the ML separation case in this test and surfaces the existing boundary diagnostic instead of the generic non-convergence/score-adjustment warnings the old IWLS path hit here; same underlying condition, different message.
The CG-Steihaug trust-region solve used by the main iteration is deliberately inexact (adaptive tolerance, radius truncation), which is fine when later iterations can correct for it. type = "correction" (Cordeiro & McCullagh, 1991) is not iterative though: control$maxit is forced to 1, and the whole method is a single closed-form Fisher-scoring step away from the MLE, so any residual error from an inexact solve lands directly in the final estimate. Give this case its own branch that solves the beta step exactly via fit$inverse_info_beta, and takes the dispersion step jointly from the same (pre-beta-update) point rather than sequentially recomputing it after betas have already moved -- matching how the correction is defined analytically. Brings brglmFit's type = "correction" output back in line with enrichwith's direct bias correction to ~1e-8, fixing test-correction.R.
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.
Quasi-Fisher method with new helper for modularity