rBatt / trawl

Analysis of scientific trawl surveys of bottom-dwelling marine organisms
1 stars 0 forks source link

Careful: Order of operations, logit/ plogis, and psi/ p #90

Closed rBatt closed 9 years ago

rBatt commented 9 years ago

Need to be careful about transforming (draws from the) posteriors of JAGS models when they are represented as measures of central tendency: e.g., if something was lognormal, the distribution is parameterized as mean(log(x)), NOT as log(mean(x)). When using a measure of central tendency to condense the posterior output of the models, we are effectively doing the mean(x). Thus, it is incorrect to apply such transforms on the mean of the posterior and then compare to "true" values that have been correctly parameterized.

For an example of the effect:


vals <- replicate(1E2,{
                vals <- rnorm(1E3, sd=2);
                c("mean.first"=plogis(mean(vals)), "mean.second"=mean(plogis(vals)))
            })
            plot(t(vals)); abline(a=0, b=1)

issue90

All that being said, using the median as the measure of central tendency should help to greatly reduce this problem, because these transformations do not affect the rank/ order of the values (so nonparametric summary statistics should be more robust).