smash.poiss: Estimate the underlying intensity for Poisson counts.

Description Usage Arguments Details Value Examples

Description

Main smoothing procedure for Poisson data. Takes a univariate inhomogeneous Poisson process and estimates its mean intensity.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
smash.poiss(
  x,
  post.var = FALSE,
  log = FALSE,
  reflect = FALSE,
  glm.approx.param = list(),
  ashparam = list(),
  cxx = TRUE,
  lev = 0
)

Arguments

x

A vector of Poisson counts (reflection is done automatically if length of x is not a power of 2).

post.var

Boolean, indicates if the posterior variance should be returned.

log

bool, determines if smoothed signal is returned on log scale or not

reflect

A logical indicating if the signals should be reflected.

glm.approx.param

A list of parameters to be passed to glm.approx; default values are set by function setGlmApproxParam.

ashparam

A list of parameters to be passed to ash; default values are set by function setAshParam.poiss.

cxx

bool, indicates if C++ code should be used to create TI tables.

lev

integer from 0 to J-1, indicating primary level of resolution. Should NOT be used (ie shrinkage is performed at all resolutions) unless there is good reason to do so.

Details

We assume that the data come from the model Y_t \sim Pois(μ_t) for t=1,...,T, where μ_t is the underlying intensity, assumed to be spatially structured (or treated as points sampled from a smooth continous function). The Y_t are assumed to be independent. Smash provides estimates of μ_t (and its posterior variance if desired).

Value

smash.poiss returns the mean estimate by default, with the posterior variance as an additional component if post.var is TRUE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
n=2^10
t=1:n/n
spike.f = function(x) (0.75*exp(-500*(x-0.23)^2) +
  1.5*exp(-2000*(x-0.33)^2) + 3*exp(-8000*(x-0.47)^2) +
  2.25*exp(-16000*(x-0.69)^2)+0.5*exp(-32000*(x-0.83)^2))
mu.s=spike.f(t)
mu.t=0.01+mu.s
X.s=rpois(n,mu.t)
mu.est=smash.poiss(X.s)
plot(mu.t,type='l')
lines(mu.est,col=2)

zrxing/smash documentation built on June 9, 2021, 11:09 a.m.