View source: R/EB_poisson_mean_routines.R
ebpm_normal | R Documentation |
Gaussian prior, Gaussian posterior in Poisson mean problem.
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
)
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 |
The problem is
x_i\sim Poisson(\exp(\mu_i)),
\mu_i\sim N(\beta,\sigma^2).
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 |
## Not run:
n = 1000
mu = rnorm(n)
x = rpois(n,exp(mu))
ebpm_normal(x)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.