loo icon indicating copy to clipboard operation
loo copied to clipboard

how to change the unit of the loo comparison?

Open aitorme opened this issue 6 years ago • 1 comments

I am running two brms models with longitudinal time data. I want to compare the models but using the loo compare function will take away individual datapoints that are not very useful because of the correlation between the other datapoints that are left in the data. Is there a way to change the unit for the loo comparison, so that instead of individual datapoints I can choose whole trials?

Thanks in advance

aitorme avatar Jun 12 '19 09:06 aitorme

Use log_lik() function to get matrix of individidual log_lik values for each posterior draw. Sum log_lik values belonging to each trial to get joint log_lik per trial for each posterior draw. Call loo with this new log_lik matrix.

avehtari avatar Jun 13 '19 13:06 avehtari