smash.poiss | R Documentation |
Main smoothing procedure for Poisson data. Takes a univariate inhomogeneous Poisson process and estimates its mean intensity.
smash.poiss(
x,
post.var = FALSE,
log = FALSE,
reflect = FALSE,
glm.approx.param = list(),
ashparam = list(),
cxx = TRUE,
lev = 0
)
x |
A vector of Poisson counts (reflection is done
automatically if length of |
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
|
ashparam |
A list of parameters to be passed to |
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. |
We assume that the data come from the model Y_t \sim
Pois(\mu_t)
for t=1,...,T
, where \mu_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 \mu_t
(and its posterior variance if desired).
smash.poiss
returns the mean estimate by default,
with the posterior variance as an additional component if
post.var
is TRUE.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.