Skip to contents

Computes Var(rho | a, b) when alpha ~ Gamma(a, b) (shape-rate).

Usage

var_rho(a, b, M = .QUAD_NODES_DEFAULT)

Arguments

a

Numeric; shape parameter of the Gamma prior on alpha (a > 0).

b

Numeric; rate parameter of the Gamma prior on alpha (b > 0).

M

Integer; number of quadrature nodes. Default is 80.

Value

Numeric; Var(rho | a, b).

Details

Uses the law of total variance: $$Var(\rho | a, b) = E[Var(\rho | \alpha)] + Var(E[\rho | \alpha])$$

where:

  • Var(rho | alpha) = 2*alpha / ((1+alpha)^2*(2+alpha)*(3+alpha))

  • E(rho | alpha) = 1/(1+alpha)

Note: Unlike E(rho), Var(rho) != Var(w1) in general, because the conditional variances differ.

References

Lee, J. (2025). RN-06: Dual-Anchor Design II, Section 3.3.

See also

Examples

var_rho(a = 2, b = 1)
#> [1] 0.05744825