ebpm_normal: Solve Gaussian approximation to Poisson mean problem

View source: R/EB_poisson_mean_routines.R

ebpm_normalR Documentation

Solve Gaussian approximation to Poisson mean problem

Description

Gaussian prior, Gaussian posterior in Poisson mean problem.

Usage

ebpm_normal(
  x,
  s = NULL,
  g_init = NULL,
  fix_g = FALSE,
  q_init = NULL,
  maxiter = 20,
  tol = 1e-05,
  vga_tol = 1e-05,
  conv_type = "sigma2abs",
  return_sigma2_trace = FALSE
)

Arguments

x

data vector

s

scaling vector

g_init

a list of mean, and var. Can be NULL for both parameters.

fix_g

Whether fix g at g_init. If only fix either mean, or var, fix_g can be a length 2 boolean vector.

q_init

a list of init value of m_init(posterior mean) and v_init(posterior var).

maxiter

max number of iterations

tol

tolerance for stopping the updates

conv_type

convergence criteria, default to be elbo

return_sigma2_trace

whether return the trace of sigma2 estiamtes

Details

The problem is

x_i\sim Poisson(\exp(\mu_i)),

\mu_i\sim N(\beta,\sigma^2).

Value

a list of

posterior:

mean_log/var_log is the posterior mean/var of mu, mean is the posterior of exp(mu)

fitted_g:

estimated prior

obj_value:

objective function values

Examples

## Not run: 
n = 1000
mu = rnorm(n)
x = rpois(n,exp(mu))
ebpm_normal(x)

## End(Not run)

stephenslab/susiF.alpha documentation built on June 11, 2025, 1:09 p.m.