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

mu_PARAMETER estimates median, not mean #117

Closed
maxmantei opened this issue Apr 17, 2020 · 2 comments
Closed

mu_PARAMETER estimates median, not mean #117

maxmantei opened this issue Apr 17, 2020 · 2 comments
Assignees

Comments

@maxmantei
Copy link

Hi!

This came up in a discussion on the Stan discourse page, so I just wanted to give a heads up.

In your getting started guide you state that

Note that hyper (group) mean parameters are indicated by mu_PARAMETER (e.g., mu_xi, mu_ep, mu_rho).

and in the models you compute those as mu_PARAMETER = Phi_approx(mu_pr[PARAMETER_INDEX]) * scaling; in the generated quantities block. However, this will give you an estimate of the posterior median of the group parameter, not the posterior mean.

If Y = f(X) and f is non-linear, then E[Y] =/= f(E[X]), as E[f(X)] =/= f(E[X]) per Jensen's inequality.

If the underlying distribution (for X) is symmetric, mu_PARAMETER (i.e. f(E[X])) will the parameter for the posterior median of the group distribution.

Cheers!

@Nathaniel-Haines
Copy link
Member

Hi @maxmantei, thanks for the info! Can you link to the discourse discussion?

I guess I'm just wondering if this applies in our case. We are estimating the parameters using this scaling in the transformed parameters block, and then mirroring this in the generated quantities block. So, my understanding is that the expectation used in the likelihood is the same as in the generated quantities (i.e. we are not just transforming the parameter after fitting the model).

Anyway, happy to look into this if it's indeed a problem!

@Nathaniel-Haines
Copy link
Member

Marked as duplicate of #156, with solution linked in the newer issue 🤓

@Nathaniel-Haines Nathaniel-Haines closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants