Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New argument transform for <...>$family$mu_fun() #337

Merged
merged 9 commits into from Jul 12, 2022

Conversation

fweber144
Copy link
Collaborator

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) in proj_linpred() only conditionally on argument transform (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 cause link(linkinv(eta)) to be different from eta).

Furthermore, some refactoring in proj_helper() and downstream functions is performed (to simplify the code, but also to improve safety).

`proj_linpred_aux()` and `proj_predict_aux()`. This will make it later easier to
apply the transformation of the predictions from the latent space (`eta`) to the
response space (`mu`) only conditionally on argument `transform` (which will
come with a slightly improved efficiency).
unnecessary back-and-forth transformations between latent space and response
space. This is also important for the binomial family where numerical
inaccuracies can cause `link(linkinv(eta))` to be different from `eta`.
@fweber144 fweber144 merged commit 5186d4f into stan-dev:master Jul 12, 2022
@fweber144 fweber144 deleted the mu_fun_transform branch July 12, 2022 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant