[ADMB Users] ADMB and hierarchical (multi-level) models

Saang-Yoon shyunuw at gmail.com
Fri Aug 13 14:33:55 PDT 2010

Hi, Mark.
Thank you very much for your response.  Your answer is helpful, but
still I am not sure about whether ADMB really can do a multi-level
(hierarchical) modeling.  Beside the likelihood function in the above
example, I have another likelihood function of newY.  In this case,
newY is really a parameter.  The newY is decomposed to four age groups
(say, newY1, newY2, newY3, and newY4; i.e., newY =
newY1+newY2+newY3+newY4).  Given age-catches, I have a multinomial
likelihood function of (newY1/newY, newY2/newY, newY3/newY, newY4/
newY).   Call the likelihood function L0.

To clarify my inquiry, I combine this current and previous
(1)  L0 = L(newY1/newY, newY2/newY, newY3/newY, newY4/newY | age-
specific catches)

(2)  L1 = L(beta0, beta1, sigma2 | observed Ys, observed Xs)

(2)  Prior1 = Pr(newY | beta0, beta1, sigma2, newX).
Strictly speaking this is not a likelihood function, but a predictive
function.  I apply the predictive function as a prior for newYs.

Finally I sum the respective logarithm of these above functions.
f = – logL0 – logL1 – logPrior1;

Then, estimates of beta0, beta1, and sigma2 are affected by newYs as
well as observed Ys and observed Xs; again this is WRONG!!!.  Because
of L0, I have to declare newYs as free parameters, do I not?  In this
example, beta0, beta1, and sigma2 are hyper parameters, and thus they
must NOT be affected by parameters and data at a lower level.  I am
extremely curious about how you or other ADMB experts get around this
problem.  Again thank you very much for your response.  Best,


On Aug 13, 12:11 pm, "Mark Maunder" <mmaun... at iattc.org> wrote:
> Saang-Yoon,
> I think you problem is solved simply by creating a new variable in the procedure section
> sdreport_number newY
> and then assign ypred a value in the procedure section based on beta0, beta1, sigma2, newX.
> The value of newY with its standard deviation will be reported in the *.std file.
> Mark
> Mark Maunder
> Head of the Stock Assessment Program
> Inter-American  Tropical Tuna Commission
> 8604 La Jolla Shores Drive
> La Jolla, CA, 92037-1508, USA
> Tel:(858) 546-7027begin_of_the_skype_highlighting              (858) 546-7027      end_of_the_skype_highlighting
> Fax: (858) 546-7133
> mmaun... at iattc.orghttp://www.fisheriesstockassessment.com/TikiWiki/tiki-index.php?page=...
> Visit the AD Model Builder project at
>  http://admb-project.org/
> See the following website for information on fisheries stock assessmenthttp://www.fisheriesstockassessment.com/
> -----Original Message-----
> From: users-boun... at admb-project.org [mailto:users-boun... at admb-project.org] On Behalf Of Saang-Yoon
> Sent: Friday, August 13, 2010 9:04 AM
> To: us... at admb-project.org
> Subject: [ADMB Users] ADMB and hierarchical (multi-level) models
> Dear ADMB users.
> I wonder about how people code multi-level models in ADMB.  I
> illustrate my question with a simple example.  Let's assume we have a
> simple regression model,
> Y = beta0 + beta1*X + error, where error ~ N(0, sigma2)
> Please think about two problems of (1) estimation of parameters
> (beta0, beta1, and sigma2), and then (2) prediction of unknown random
> variable (Y at a future time, given new X).  Strictly speaking,
> unknown Y at a future time (say, newY) is NOT a parameter but a random
> variable, although many fisheries papers treat the Y as a parameter.
> But I follow the incorrect treatment (i.e., newY as a parameter) at
> the moment to focus on my question about ADMB.  Also this is a simple
> "example" for showing my problem with ADMB when facing a hierarchical
> model.
> (1) Estimation of parameters, beta0, beta1, and sigma2
> L(beta0, beta1, sigma2 | observed Ys, observed Xs)
> This likelihood provides inference of these three parameters.  I call
> it L1
> (2) Calculation of new Y given new X.
> L(newY | beta0, beta1, sigma2, newX)
> I call this second likelihood function L2.  newX is a constant.
> These two steps can be viewed as a multi-level or hierarchical
> structure.  In ADMB, the objection function would be the sum of the
> respective negative loglikelihood functions: i.e.,
>  f = - logL1 - logL2;
> where beta0, beta1, sigma2, and newY are declared as free parameters
> My problem with this above coding is that estimates of beta0, beta1,
> and sigma2 are affected by "newY" as well as "observed Ys" and
> "observed Xs".  This is WRONG!!!   Estimation of beta0, and beta1, and
> sigma2 must depend ONLY on "observed Ys", and "observed Xs".
> I wonder about how ADMB experts do around this problem.  I would
> extremely appreciate your guidance and help.   Thank you,
> Saang-Yoon
> _______________________________________________
> Users mailing list
> Us... at admb-project.orghttp://lists.admb-project.org/mailman/listinfo/users
> _______________________________________________
> Users mailing list
> Us... at admb-project.orghttp://lists.admb-project.org/mailman/listinfo/users- Hide quoted text -
> - Show quoted text -

More information about the Users mailing list