View source: R/pois_smooth_split.R
pois_smooth_split | R Documentation |
Smooth over-dispersed Poisson sequence via splitting method
pois_smooth_split(
x,
s = NULL,
m_init = "vga",
smooth_init = NULL,
ash_pm_init_for0 = TRUE,
eps_for0 = "estimate",
sigma2_init = NULL,
est_sigma2 = TRUE,
warmstart = TRUE,
maxiter = 100,
maxiter_vga = 100,
vga_tol = 1e-05,
tol = 1e-05,
filter.number = 1,
family = "DaubExPhase",
wave_trans = "dwt",
ndwt_method = "ti.thresh",
verbose = FALSE,
printevery = 10,
ebnm_params = list(mode = 0),
convergence_criteria = "objabs",
W = NULL,
make_power_of_2 = "reflect",
plot_updates = FALSE
)
x |
data vector |
m_init, sigma2_init |
initial values of latent variable and nugget effect. |
smooth_init |
init of smooth function. |
warmstart |
whether warmstart of dwt smoother |
maxiter, tol |
max iteration and tolerance for stopping it. |
wave_trans |
dwt or ndwt. If ndwt, stopping criteria cannot be 'objabs' |
ndwt_method |
if wave_trans is ndwt, either use 'smash' or 'ti.thresh'. When n is large, 'ti.thresh' is much faster. |
convergence_criteria |
'objabs' for absolute diff in ELBO, 'nugabs' for absolute diff in nugget effect |
The problem is
x_i\sim Poisson(\lambda_i,
\lambda_i = \exp(\mu_i)),
\mu_i\sim N(b_i,\sigma^2),
\b_i\sim g(.).
set.seed(12345)
n=2^9
sigma=0.5
mu=c(rep(0.3,n/4), rep(3, n/4), rep(10, n/4), rep(0.3, n/4))
x = rpois(n,exp(log(mu)+rnorm(n,sd=sigma)))
fit = pois_smooth_split(x,maxiter=30)
plot(x,col='grey80')
lines(fit$posterior$mean_smooth)
fit$sigma2
plot(fit$elbo_trace)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.