This is to ensure consistency across all functions that require the
likelihood function, or the log of it, and to make sure that the same
implementation of the hypergeometric function is used everywhere for building
A0
.
pnbd.generalParams(params, x, t.x, T.cal, func, hardie = TRUE)
Pareto/NBD parameters - a vector with r, alpha, s, and beta, in that order. r and alpha are unobserved parameters for the NBD transaction process. s and beta are unobserved parameters for the Pareto (exponential gamma) dropout process.
number of repeat transactions in the calibration period T.cal, or a vector of transaction frequencies.
time of most recent repeat transaction, or a vector of recencies.
length of calibration period, or a vector of calibration period lengths.
name of the function calling dc.InputCheck; either pnbd.LL
or pnbd.PAlive
.
A vector of log likelihood values if func
is pnbd.LL
,
or a vector of probabilities that a customer is still alive if func
is pnbd.PAlive
.
This function is only ever called by either pnbd.LL
or
pnbd.PAlive
so it returns directly the output that is expected
from those calling functions: either the log likelihood for a set of
customers, or the probability that a set of customers with characteristics
given by x
, t.x
and T.cal
, having estimated a set of
params
, is still alive. Either set of customers can be of size 1.