MixSIAR icon indicating copy to clipboard operation
MixSIAR copied to clipboard

Extracting predicted contributions of a given biotracer for a given resource

Open mishafredmeyer opened this issue 3 years ago • 1 comments

Hello,

I am trying to calculate an estimate of model fit (analogous to an R^2 value), but for each biotracer considered in the mixing model. My idea is/was to extract the predicted contribution of a given source (as described in the MixSIAR paper), and then compare that prediction with the actual values being fed into the model.

As far as I can tell, there is an aggregation procedure somewhere upstream of the MixSIAR outputs, where the individual biotracer contributions for a given resource are combined to the resource level.

Is there a way to extract the fitted proportions of a particular biomarker to the model prior to those fatty acids being aggregated to the resource composite level?

mishafredmeyer avatar Dec 22 '21 22:12 mishafredmeyer

Hi,

Sorry for the slow response... I think you would need the model predicted tracer values, and then compare these to the tracer observations. The proportions/contributions are estimated parameters, not data fed into the model.

mix.mu[iso,i] is the predicted tracer value for tracer iso, data point i. https://github.com/brianstock/MixSIAR/blob/master/R/write_JAGS_model.R#L527. So you could compare the observed tracer datapoint, X_iso[i,iso], to the predicted value, except that mix.mu is not passed to JAGS as a parameter to save, e.g. in jags.params here.

Perhaps you want posterior predictive checks?

brianstock avatar Mar 18 '22 11:03 brianstock