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

Add Correlation Parameter for Partially Crossed Random Effects #710

Open
mckman opened this issue Jan 11, 2023 · 2 comments
Open

Add Correlation Parameter for Partially Crossed Random Effects #710

mckman opened this issue Jan 11, 2023 · 2 comments

Comments

@mckman
Copy link

mckman commented Jan 11, 2023

Hello lme4 team,

I am using lme4 and the Julia MixedModels code to estimate non-nested partially crossed person and firm earnings models. An example formula is shown below:

earnings ~ 1 + experience + (1 | person) + (1 | firm)

Lmer and the Julia MixedModels code is extremely fast and efficient at estimating large-scale versions of the above model (see issue #702), however since the person and firm terms are entered separately, a correlation parameter is not estimated.

After looking at the "Fitting Linear Mixed-Effects Models using lme4.pdf" vignette, it seems like this addition would be possible. The structure to estimate the correlation parameter is already present, with the main modification being to the "template matrix." The single covariance parameter that is currently fixed to zero would need to be part of theta and updated during the PLS iterations.

One approach would be to use the modular functionality of lme4, but perhaps there are better solutions. Julia might be trickier, although it has a definite advantage for large-scale problems. Any help/advice you can provide is most appreciated.

Thanks,
Kevin McKinney

@bbolker
Copy link
Member

bbolker commented Apr 15, 2024

It's been a while, this fell through the cracks. I don't think this is going to be practical, but I'm curious/don't really understand what model you're trying to construct. The current model is

mu = X beta  + Z b
Z  = (Z1 | Z2)  ## column-bind Z (indicator) matrices for person and firm effects
b = c(b1, b2)   ## concatenate person and firm REs
b1 ~ sigma1^2 I(n1)  ## person REs are iid Normal with variance sigma1^2
b2 ~ sigma2^2 I(n2)  ## firm REs are iid Normal with variance sigma2^2

... where does the correlation come in?

@mckman
Copy link
Author

mckman commented Apr 16, 2024

@bbolker - Thanks for circling back!

The correlation is between b1 and b2. Imagine instead of two iid Normal distributions we used a bivariate normal with a non-zero correlation between the person and firm RE's. For example, if high b1 persons tended to work at high b2 firms.

My co-author and I spent quite a bit of time attempting to estimate this model, but unfortunately the model is not estimable. As the number of persons gets large, the correlation between b1 and b2 must go to zero to keep the VCM positive definite.

Census Working Paper (Appendix D shows the above result):
https://www2.census.gov/library/working-papers/2023/adrm/ces/CES-WP-23-43.pdf

Published Paper:
https://www.cairn.info/revue-economique-2024-1-page-55.htm?contenu=article

The correlation between b1 and b2 can and does still appear in the eBLUP's (realized person and firm RE's). Estimating the correlation using the eBLUP's is what economists call the "plug in" estimator of the correlation, but it doesn't generally perform well in short samples or when the correlation is above about 0.4. If the time series are long (i.e. 20 obs per person) and/or the correlation is relatively mild the standard RE model works well.

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

No branches or pull requests

2 participants