pnbd.generalParams: Define general parameters

Description Usage Arguments Details Value See Also

View source: R/pnbd.R

Description

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.

Usage

1
pnbd.generalParams(params, x, t.x, T.cal, func, hardie = TRUE)

Arguments

params

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.

x

number of repeat transactions in the calibration period T.cal, or a vector of transaction frequencies.

t.x

time of most recent repeat transaction, or a vector of recencies.

T.cal

length of calibration period, or a vector of calibration period lengths.

func

name of the function calling dc.InputCheck; either pnbd.LL or pnbd.PAlive.

hardie

if TRUE, use h2f1 instead of hypergeo.

Details

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.

Value

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.

See Also

pnbd.LL

pnbd.PAlive

pnbd.DERT


BTYD documentation built on Nov. 18, 2021, 1:10 a.m.