New argument transform
for <...>$family$mu_fun()
#337
Merged
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.
The main purpose of this PR is to add a new argument
transform
to<refmodel_object>$family$mu_fun()
. The purpose of this (and so is done now by this PR) is to apply the transformation of the submodel's predictions from the latent space (eta
) to the response space (mu
) inproj_linpred()
only conditionally on argumenttransform
(which avoids unnecessary back-and-forth transformations between latent space and response space and therefore comes with a slightly improved computational efficiency and also with a numerical improvement for the binomial family—possibly also for the Poisson family and any other families with non-identity link functions—where numerical inaccuracies can causelink(linkinv(eta))
to be different frometa
).Furthermore, some refactoring in
proj_helper()
and downstream functions is performed (to simplify the code, but also to improve safety).