HAL Id: hal-00894125
https://hal.archives-ouvertes.fr/hal-00894125
Submitted on 1 Jan 1996
HAL is a multi-disciplinary open access
archive for the deposit and dissemination of
sci-entific research documents, whether they are
pub-lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d’enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.
On a multivariate implementation of the Gibbs sampler
La García-Cortés, D Sorensen
To cite this version:
Note
On
a
multivariate
implementation
of
the Gibbs
sampler
LA
García-Cortés,
D
Sorensen*
National Institute
of
AnimalScience,
Research CenterFoulum,
PB 39, DK-8830Tjele,
Denmark(Received
2August 1995; accepted
30 October1995)
Summary - It is well established that when the parameters in a model are
correlated,
therate of convergence of Gibbs chains to the
appropriate stationary
distributions is faster and Monte-Carlo variances of features of these distributions are lower for agiven
chainlength,
when the Gibbssampler
isimplemented by blocking
the correlated parameters andsampling
from therespective
conditionalposterior
distributions takesplace
in amultivariate rather than in a scalar fashion. This block
sampling
strategy often requiresknowledge
of the inverse oflarge
matrices. In this note a blocksampling
strategy isimplemented
which circumvents the use of these inverses. Thealgorithm applies
in thecontext of the Gaussian model and is illustrated with a small simulated data set.
Gibbs sampling
/
block sampling/
Bayesian analysisRésumé - Une mise en oeuvre multivariate de l’échantillonnage de Gibbs. Il est
bien établi que,
lorsque
lesparamètres
d’un modèle sontcorrélés,
l’estimation de cesparamètres
paréchantillonnage
de Gibbs converge lentementlorsque
les composantes du modèle sont traitéesséparément.
Mais, sil’échantillonnage
de Gibbs est conduit enfixant
des valeurs pour les paramètres corrélés et en échantillonnant dans les distributions conditionnelles respectives, la convergence estplus rapide
et les variances de Monte-Carlo descaractéristiques
des distributions sont diminuées pour une chaîne delongueur
donnée. Cetéchantillonnage
multidimensionnel et nonplus
scalaire requiert souvent l’inversion de matrices degrande
taille. Cette noteprésente
une méthoded’échantillonnage
en blocde ce type qui évite le passage par ces inverses.
L’algorithme s’applique
dans le contexted’un modèle
gaussien
et est illustrénumériquement
sur un petit échantillon de donnéessimulées.
échantillonnage de Gibbs
/
échantillonnage en bloc/
analyse bayésienne*
INTRODUCTION
The Gibbs
sampler
is a numericaltechnique
that has received considerable attentionin statistics and animal
breeding.
It isparticularly
useful in the solution ofhigh
dimensionalintegrations
and has therefore beenapplied
in likelihood andBayesian
inferenceproblems
in a widevariety
of models.The Gibbs
sampler
produces
realizations from ajoint posterior
distributionby sampling repeatedly
from the full conditionalposterior
distributions of theparameters
of the model. Intheory,
drawing
from thejoint posterior
density
takesplace
only
in thelimit,
as the number ofdrawings
becomes infinite. Thestudy
ofconvergence to the
appropriate
distributions is still an active area ofresearch,
but it is well established that convergence can be slow whenhighly
correlated scalarcomponents
are treatedindividually
(Smith
andRoberts,
1993).
In such casesit is
preferable
to block the scalars and toperform sampling
from multivariate conditional distributions. Liu et al(1994)
show that a blocksampling
strategy
can lead to
considerably
smaller Monte-Carlo variances of estimates of features ofposterior
distributions.In animal
breeding applications
this blocksampling
strategy
can be difficult toimplement
becauserepeated
inversions and factorizations of verylarge
matrices arerequired
in order toperform
the multivariatesampling.
The purpose of this note is to describe a blocksampling
computer strategy
which does notrequire
knowledge
of the inverse of these matrices. The results of
applying
the method are illustratedusing
a small simulated data set. THE MODELLet y, a and b
represent
vectors of data(order n),
of additivegenetic
values(order q)
and of fixed effects(order p),
respectively,
and let X and Z bedesign
matricesassociating
the data with the additivegenetic
values and fixedeffects,
respectively.
We will assume that the data areconditionally normally distributed,
that is:
where
Q
e
is
the residual variance.Invoking
an infinitesimal additivegenetic model,
the distribution of additive
genetic
values is also normal:where A is the known numerator
relationship
matrix ando,2
is
the additivegenetic
variance. For illustration purposes we will assume that the vector of fixed effects
b,
and of the variancecomponents
Q
a
and
Q
e
are all apriori
independent
andthat
they
follow proper uniform distributions. Under themodel,
thejoint posterior
distribution of theparameters
is:METHODS
and C =
W’W+,f2,
where k =e a
Then the mixed-modelequations
associatedwith
[1]
and[2]
are:The
implementation
of the Gibbssampler requires
sampling
0 from:and
!2
from:
where 9
=E(6!, af, y)
satisfies the linearsystem
[4],
andC-
l
(j;
=Var(0 )a£ ,
!e!y)!
In
[6],
S
a
= a’A-
1
a; v
a
= q - 2; S
e
=(y-Xb-Za)’(y-Xb-Za); !
= n - 2;
and
X
;;,
2
is an inverse chi square variate with Videgrees
of freedom. In order tosample the
whole vector 0simultaneously
from[5]
withoutinvolving
the inverse ofthe coefficient matrix
C,
we draw from ideas in Garcia-Cortes et al(1992, 1995).
Givenstarting
values forQ
a,
Q
e,
apply
the method ofcomposition
(eg,
Tanner,
1993)
to solve thefollowing
equation:
To obtain
samples
fromp(y!,o!),
draw0
*
fromp (e l(j!(j!)
andy
*
fromp(y!e*,!,er!).
Then(y
*
, 0
*
)
is adrawing
fromp (y, 0)a£, af)
and(y
*
)
fromp
(YI!a! !e!’
Further,
thepair
(y
*
,
0
*
)
can also be viewed as a realized value fromp ( 0 ) a£ ,
af
, y
*
)
and fromp(
YI
0
*
,
Q
a,
Q
e
J’
By analogy
with theidentity:
we define the random variable:
where
the random variable 0 in[9]
hasdensity
p(o 10,2, a U2, e y*).
Theexpected
valueof 0 in
[9]
withrespect
top(o 10,
2
,
U2
,
)
y
*
isequal
toE ( 0 ) a£ , 0
,
2
, y)
and the variance isC-
l
(j;,
independent_of y
*
.
Inaddition,
the random variable 0 in[9]
isnormally
which is the conditional
posterior
distribution of interest.Using
[4]
and!5!,
andreplacing
the random variable 0 in[9]
by
its realized values0
*
,
it follows that!*
drawings
from this conditionalposterior
distribution,
which we denoteA ,
can beconstructed
by solving
the linearsystem:
A wide
variety
of efficientalgorithms
are available which do notrequire C-
1
to solve the mixed-modelequations
(10!.
We note inpassing
that under theassumption
of either proper orimproper
uniformpriors
forb,
asimple manipulation
of[10]
shows that this
expression
is not a function ofb
*
,
where0*! _
(a*!b*!).
Thereforethe
drawing
of0
*
from paf)
£
(0 )a
involves a*only,
and b* can be setarbitrarily
to zero.
!*
With
0
available,
draw from:The
samples
Q2
are
now used in the new round of iteration asinput
in(7!.
AN EXAMPLE
As an
illustration,
the block(multivariate)
sampling
strategy
iscompared
withthe traditional scalar
implementation
of the Gibbssampler.
A data file based on aunivariate animal model with 250 individuals
(all
with onerecord,
25 individualsper
generation,
tengenerations)
and one fixed-effect factor with ten levels wassimulated. For both
strategies,
asingle
chain oflength
31 000 was run, and the first1000
samples
were discarded.Table I shows estimates of the Monte-Carlo variance of the mean of the
marginal posterior
distributions of the first level of the fixed-effectfactor,
of the additivegenetic
value of the last individual and of both variancecomponents.
The mean was estimatedby summing
thesamples
anddividing
by
the numberof
samples
(30 000)
and the Monte-Carlo variance wascomputed using
the Markovchain estimator
(Geyer, 1992).
Also shown in table I are estimates of the chains effectivelength. Briefly,
the effective chainlength
is associated with the amount of information available in agiven
chain. Thisparameter
becomes smaller as thedependence
between thesamples
of the chain increases. When thesamples
are infact
independent,
the effective and actual chainlengths
areequal.
Details can befound in Sorensen et al
(1995).
Thefigures
in table I show that for this model and datastructure,
there is a reduction in the Monte-Carlo varianceby
a factor often
using
the blocksampling
strategy
in the case of the fixed effects andbreeding
values,
and a twofold reduction in the case of the variancecomponents.
In the above
example,
the reduction of the Monte-Carlo varianceusing
either the scalar or blocksampling
strategies
wascompared
on the basis of thesimple
estimator of the mean of
marginal
posterior
distributions(the
raw average of theelements of the Gibbs
chain).
A more efficient estimator is based on the average ofrefer to this as the mixture estimator. For
example,
letX,
Y and Z denote threeparameters
and assume that interest focuses on the estimate of the mean of themarginal
posterior
distribution of X.The mixture estimator is
given by
where the summation over i is over the n elements of the Gibbs
chain,
and thesummation
over j
is over the chosen values of X.Alternatively,
when theintegral
has a closed-form
solution,
the mixture estimator can take the formThe Monte-Carlo variances of the mixture estimator of the mean of the
marginal
posterior
distributions of the first level of the fixed effectfactor,
of the additivegenetic
value of the last individual and of both variancecomponents
wererespec-tively
5.11 x10-
3
,
7.62 x,
10-
3
2.59 and 1.03 for the scalarsampling
strategy
and 0.13 x10-
3
,
0.56 x10-
3
,
1.30 and 0.43 for the blocksampling
strategy.
There is asmall increase in
efficiency
relative to the ’raw means estimator’ in the case of the locationparameters
but not in the case of the variancecomponents.
The mixtureestimator is
especially
beneficial when the chain mixesquickly
(Liu
etal,
1994)
and this is not the case in animal models.CONCLUSIONS
We have
presented
analgorithm
which allows us toimplement
the Gibbssampler
in a multivariate fashion. The
development
is in terms of thesingle
trait Gaussianmodel,
but extension to amultiple
traitanalysis
witharbitrary
pattern
ofmissing
data is
straightforward,
provided
theprocedure
isused
inconjunction
with dataand data structure. The
important
feature of thestrategy
is that itonly
involves the solution of a linearsystem.
This means that eithercomputer
time orstorage
requirements
can beoptimized
by
choice of theappropriate
method to solve the linearsystem.
This is in contrast with the scalar Gibbssampler
which hascomputer
requirements analogous
to Gauss-Seidel iterative methods.ACKNOWLEDGMENTS
Our
colleagues
D Gianola and S Andersen contributed withinsightful
comments.REFERENCES
Garcia-Cortes
LA,
MorenoC,
VaronaL,
Altarriba J(1992)
Variance componentestima-tion
by resampling.
J Anim Breed Genet109,
358-363Garcia-Cort6s
LA,
MorenoC,
VaronaL,
Altarriba J(1995)
Estimation ofprediction
errorvariances
by resampling.
J Ani7n, Breed Genet112,
176-182Gelfand
AE,
Smith AFM(1990)
Sampling-based approaches
tocalculating
marginal
densities. J Am Stat Assoc
85,
398-409Gelfand
AE,
HillsSE,
Racine-PoonA,
Smith AFM(1990)
Illustration ofBayesian
inference in normal data modelsusing
Gibbssampling.
J Am Stat Assoc 85, 972-985Geyer
CJ(1992)
Practical Markov chain Monte-Carlo(with discussion).
Stat Sci 7, 46-511 1Liu
JS, Wong WH, Kong
A(1994)
Covariance structure of the Gibbssampler
withapplications
to thecomparisons
of estimators andaugmentation
schemes. Biometrika 81, 27-40Smith
AFM,
Roberts GO(1993)
Bayesian
computation via the Gibbssampler
and related Markov chain Monte-Carlo methods. J R Stat Soc B 55, 3-23Sorensen
DA,
AndersenS,
GianolaD, Korsgaard
I(1995)
Bayesian
inference in threshold modelsusing
Gibbssampling.
Genet SetEvol 27,
229-249Tanner M