addprior: Add a prior to the RLL

Description Usage Arguments Details Value

Description

Modifies the lines dataframe that is output from the findlines function to add a term corresponding to the prior for use in a Bayesian analysis.

Usage

1
addprior(lines, alpha_e = 0, beta_e = 0, alpha_s = 0, beta_s = 0)

Arguments

alpha_e

a positive numeric. The shape parameter for the IG prior on σ^2_e.

beta_e

a positive numeric. The scale parameter for the IG prior on σ^2_e.

alpha_s

a positive numeric. The shape parameter for the IG prior on σ^2_s.

beta_s

a positive numeric. The scale parameter for the IG prior on σ^2_s.

Details

Working with the posterior density of σ^2_e, σ^2_e instead of the RLL requires this incorporation of a prior distribution on those same parameters. We work here with the inverse Gamma, which is the conjugate prior,

  1. σ^2_e ~ IG(α_e, β_e)

  2. σ^2_s ~ IG(α_s, β_s)

Given a dataframe output from findlines,

Value

Returns a new lines dataframe with the constants associated with the prior term appended to the bottom.


andrewpbray/lmmoptim documentation built on May 10, 2019, 11:10 a.m.