Currently all predictions from survextrap models are conditional on specific covariate values, as supplied in newdata. That is, a prediction $g(\theta,X)$ is done for fixed $X$.
It would be good to have an option to instead return outputs that are standardised over some or all covariates $X$. Specifically the integral of $g(\theta,X)$ with respect to a distribution of $X$ supplied by the user. This would generally be the empirical distribution of the covariate in the data used to fit the model.
Integrating over the empirical distribution of $X$, as well as over the posterior of $\theta$, may be computationally intensive. Particularly if any of the covariates are continuous, hence taking distinct values at each data point. So any suggestions are welcome for how to do this efficiently. I'm wondering if this computational problem has been investigated before, e.g. in causal inference contexts?
Currently all predictions from
survextrap
models are conditional on specific covariate values, as supplied innewdata
. That is, a prediction $g(\theta,X)$ is done for fixed $X$.It would be good to have an option to instead return outputs that are standardised over some or all covariates $X$. Specifically the integral of $g(\theta,X)$ with respect to a distribution of $X$ supplied by the user. This would generally be the empirical distribution of the covariate in the data used to fit the model.
Integrating over the empirical distribution of $X$, as well as over the posterior of $\theta$, may be computationally intensive. Particularly if any of the covariates are continuous, hence taking distinct values at each data point. So any suggestions are welcome for how to do this efficiently. I'm wondering if this computational problem has been investigated before, e.g. in causal inference contexts?