Programming the statistical procedures from SAS

Message of UpperBC in PROC NLMIXED output_What does it mean?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

Message of UpperBC in PROC NLMIXED output_What does it mean?

[ Edited ]

Hi all,

I run a non linear mixed effect model in SAS software using PROC NLMIXED program. The model is converged. However, in the outputs, there are an additional column "Active BC" with value "UpperBC" for some parameters. I tried to google but it seems there is no documentation about this value. Could any one give me a clear explanation what does it mean? And should I worry about the results?

My opinion is that maybe it related to the model specification, when I put some constraints to some parameter, so when the estimates are at the boundary, this is occurred and we can use the outputs with no worries. But this is just my thought without any backup reference.

Thank you for any input.

Here is  my program:

 

ods listing close;
 proc nlmixed data = sub1 xtol = 1E-12 method = GAUSS qpoints = 100 HESS;
   by Replicate;
   parms A0 =9.54 beta = 0.542 gamma = 0.518 alpha = 0.2 h = 5
         sigma_A0 = 1.09
         sigma2 = 0.1 phi1 = 0.5;
   bounds A0 beta gamma alpha > 0;
   bounds sigma2>= 0;
   bounds h>4;
   bounds - 1.570796 < phi1 <  1.570796;
   pi = constant('pi');
   mu1 = (A0+A0_i)*exp(-beta*t);
   mu2 = (A0+A0_i)*exp(-beta*2)*exp((t-2)*gamma);
   mu3 = (A0+A0_i)*exp(-beta*2)*exp((h-2)*gamma)*exp(-alpha*(t-h));
   logmu1 = log10(mu1);
   logmu2 = log10(mu2);
   logmu3 = log10(mu3);

   cof0 = sin(phi1);
   if t<= 2 and cens=0 then
     ll =( (1/(sqrt(2*pi*sigma2)))*exp(-(ynew - logmu1)**2/ (2*sigma2)) )*(cof0**2);
   if t>2 and t <= h and cens=0 then
     ll =( (1/(sqrt(2*pi*sigma2)))*exp(-(ynew - logmu2)**2/ (2*sigma2)) )*(cof0**2);
   if t > h and cens=0 then
     ll =( (1/(sqrt(2*pi*sigma2)))*exp(-(ynew - logmu3)**2/ (2*sigma2)) )*(cof0**2);
   if t<= 2 and cens=1 then
     ll = (cof0**2)*probnorm((ynew - logmu1) / sqrt(sigma2)) ;
   if t>2 and t < h and cens=1 then
     ll = (cof0**2)*probnorm((ynew - logmu2) / sqrt(sigma2)) ;
   if t > h and cens=1 then
     ll = (cof0**2)*probnorm((ynew - logmu3) / sqrt(sigma2)) ;
   L = log(ll); /*Log-likelihood*/
   model ynew ~ general(L);
   random A0_i ~ normal(0,sigma_A0*sigma_A0)
          subject = ID;
 run;

In the attachment I uploaded my simulated data which gave the following outputs:

 

SAS Output

Parameter Estimates Parameter Estimate Standard
Error DF t Value Pr > |t| 95% Confidence Limits Gradient Active BC A0 beta gamma alpha h sigma_A0 sigma2 phi1
12.71471.9690496.46<.00018.757716.67160.000024 
0.42770.1286493.330.00170.16920.6862-0.00056 
0.53330.1028495.19<.00010.32680.73980.000696 
0.23400.03243497.21<.00010.16880.2991-0.00067 
5.65380.35284916.03<.00014.94486.36270.000128 
0.98891.8722490.530.5997-2.77354.7513-6.15E-6 
0.19350.018094910.70<.00010.15710.22980.000413 
1.5708.49....-0.00030Upper BC

Accepted Solutions
Solution
‎08-08-2016 09:12 AM
SAS Super FREQ
Posts: 3,306

