Description Usage Arguments Details Value See Also
This is to ensure consistency across all spend functions.
1 | spend.generalParams(params, func, m.x, x)
|
params |
a vector of gamma-gamma parameters: p, q, and gamma, in that order. p is the shape parameter for each transaction. The scale parameter for each transaction is distributed across customers according to a gamma distribution with parameters q (shape) and gamma (scale). |
func |
name of the function calling |
m.x |
the customer's average observed transaction value in the calibration period. May also be a vector of average observed transaction values - see details. |
x |
the number of transactions the customer made in the calibration period. May also be a vector of frequencies - see details. |
This function is only ever called by functions defined in the original BTYD
package, such as spend.LL
, spend.marginal.likelihood
or
spend.expected.value
so it returns directly the output that is expected
from those calling functions.
That depends on func
: 1. If func
is spend.marginal.likelihood
,
the marginal distribution of a customer's average transaction value (if m.x
or x has a length greater than 1, a vector of marginal likelihoods will be
returned). 2. If func
is spend.LL
, the log-likelihood of the
gamma-gamma model; if m.x or x has a length greater than 1, this is a
vector of log-likelihoods. 3. If func
is spend.expected.value
, the
expected transaction value for a customer conditional on their transaction
behavior during the calibration period. If m.x or x has a length greater
than one, then a vector of expected transaction values will be returned.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.