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
12.7147 | 1.9690 | 49 | 6.46 | <.0001 | 8.7577 | 16.6716 | 0.000024 | |
0.4277 | 0.1286 | 49 | 3.33 | 0.0017 | 0.1692 | 0.6862 | -0.00056 | |
0.5333 | 0.1028 | 49 | 5.19 | <.0001 | 0.3268 | 0.7398 | 0.000696 | |
0.2340 | 0.03243 | 49 | 7.21 | <.0001 | 0.1688 | 0.2991 | -0.00067 | |
5.6538 | 0.3528 | 49 | 16.03 | <.0001 | 4.9448 | 6.3627 | 0.000128 | |
0.9889 | 1.8722 | 49 | 0.53 | 0.5997 | -2.7735 | 4.7513 | -6.15E-6 | |
0.1935 | 0.01809 | 49 | 10.70 | <.0001 | 0.1571 | 0.2298 | 0.000413 | |
1.5708 | . | 49 | . | . | . | . | -0.00030 | Upper BC |
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;
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.
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.
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.
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;
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.
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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.