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

explore the possibility of using sandwich method to obtain the prediction sd #345

Open
clarkliming opened this issue Aug 31, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@clarkliming
Copy link
Collaborator

currently in predict of prediction sd( including variance of $\beta$ and $\theta$, excluding the $\epsilon$ we are using bootstrapping method. The efficiency is low and takes very long time.

Explore the chance that we can use sandwich method to obtain the variance

some notes:

$p = E(y_1) = X_1 \beta - \Sigma_{12} \Sigma_{22}^{-1}X_2\beta + \Sigma_{12} \Sigma_{22}^{-1}Y_2$
$var(p) = E(var(p|\theta)) + var(E(p|\theta))$

$E(p|\theta) = (X_1 - \Sigma_{12} \Sigma_{22}^{-1}X_2) \beta(\theta) + \Sigma_{12} \Sigma_{22}^{-1}Y_2$
the derivatives, $\frac{\partial{Sigma}}{\partial{\theta}}$ are already obtained in KR/Satterthewaite methods.
$\beta(\theta))$ is a non-linear function of $\theta$ but can also be approximated as linear.

$var(p|\theta) = (X_1 - \Sigma_{12} \Sigma_{22}^{-1}X_2)cov(\beta) (X_1 - \Sigma_{12} \Sigma_{22}^{-1}X_2)^T $
$E(var(p|\theta)) \sim var(p|\hat\theta)$

@danielinteractive danielinteractive added the enhancement New feature or request label Aug 31, 2023
@danielinteractive
Copy link
Collaborator

Thanks @clarkliming !
That could be nice. I guess as you write it could work for predict, but for simulate I think we can keep in any case the current bootstrap approach (also to make sure that predict results match the easier to debug but slow simulate)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants