model_bh_variance_intra runs Hierarchical Bayesian variance-intra model to get intra-population variance on each environment of the network. See details for more information.

model_bh_variance_intra(data, variable, nb_iterations = 1e+05,
  thin = 10, return.mu = TRUE, return.sigma = TRUE,
  return.epsilon = FALSE, return.DIC = FALSE)

Arguments

data

The data frame on which the model is run. It should come from format_data_PPBstats.data_agro

variable

The variable on which runs the model

nb_iterations

Number of iterations of the MCMC

thin

thinning interval to reduce autocorrelations between samples of the MCMC

return.mu

Return the value for each entry in each environment and each plot (mu_ijk)

return.sigma

Return the value for each intra-population variance in each environment (sigma_ij)

return.epsilon

Return the value of all residuals in each environment on each plot (epsilon_ijk)

return.DIC

Return the DIC value of the model. See details for more information.

Value

The function returns a list with

  • "data.model_bh_variance_intra": the dataframe used to run mode variance_intra

  • "MCMC": a list with the two MCMC chains (mcmc object)

  • "DIC": the DIC value of the model

Details

Model on intra-population variance estimates entry effects (mu_ijk) and within-population variance (sigma_ij) on each environment. An environment is a combinaison of a location and a year.

The variance are taken in an inverse Gamma distribution of parameters 10^-6.

More information can be found in the book : https://priviere.github.io/PPBstats_book/family-4.html#variance-intra

For DIC value, see ?dic.samples from the rjags package for more information.

See also