est_prior: Fit the mixture inverse-gamma prior of variance

Description Usage Arguments Value

Description

Fit the mixture inverse-gamma prior of variance, given the variance estimates (sehat^2).

Usage

1
2
est_prior(sehat, df, betahat, randomstart, singlecomp, unimodal, prior, g,
  maxiter, estpriormode, priormode, completeobs)

Arguments

sehat

a p vector of observed standard errors

df

appropriate degrees of freedom for (chi-square) distribution of sehat

betahat

a p vector of estimates (optional)

randomstart

logical, indicating whether to initialize EM randomly. If FALSE, then initializes to prior mean (for EM algorithm) or prior (for VBEM)

singlecomp

logical, indicating whether to use a single inverse-gamma distribution as the prior distribution for the variances

unimodal

put unimodal constraint on the prior distribution of variances ("variance") or precisions ("precision")

prior

string, or numeric vector indicating Dirichlet prior on mixture proportions (defaults to "uniform", or 1,1...,1; also can be "nullbiased" 1,1/k-1,...,1/k-1 to put more weight on first component)

g

the prior distribution for variances (usually estimated from the data; this is used primarily in simulated data to do computations with the "true" g)

maxiter

maximum number of iterations of the EM algorithm

estpriormode

logical, indicating whether to estimate the mode of the unimodal prior

priormode

specified prior mode (only works when estpriormode=FALSE).

completeobs

a p vector of non-missing flags

Value

The fitted mixture prior (g) and convergence info


mengyin/vashr documentation built on May 22, 2019, 6:51 p.m.