Skip to contents

bam_stab_priors() sets the prior distributions of bayes_stability(): normal priors for the overall mean and the contrasts of the genotype effects, environment effects (the environmental index) and slope deviations, and scaled inverse chi-squared priors for the error variance and the deviation variances.

Usage

bam_stab_priors(
  mu_var = NULL,
  g_var = NULL,
  h_var = NULL,
  b_var = 100,
  nu = 1,
  s2 = NULL,
  nu_d = 1,
  s2_d = NULL
)

Arguments

mu_var, g_var, h_var

prior variances of the overall mean and of the contrasts of the genotype and environment effects (NULL: \(10^4\) times the variance of the response).

b_var

prior variance of the contrasts of the slope deviations \(b_i\) (default 100; the slopes are \(1 + b_i\), without unit).

nu, s2

degrees of freedom and scale of the prior of the error variance (s2 = NULL: the within-cell mean square).

nu_d, s2_d

degrees of freedom and scale of the prior of the deviation variances (s2_d = NULL: the pooled least-squares deviation variance).

Value

An object of class c("bam_stab_priors", "list").

Details

$$\mu \sim N(0, \sigma^2_\mu), \quad \mathbf{K}_G\mathbf{g} \sim N(\mathbf{0}, \sigma^2_g\mathbf{I}), \quad \mathbf{K}_E\mathbf{h} \sim N(\mathbf{0}, \sigma^2_h\mathbf{I}), \quad \mathbf{K}_G\mathbf{b} \sim N(\mathbf{0}, \sigma^2_b\mathbf{I}),$$ $$\sigma^2 \sim \mathrm{Inv}\textrm{-}\chi^2(\nu, S^2_0), \qquad \sigma^2_{d,i} \sim \mathrm{Inv}\textrm{-}\chi^2(\nu_d, S^2_d),$$ where \(\mathbf{K}_n\) are the orthonormal contrasts of matrix_k(), so that the effects and the slope deviations sum to zero. Variances left NULL are set from the data: \(10^4\) times the variance of the response for the effects, and the least-squares estimates for \(S^2_0\) and \(S^2_d\), so that the priors carry the information of \(\nu\) and \(\nu_d\) observations whatever the unit of the trait.

References

Lian, L. and de los Campos, G. (2016). FW: an R package for Finlay-Wilkinson regression that incorporates genomic/pedigree information and covariance structures between environments. G3: Genes, Genomes, Genetics, 6(3), 589–597. doi:10.1534/g3.115.026328

Author

Muhammad Yaseen (myaseen208@gmail.com)

Examples

bam_stab_priors(
    mu_var = NULL
  , g_var  = NULL
  , h_var  = NULL
  , b_var  = 100
  , nu     = 1
  , s2     = NULL
  , nu_d   = 1
  , s2_d   = NULL
  )
#> Priors of the Bayesian stability models
#>   mu       ~ N(0, 1e4 x var(y))
#>   K_G g    ~ N(0, 1e4 x var(y) I)
#>   K_E h    ~ N(0, 1e4 x var(y) I)
#>   K_G b    ~ N(0, 100 I)   (slopes 1 + b_i)
#>   sigma^2  ~ Inv-chi^2(1, within-cell mean square)
#>   sigma_d^2 ~ Inv-chi^2(1, least-squares deviation variance)