From: Nitish on
Hi,

I am trying to estimate a very simple model with a small twist. Counts
are distributed by Poisson arrival rate, along with a normal
distribution.

proc nlmixed data=countdata;
parms logsig 0 alpha1 1 beta1 1;
eta = (alpha1 + beta1*lnW)+ e;
lambda = exp(eta);
model count ~ poisson(lambda);
random e ~ normal(0,exp(2*logsig)) subject=id;
run;

I get the error "Optimization cannot be completed". How can this model
be suitably reimplemented in NLMIXED? Should I be looking at some
other procedure? Appreciate any comment.

Regards
Nitish
From: Robin R High on
Nitish,

It would help to know more about the data set, but with 9.2 you can do the
same analyses with GLIMMIX:

PROC GLIMMIX method=laplace ; * or method= quad;
model count = lnW / dist=poisson solution;
random int / subject=id;
run;

And you might start with dist=negbin, or at least compare the results.

That the NLMIXED is not converging could be due to a number of reasons,
though knowing more about what data are like that go into the proc -- how
many id's, excess 0's? small counts, etc. -- helps one to better
understand what does or does not come out of it.

Robin High
UNMC






From:
Nitish <nitish.ranjan(a)GMAIL.COM>
To:
SAS-L(a)LISTSERV.UGA.EDU
Date:
03/09/2010 12:34 PM
Subject:
SAS nlmixed for count data with random effect
Sent by:
"SAS(r) Discussion" <SAS-L(a)LISTSERV.UGA.EDU>



Hi,

I am trying to estimate a very simple model with a small twist. Counts
are distributed by Poisson arrival rate, along with a normal
distribution.

proc nlmixed data=countdata;
parms logsig 0 alpha1 1 beta1 1;
eta = (alpha1 + beta1*lnW)+ e;
lambda = exp(eta);
model count ~ poisson(lambda);
random e ~ normal(0,exp(2*logsig)) subject=id;
run;

I get the error "Optimization cannot be completed". How can this model
be suitably reimplemented in NLMIXED? Should I be looking at some
other procedure? Appreciate any comment.

Regards
Nitish
From: Dale McLerran on
--- On Tue, 3/9/10, Nitish <nitish.ranjan(a)GMAIL.COM> wrote:

> From: Nitish <nitish.ranjan(a)GMAIL.COM>
> Subject: SAS nlmixed for count data with random effect
> To: SAS-L(a)LISTSERV.UGA.EDU
> Date: Tuesday, March 9, 2010, 9:32 AM
> Hi,
>
> I am trying to estimate a very simple model with a small twist. Counts
> are distributed by Poisson arrival rate, along with a normal
> distribution.
>
> proc nlmixed data=countdata;
> parms logsig 0 alpha1 1 beta1 1;
> eta = (alpha1 + beta1*lnW)+ e;
> lambda = exp(eta);
> model count ~ poisson(lambda);
> random e ~ normal(0,exp(2*logsig)) subject=id;
> run;
>
> I get the error "Optimization cannot be completed". How can this model
> be suitably reimplemented in NLMIXED? Should I be looking at some
> other procedure? Appreciate any comment.
>
> Regards
> Nitish
>

Nitish,

First of all, you might fit a fixed effect model to get better
initial values for alpha1 and beta1. So, first run the code:

proc nlmixed data=countdata;
parms alpha1 1 beta1 1;
eta = (alpha1 + beta1*lnW);
lambda = exp(eta);
model count ~ poisson(lambda);
run;


That should converge without problem. (If that doesn't converge,
then you have some really serious issues to deal with.)

Now, run the random effects model initializing alpha1 and beta1
to values obtained from the model just fitted. I would suggest
that you also examine the model likelihood using several initial
values for the random effect variance. I would further suggest
that you initialize the random effect variance to a value which
is smaller than 1. (Note that V(e) = exp(2*logsig)=1 when
logsig=0.)

Thus, given fixed effects alpha1=<alpha1> and beta1=<beta1>,
try running the code:

proc nlmixed data=countdata;
parms logsig -5 to 0 by 1
alpha1 <alpha1> beta1 <beta1>;
eta = (alpha1 + beta1*lnW)+ e;
lambda = exp(eta);
model count ~ poisson(lambda);
random e ~ normal(0,exp(2*logsig)) subject=id;
run;


where <alpha1> and <beta1> are replaced by specific values.

Of course, there is no guarantee that this will converge, either.
However, I would be surprised if such a simple model did not
converge. But if you still run into problems, then you can
try different estimation methods. The NLMIXED procedure has
quite a few estimation methods available (quasi-Newton,
Newton-Raphson, Newton-Raphson with ridging, conjugate gradient,
double dogleg, Nelder-Mead-Simplex, and trust region) Moreover,
the different estimation methods can be fine-tuned with optional
parameters. You can evaluate numerical derivatives of the
parameters using inexpensive forward differences or you can
evaluate numerical derivatives using more expensive central
differences.

There are just a ton of options that you might consider. It is
not feasible to discuss here the different options. My guess is
that with better initial estimates of the parameters, you won't
need to specify any options to aid convergence.

Dale

---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: dmclerra(a)NO_SPAMfhcrc.org
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------