Re: How to put PROC NLMIXED into a FOR LOOP in SAS

Yes. For your data, it appears that the value of the liklihood function would increase if you allow phi1 to be greater than 1.5708. The solution that you report is the constrained optimum, but might not be an optimal value for the unconstained problem.

 

If you are looking for the constrained optimum, then the value that you obtained is fine to report. The gradient of the likelihood function is probably not zero at that point, which is another way of saying that the constrained optimimum is not a global (unconstrained) optimum. 

 

If you'd like to visualize the situation, run the following program:

data A;
do x = 0 to 3 by 0.01;
   y = -(x-2)**2 + 3;
   c = (x<=1);
   output;
end;
run;

title "Constrained Optimum when x in [0,1]";
proc sgplot data=A noautolegend;
block x=x block=c / transparency=0.5 novalues;
series x=x y=y / group=c;
refline 1 / axis=x;
run;

j.png

The objective function is f(x) = -(x-2)**2 + 3.  The global maximum occurs when x=2.  However, if you impose a constraint that x must be in the interval [0,1], then the constrained maximum is at x=1.

View solution in original post


All Replies
SAS Super FREQ
Posts: 3,306

Re: How to put PROC NLMIXED into a FOR LOOP in SAS

I'm not an expert on PROC NLMIXED, but from the names I think I can explain what you are seeing. When you do a nonlinear CONSTRAINED optimization, you specify the constraints by using the BOUNDS statements. These are often called Boundary Constraints or "BC".

 

An "UpperBC" is a constraint that prevents a parameter from being too large.  Many of your parameters have lower bounds. The phi1 parameter also has an upper bound.

 

An "ActiveBC" is a boundary constraint that is encountered during a particular step of the optimization algorithm. At a particular step, the unconstrained objective function might indicate that the algorithm adjust the parameters in a certain way. However, if the new parameter values would violate a constraint, the algorithm must adjust the step due to an "active constraint" so that the constraint is not violated.

 

Hope this helps.

Occasional Contributor
Posts: 15

Re: How to put PROC NLMIXED into a FOR LOOP in SAS

Thank you Nick.

It does mean that if I have put no constraint on that specific parameter, its optimal value could go beyond the constraint?

In the parameter estimate table, the standard error of phi1 is missing but still the final hessian matrix is positive definite.

So I assume that the final solution is still valid to report the result?

 

Thao.

Solution
‎08-08-2016 09:12 AM
SAS Super FREQ
Posts: 3,306

Re: How to put PROC NLMIXED into a FOR LOOP in SAS

Yes. For your data, it appears that the value of the liklihood function would increase if you allow phi1 to be greater than 1.5708. The solution that you report is the constrained optimum, but might not be an optimal value for the unconstained problem.

 

If you are looking for the constrained optimum, then the value that you obtained is fine to report. The gradient of the likelihood function is probably not zero at that point, which is another way of saying that the constrained optimimum is not a global (unconstrained) optimum. 

 

If you'd like to visualize the situation, run the following program:

data A;
do x = 0 to 3 by 0.01;
   y = -(x-2)**2 + 3;
   c = (x<=1);
   output;
end;
run;

title "Constrained Optimum when x in [0,1]";
proc sgplot data=A noautolegend;
block x=x block=c / transparency=0.5 novalues;
series x=x y=y / group=c;
refline 1 / axis=x;
run;

j.png

The objective function is f(x) = -(x-2)**2 + 3.  The global maximum occurs when x=2.  However, if you impose a constraint that x must be in the interval [0,1], then the constrained maximum is at x=1.

Occasional Contributor
Posts: 15

Re: How to put PROC NLMIXED into a FOR LOOP in SAS

Thank you Nick.

It is now very clear to me.

Indeed, the current solution is the "best" solution given the constrained. But if I would allow the parameters out of the bound, it might get to another solution.

 

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 223 views
  • 2 likes
  • 2 in conversation