435 Dynamic Models for Time Series of Counts with a Marketing Application
an equal number of static coefcients for exogenous predictors corresponding to the main
effects portion of the multivariate Poisson specication.
Let p
d
=
j
q
=1
a
j
and p
s
=
j
q
=1
b
j
.Let β
i,t
be a p
d
-dimensional vector constructed by
stacking the a
j
coefcients δ
j,i,t
for j = 1, ..., q. The structural equation relates the location-
time-varying parameter β
i,t
to an aggregate (pooled) state parameter γ
t
β
i,t
= γ
t
+ A
i,t
1
+ Z
i
2
+ v
i,t
, (20.11)
where the errors v
i,t
are assumed to be i.i.d. N
p
d
(0, V
i
),and A
i,t
, Z
i
,
1
,and
2
were dened
below (20.3). The state (or system) equation of the HMDM is
γ
t
= Gγ
t1
+ w
t
, (20.12)
where G is the p
d
-dimensional state transition matrix and the state errors w
t
are assumed
to be i.i.d. N
p
d
(0, W).If H = 1and m = 1, the HMDM in (20.10)–(20.12) simplies
to the hierarchical DGLM (HDGLM), with the univariate Poisson pmf as the sampling
distribution.
20.4.3 Bayesian Inference for the HMDM Model
Let Y, B,and S, respectively, denote the responses y
it
, the dynamic predictors, and the
static predictors, for t = 1, ..., T and i = 1, ..., N.Let η and β denote all the coefcients η
j
and β
it
for j = 1, ..., q, t = 1, ..., T and i = 1, ..., N,andlet γ denotes all the coefcients γ
t
for t = 1, ..., T. The likelihood function under the model described by (20.10)–(20.12) is
N
T
L(η, β, γ; Y, D, S) =
MP
m
(y
i,t
|β
i,t
, γ
t
)p
normal
(η) × p
normal
(β
i,t
|γ
t
) × p
normal
(γ
t
|γ
t1
),
i=1
t=1
where we have suppressed the terms B and S on the right side for brevity. We assume
multivariate normal priors for the initial state vector and the static coefcients, that is,
γ
0
N
p
d
(m
0
, C
0
) and η N
p
s
(μ
η
,
η
). We assume inverse Wishart priors for the vari-
ance terms V
i
and W,thatis, V
i
IW(n
v
, S
v
) and W IW(n
w
, S
w
). We assume a product
prior specication, and the hyperparameters are selected to correspond to a vague prior
specication.
The joint posterior of the unknown parameters is proportional to the product of the
likelihood and the prior
π(β
it
, γ
t
, η, V
i
, W|Y, D, S)
T
N
1
MP
m
(y
i,t
|λ
i,t
)|V
i
|
1/2
exp
(β
i,t
γ
t
)
V
1
(β
i,t
γ
t
)
2
i
t=1
i=1
1
1
×|
η
|
1/2
exp
(η μ
η
)
η
(η μ
η
)
2
436 Handbook of Discrete-Valued Time Series
T
×
|W|
1/2
exp
1
(γ
t
Gγ
t1
)
W
1
(γ
t
Gγ
t1
)
2
t=1
×|W|
n
w
/2
exp
1
tr(W
1
S
w
)
2
N
1
C
1
1
×|C
0
|
1/2
exp
(γ
0
m
0
)
0
(γ
0
m
0
)
|V
i
|
n
v
/2
exp
tr(V
1
S
v
)
.
2 2
i
i=1
The Gibbs sampler proceeds by sequentially sampling from the complete conditional dis-
tributions of the parameters, which are proportional to the joint posterior. Details on these
distributions are provided in the Appendix. We use the FFBS algorithm described in Carter
and Kohn (1994) and Fruhwirth-Schnatter (1994) to generate a random sample from the
complete conditional distribution of γ
t
,for t = 1, ..., T. We make inverse Wishart draws
for V
i
and W, Dirichlet draws for the vector of mixing proportions, and a Metropolis–
Hastings algorithm is used for sampling β
i,t
and η. For details, and an ecology illustration,
see Ravishanker et al. (2014).
For the marketing data on prescription counts, we explore a more parsimonious model,
where some coefcients have a dynamic evolution over time but are not physician specic,
while other coefcients are static over time, but are physician specic. We refer to this as
the MDFM model and describe it in the next section.
20.5 Multivariate Dynamic Finite Mixture Model
For parsimony, we t the MDFM model to the prescriptions data.
20.5.1 MDFM Model Description
We study patterns in the dynamic evolution of sales of the own drug along with a challenger
drug and a leader drug. Here, m = 3, q = 6, y
i,t
= (y
i,t,1
, y
i,t,2
, y
i,t,3
)
, and we assume a mix-
ture of H trivariate Poisson distributions with two-way covariate structure as the sampling
distribution. The observation equation of the MDFM model is
H
p(y
i,t
|λ
i,t,h
) = π
h
MP
3
(y
i,t
|λ
i,t,h
),
h=1
where λ
i,t,h
= (λ
i,t,1,h
, ..., λ
i,t,q,h
)
,for h = 1, ..., H and MP
3
(.) was dened in (20.9). For
h = 1, ..., H, the underlying independent Poisson means are modeled as
ln(λ
i,t,k,h
) = β
0,t,k,h
+ β
1,i,k,h
ln(D
i,t
+ 1) + β
2,i,k,h
ln(y
i,(t1),k
+ 1) for k = 1, ..., m,
ln(λ
i,t,,h
) = β
0,t,,h
for = m + 1, ..., q.
Note that the q intercepts are not physician specic, but are allowed to evolve dynamically
via the system equation. The partial regression coefcients corresponding to detailing and
lagged prescription counts are not time evolving, although they are physician specic. This
is a parsimonious model that we t to the vector of prescription counts.
437 Dynamic Models for Time Series of Counts with a Marketing Application
Let β
0,t,h
= (β
0,t,1,h
, ..., β
0,t,q,h
)
. In the system equation, we assume a random walk
evolution of the state parameter vector, so that for h = 1, ..., H,
β
0,t,h
= Gβ
0,t1,h
+ w
t,h
,
where G is an identity matrix, and w
t,h
N
p
(0, W
h
).
20.5.2 Bayesian Inference for the MDFM Model
We write the mixture model in terms of missing (or incomplete) data; see Dempster et al.
(1977) and Diebolt and Robert (1994). For i = 1, ..., N and t = 1, ..., T, recall that
H
p(y
i,t
|λ
i,t,h
) =
h=1
π
h
MP
3
(y
i,t
|λ
i,t,h
).Letz
i,t
= (z
i,t,1
, ..., z
i,t,H
)
be an H-dimensional vector
indicating the component to which y
i,t
belongs, so that z
i,t,h
∈{0, 1} and
H
= 1. The
h=1
z
i,t,h
pmf of the complete data (y
i,t
, z
i,t
) is
H
f (y
i,t
, z
i,t
|λ
i,t,h
) = π
z
i,t,h
[p(y
i,t
|λ
i,t,h
)]
z
i,t,h
. (20.13)
h
h=1
For h = 1, ..., H, we make the following prior assumptions. We assume that the p-
dimensional initial state parameter vector β
0,1,h
MVN(a
0,h
, R
0,h
),the m-dimensional
subject-specic coefcient β
1,i,h
MVN(a
1,i,h
, R
1,i,h
),and the m-dimensional parameter
β
2,i,h
MVN(a
2,i,h
, R
2,i,h
). We assume inverse Wishart priors, IW(n
h
, S
h
), for the variance
terms W
h
, and assume the conjugate Dirichlet(d
1
, ..., d
H
) prior for π = (π
1
, ..., π
H
), which
simplies to the Beta(d
1
, d
2
) prior for π
1
when H = 2.
The joint posterior density of the unknown parameters is proportional to the product of
the complete data likelihood and the product of the priors discussed earlier. We denote
the set of unknown parameters by = (β
0
, β
1
, β
2
, W, π). The Gibbs sampler enables
posterior inference by drawing samples using suitable techniques such as direct draws
when the complete conditionals have known forms and sampling algorithms such as the
Metropolis–Hastings algorithm otherwise. The complete conditional densities are propor-
tional to the joint posterior and are shown in the Appendix, along with details of the
sampling algorithms.
We t the MDFM model with H = 2. The posterior mean and standard deviation of
the mixing proportion π
1
are, respectively, 0.758 and 0.008, and the 95% highest posterior
density (HPD) interval is (0.742, 0.770). Table 20.1 shows the posterior summary of the state
variances W
h
for h = 1, 2.
We calculate the independent Poisson means λ
i,t,h,1
, ..., λ
i,t,h,q
for h = 1, 2 and q = 6.
Through the unconditional expectation formula for the nite mixture of multivariate Pois-
son distributions, we obtain the predicted means of the own drug and the competing
drugs. We then make Poisson draws with the corresponding predicted means. Figure 20.1
shows time series plots of the observed prescription counts for the three drugs from four
randomly selected physicians, and Figure 20.2 shows time series plots of the correspond-
ing predicted means. Figure 20.3 shows one-month-ahead predictions for all physicians.
The absolute differences between observed counts and predicted counts are 1.869, 1.980,
and 2.996, respectively, for the own, challenger, and leader drugs.
438 Handbook of Discrete-Valued Time Series
TABLE 20.1
Posterior summaries for W
h
Posterior Mean
W
1,1,1
0.0086
W
1,2,2
0.0089
W
1,3,3
0.0085
W
1,4,4
0.0087
W
1,5,5
0.0090
W
1,6,6
0.0090
W
2,1,1
0.0089
W
2,2,2
0.0088
W
2,3,3
0.0088
W
2,4,4
0.0085
W
2,5,5
0.0087
W
2,6,6
0.0092
Posterior SD
0.0011
0.0012
0.0011
0.0011
0.0013
0.0013
0.0014
0.0012
0.0012
0.0011
0.0011
0.0013
95 % HPD Interval
(0.0067, 0.0111)
(0.0067, 0.0109)
(0.0065, 0.0105)
(0.0069, 0.0111)
(0.0068, 0.0115)
(0.0068, 0.0116)
(0.0066, 0.0121)
(0.0068, 0.0112)
(0.0070, 0.0113)
(0.0066, 0.0105)
(0.0066, 0.0112)
(0.0068, 0.0117)
Physician 29
Physician 48
20
30
40
50
10
10
15
25
20
5
0
Observed counts
Observed counts
0 10 20 30 40
0 10 20 30 40
Month
Month
Physician 58 Physician 71
25
40
0 10 20 30 40
20
Observed counts
Observed counts
30
15
20
10
5
10
0
0
10 20 30 40
Month
Month
FIGURE 20.1
Time series plots of observed counts of own drug (solid line), challenger drug (dashed line), and leader drug
(dotted line).
439
25
Dynamic Models for Time Series of Counts with a Marketing Application
Physician 29
Physician 48
40
0 10 20 30 40
0 10 20 30 40
Predicted mean
Predicted mean
Predicted mean
Predicted mean
30
20
15
20
10
10
5
0
Month
Month
Physician 58
Physician 71
50
0 10 20 30 40
25
0 10 20 30 40
40
20
30
15
20
10
10
5
Month
Month
FIGURE 20.2
Time series plots of predictions of own drug (solid line), challenger drug (dashed line), and leader drug
(dotted line).
20.6 Summary
This chapter describes a hierarchical dynamic modeling framework for univariate and mul-
tivariate time series of counts and investigates their utility for a marketing data set on
new prescriptions written by physicians. We discuss a dynamic ZIP framework that com-
bines sparse survey–based customer attitude data that are not available at regular intervals,
with customer-level transaction and marketing histories that are available at regular time
intervals. Univariate count time series of new prescriptions is modeled in order to discuss
retention and sales. We also describe the use of the multivariate Poisson distribution as the
sampling distribution in a fully Bayesian framework for inference in the context of multi-
variate count time series. This enables us to address a useful aspect in marketing research,
which to jointly model the number of prescriptions of different drugs written by the physi-
cians over time, taking into account possible associations between them, and studying the
effect of a rm’s detailing on the sales of its own drug and competitors. This is done using
the parsimonious MDFM model, which enables us to study the evolution of sales of a
set of competing drugs within a category. Work on this topic is ongoing, and it is also
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset