The synthetic parameter can be pre-calculated using get_posterior_FUN, or provided directly as an array with the first dimension the samples.

get_posterior_mean(X, FUN, bychunk = FALSE, mc.cores = 1, ...)

Arguments

X

either an array of posterior samples (either a parameter from Posterior, or an object generated by get_posterior_fun), or the MegaLMM_state object with re-loaded Posterior

FUN

(optional) if X is a MegaLMM_state object, the function to calculate the synthetic parameter

bychunk

(optional) if TRUE, will re-load each chunk of the Posterior separately and calculate the posterior mean of FUN separately for each chunk, and then return the overall posterior mean. This saves memory because the whole posterior does not need to be loaded into memory at once. Only necessary terms from Posterior are loaded.

Value

posterior mean matrix