Smooth over-dispersed Poisson sequence
Usage
pois_smooth_split(
x,
s = NULL,
Eb_init = NULL,
sigma2_init = NULL,
est_sigma2 = TRUE,
maxiter = 100,
tol = 1e-05,
filter.number = 1,
family = "DaubExPhase",
verbose = FALSE,
printevery = 10,
ebnm_params = list(mode = 0),
optim_method = "L-BFGS-B",
link = c("log", "log1p")
)
Arguments
- x
data vector
- Eb_init, sigma2_init
initial values of smooth mean and nugget effect.
- maxiter, tol
max iteration and tolerance for stopping it.
Details
The problem is
$$x_i\sim Poisson(\exp(\mu_i)),$$
$$\mu_i\sim N(b_i,\sigma^2),$$
$$\b_i\sim g(.).$$
Examples
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(exp(fit$Eb))
fit$sigma2
#> [1] 0.2319115
plot(fit$obj)