Description Usage Arguments Value Examples
View source: R/convCount_loglik.R
Compute the loglikelihood of a count model using convolution
methods to compute the probabilities.
dCount_conv_loglik_bi
is for the builtin distributions.
dCount_conv_loglik_user
is for user defined survival functions.
1 2 3 4 5 6 7  dCount_conv_loglik_bi(x, distPars, dist = c("weibull", "gamma", "gengamma",
"burr"), method = c("dePril", "direct", "naive"), nsteps = 100,
time = 1, extrap = TRUE, na.rm = TRUE, weights = NULL)
dCount_conv_loglik_user(x, distPars, extrapolPars, survR, method = c("dePril",
"direct", "naive"), nsteps = 100, time = 1, extrap = TRUE,
na.rm = TRUE, weights = NULL)

x 
integer (vector), the desired count values. 
distPars 
list of the same length as x with each slot being itself a
named list containing the distribution parameters corresponding to

dist 
character name of the builtin distribution, see details. 
method 
character, convolution method to be used; choices are

nsteps 
unsiged integer number of steps used to compute the integral. 
time 
double time at wich to compute the probabilities. Set to 1 by default. 
extrap 
logical if 
na.rm 
logical, if TRUE, 
weights 
numeric, vector of weights to apply. If 
extrapolPars 
list of same length as x where each slot is a vector of
length 2 (the extrapolation values to be used) corresponding to

survR 
a user defined survival function; should have the signature

numeric, the loglikelihood of the count process
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33  x < 0:10
lambda < 2.56
distPars < list(scale = lambda, shape = 1)
distParsList < lapply(seq(along = x), function(ind) distPars)
extrapolParsList < lapply(seq(along = x), function(ind) c(2, 1))
## user pwei
pwei_user < function(tt, distP) {
alpha < exp(log(distP[["scale"]]) / distP[["shape"]])
pweibull(q = tt, scale = alpha, shape = distP[["shape"]],
lower.tail = FALSE)
}
## loglikehood allProbs Poisson
dCount_conv_loglik_bi(x, distParsList,
"weibull", "direct", nsteps = 400)
dCount_conv_loglik_user(x, distParsList, extrapolParsList,
pwei_user, "direct", nsteps = 400)
## loglikehood naive Poisson
dCount_conv_loglik_bi(x, distParsList,
"weibull", "naive", nsteps = 400)
dCount_conv_loglik_user(x, distParsList, extrapolParsList,
pwei_user, "naive", nsteps = 400)
## loglikehood dePril Poisson
dCount_conv_loglik_bi(x, distParsList,
"weibull", "dePril", nsteps = 400)
dCount_conv_loglik_user(x, distParsList, extrapolParsList,
pwei_user, "dePril", nsteps = 400)
## see dCount_conv_loglik_bi()

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.