pois_smooth_split: Smooth over-dispersed Poisson sequence via splitting method

View source: R/pois_smooth_split.R

pois_smooth_splitR Documentation

Smooth over-dispersed Poisson sequence via splitting method

Description

Smooth over-dispersed Poisson sequence via splitting method

Usage

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
)

Arguments

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

Details

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(.).

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(fit$posterior$mean_smooth)
fit$sigma2
plot(fit$elbo_trace)

DongyueXie/smashrgen documentation built on Jan. 14, 2024, 5:30 a.m.