View source: R/EB_poisson_mean_routines.R
pois_mean_GG | R Documentation |
Gaussian prior, Gaussian posterior in Poisson mean problem.
pois_mean_GG(
x,
s = NULL,
prior_mean = NULL,
prior_var = NULL,
optim_method = "L-BFGS-B",
maxiter = 1000,
tol = 1e-05
)
x |
data vector |
s |
scaling vector |
prior_mean |
prior mean |
prior_var |
prior variance |
optim_method |
optimization method in 'optim' function |
maxiter |
max number of iterations |
tol |
tolerance for stopping the updates |
w |
prior weights |
The problem is
x_i\sim Poisson(\exp(\mu_i)),
\mu_i\sim N(\beta,\sigma^2).
a list of
posteriorMean: |
posterior mean |
posteriorVar: |
posterior variance |
obj_value: |
objective function values |
prior_mean: |
prior mean |
prior_var: |
prior variance |
@example n=300 x = rpois(n,exp(2*sin(1:n/20))) naive=pois_mean_GG(x) prior_base= pois_mean_GG(x, prior_mean = 2*sin(1:n/20), prior_var=rep(1, length(n))) plot(prior_base$posterior$posteriorMean_latent, col="green", type="l") lines(naive$posterior$posteriorMean_latent) points(2*sin(1:n/20), pch=19)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.