From: peter.bonate@quintiles.com

Subject: Rounding errors / $SIM superproblem

Date: Fri, 23 Mar 2001 08:06:11 -0600

I have a few questions over the last couple of months and thought I would pose them to the group.

1.) At what point in the optimization process is NONMEM sensitive to rounding errors and secondly, if minimization is terminated due to rounding errors, can anything else be done except change the starting values.

2.) Can someone explain what a superproblem is and how it relates to the $SIM option.

Thanks.

pete bonate

*****

From: "KOWALSKI, KENNETH G. [PHR/1825]" <kenneth.g.kowalski@pharmacia.com>

Subject: RE: Rounding errors

Date: Fri, 23 Mar 2001 08:37:02 -0600

Pete,

With regards to item 1, this message is often an indication that your model is over-parameterized in some fashion. This could be due to the structural model (fixed effects), a high degree of collinearity among the covariates in your model, or the variance-covariance structure of the model. I think the last is often overlooked. You may need to simplify some aspect of your model to get the model to run.

Ken

*****

From: "Bachman, William" <bachmanw@globomax.com>

Subject: RE: Rounding errors

Date: Fri, 23 Mar 2001 10:03:59 -0500

Pete:

Regarding item 1.) Another technique that has worked when changing the esimates has not is to change SIGDIGITS to a larger number! I think this works because it changes the path taken in the optimization search. It may take you to a different region of the response surface and allow minization to terminate successfully.

regards,

Bill

William J. Bachman, Ph.D.

Senior Scientist

GloboMax LLC

7250 Parkway Drive, Suite 430

Hanover, MD 21076

Telephone: (410) 782-2212

FAX: (410) 712-0737

*****

From: Paul Hutson <prhutson@pharmacy.wisc.edu>

Subject: Rounding errors

Date: Fri, 23 Mar 2001 10:28:35 -0600

Ken:

By modifying the variance/covariance structure, do you suggest removing etas, or changing the structure, such as going from

TVCL=THETA(1)*EXP(ETA(1)) to

TVCL=THETA(1)+ETA(1) (recognizing the risk of a negative value for TVCL)?

Thanks

Paul Hutson

Paul Hutson, Pharm.D.

Associate Professor (CHS)

UW School of Pharmacy

425 N. Charter St

Madison, WI 53706-1515

Tel: (608) 263-2496

FAX: (608) 265-5421

Pager: (608) 265-7000, #7856

*****

From: "KOWALSKI, KENNETH G. [PHR/1825]" <kenneth.g.kowalski@pharmacia.com>

Subject: RE: Rounding errors

Date: Fri, 23 Mar 2001 11:19:57 -0600

Paul,

I was referring to removing etas and restrictions on the elements of Omega (eg., use of block diagonal structures). Also, I have encountered on numerous occasions where the correlation between etas for say V and CL is near unity. When this occurs one can get rounding errors or R matrix (hessian) singular or non-positive semi-definite problems resulting from the over-parameterization of Omega. In this setting I have had success in assuming a common eta for V and CL with a different scale parameter to account for differences in variances between V and CL. For example, if we model CL and V as:

CL=THETA(1)*EXP(ETA(1))

V=THETA(2)*EXP(ETA(2))

and assuming a full unstructured Omega, we have 3 elements of Omega to be estimated. If omega12/sqrt(omega11*omega22) is near 1 then the following restriction can help:

CL=THETA(1)*EXP(ETA(1))

V=THETA(2)*EXP(THETA(3)*ETA(1))

With this restriction we have only 2 elements of Omega, ie., omega11=var(ETA1) and THETA(3)=sqrt(var(ETA2)/var(ETA1)) where ETA2=THETA(3)*ETA1 provides the restriction that ETA1 and ETA2 are perfectly correlated but with different variances, ie., var(ETA2)=THETA(3)*THETA(3)*var(ETA1).

It is my understanding that NONMEM VI will allow one to postulate that Omega obeys an inverse-Wishart distribution which will provide another way to reduce the number of parameters in Omega relative to a full unstructured matrix.

Ken

*****

From: "diane r mould" <drmould@attglobal.net>

Subject: RE: Rounding errors

Date: Fri, 23 Mar 2001 13:09:22 -0500

Dear All

A few minor notes on the suggestions made by others:

I too have found that increasing the number of sig digits can sometimes result in NONMEM converging successfully when a previous run with fewer significan digits terminated due to rounding errors. Sometimes, however, the increased number of significant digits still results in a termination due to rounding errors. If this happens, the resulting parameters from the control stream with the higher number of significant digits can be used as intitial estimates for a new model. I would then reduce the number of significant digits back to 3 and this may converge successfully.

With regard to the variance covariance structure, if the termination is due to over parameterization in this part of the model, I have found that use of a BAND matrix structure and appropriately re-organizing the matrix can often get past the termination error but still retain much of the off-diagonal information.

Best Regards

Diane

*****

From: "KOWALSKI, KENNETH G. [PHR/1825]" <kenneth.g.kowalski@pharmacia.com>

Subject: RE: Rounding errors

Date: Fri, 23 Mar 2001 12:50:06 -0600

Diane,

Can you share with us how this banding of omega is performed? Do you have to code certain elements of omega as thetas?

Ken

*****

From: "diane r mould" <drmould@attglobal.net>

Subject: Re: Rounding errors

Date: Fri, 23 Mar 2001 14:40:09 -0500

Dear Ken

I will do the best I can :-)

In NONMEM, a BAND matrix is when some of the elements in the off diagonal matrix have been set to zero. Doing this effectively fixes these elements to zero, eliminating the need for NONMEM to estimate those values which may not be identifiable, without sacrificing other identifiable elements.

So if, for example, you have a one compartment model with CL, V, KA as parameters, if you can identify the covariance terms between CL and V and between CL and Ka, but not between Ka and V, a BAND matrix could be written to describe these relationships. Below is the NONMEM record for this, assuming that ETA(1) describes the variance on V, ETA(2) on CL and ETA(3) on KA.

$OMEGA BLOCK(3)

.1

.01 .1

0 .01 .1

No further coding is necessary. However, the elements in the BAND matrix must, of course, be symmetrical. Therefore a BAND matrix of

$OMEGA BLOCK(3)

.1

.01 .1

0 0 .1

will produce an error from NONMEM. You would need to code this arrangement instead as follows:

$OMEGA BLOCK(2)

.1

.01 .1

$OMEGA .1

I have found the use of the BAND matrix to be quite useful at times, particularly if the model is to be used later for simulation work for example.

Best Regards

Diane

*****

From: "KOWALSKI, KENNETH G. [PHR/1825]" <kenneth.g.kowalski@pharmacia.com>

Subject: RE: Rounding errors

Date: Fri, 23 Mar 2001 14:24:38 -0600

Diane,

See my comments and questions for clarification imbedded in your message in CAPS below.

Ken

-----Original Message-----

From: diane r mould [mailto:drmould@attglobal.net]

Sent: Friday, March 23, 2001 1:40 PM

To: KOWALSKI, KENNETH G. [PHR/1825]; nmusers@c255.ucsf.edu

Subject: Re: Termination due to rounding erros

Dear Ken

I will do the best I can :-)

In NONMEM, a BAND matrix is when some of the elements in the off diagonal matrix have been set to zero. Doing this effectively fixes these elements to zero, eliminating the need for NONMEM to estimate those values which may not be identifiable, without sacrificing other identifiable elements.

So if, for example, you have a one compartment model with CL, V, KA as parameters, if you can identify the covariance terms between CL and V and between CL and Ka, but not between Ka and V, a BAND matrix could be written to describe these relationships. Below is the NONMEM record for this, assuming that ETA(1) describes the variance on V, ETA(2) on CL and ETA(3) on KA.

$OMEGA BLOCK(3)

.1

.01 .1

0 .01 .1

No further coding is necessary.

HOW DOES NONMEM KNOW THAT THE OFF-DIAGONAL ELEMENT IS TO BE FIXED TO ZERO? I THOUGHT YOU COULDN'T USE THE FIXED OPTION ON INDIVIDUAL ELEMENTS IN A BLOCK. DOESN'T NONMEM BALK AT THIS THINKING IT IS A PARAMETER WITH ZERO FOR A STARTING VALUE? I THOUGHT ALL ELEMENTS WITHIN A BLOCK MUST BE NON-ZERO.

However, the elements in the BAND matrix must, of course, be symmetrical. Therefore a BAND matrix of

$OMEGA BLOCK(3)

.1

.01 .1

0 0 .1

will produce an error from NONMEM.

ACTUALLY THE ABOVE OMEGA BLOCK IS STILL SYMMETRICAL SO I'M NOT SURE WHY THIS EXAMPLE SHOULD BOMB BUT NOT THE FIRST EXAMPLE WITH ONLY ONE OFF-DIAGONAL SET TO ZERO.

You would need to code this arrangement

instead as follows:

$OMEGA BLOCK(2)

.1

.01 .1

$OMEGA .1

YES, THIS IS STANDARD BLOCKING OF AN OMEGA MATRIX (IE., ELEMENTS BETWEEN BLOCKS ARE UNCORRELATED BUT ELEMENTS WITHIN A BLOCK ARE CORRELATED).

I have found the use of the BAND matrix to be quite useful at times, particularly if the model is to be used later for simulation work for example.

YES, IT IS IMPORTANT TO GIVE AS MUCH ATTENTION TO THE COVARIANCE STRUCTURE AS THE FIXED-EFFECTS STRUCTURAL MODEL IF YOU KNOW THE MODEL WILL BE USED FOR SIMULATION PURPOSES.

*****

From: "diane r mould" <drmould@attglobal.net>

Subject: Re: Rounding errors

Date: Fri, 23 Mar 2001 17:14:47 -0500

Dear All

Below are further explanations for using the BAND matrix. I dont think that there is much in the manual on this topic. Bill Bachman reported:

"The only reference I have been able to find is in NONMEM V Supplemental Guide, p.1:

"2. Band Symmetric Matrices

An intial estimate of a diagonal block of either the OMEGA or SIGMA matrices may have a band symmetric form, in which case the final estimate had the same from."

>Below is the NONMEM record for this,

> assuming that ETA(1) describes the variance on V, ETA(2) on CL and ETA(3) on

> KA.

>

> $OMEGA BLOCK(3)

> .1

> .01 .1

> 0 .01 .1

>

> HOW DOES NONMEM KNOW THAT THE OFF-DIAGONAL ELEMENT IS TO BE FIXED TO ZERO?

> I THOUGHT YOU COULDN'T USE THE FIXED OPTION ON INDIVIDUAL ELEMENTS IN A

> BLOCK. DOESN'T NONMEM BALK AT THIS THINKING IT IS A PARAMETER WITH ZERO FOR

> A STARTING VALUE? I THOUGHT ALL ELEMENTS WITHIN A BLOCK MUST BE NON-ZERO.

In NONMEM, my understanding is that coding a BLOCK statement as follows:

$OMEGA BLOCK(3)

.1

0 .1

0 0 .1

effectively fixes the off-diagonal elements to zero. NONMEM is 'smart' enough to know that this is a BAND matrix. This is analagous to writing

$OMEGA .1 .1 .1

which does the same thing - it fixes the off-diagonal elements to zero. Therefore using a zero as an intial estimate in the BLOCK fixes the value, NONMEM will not estimate that element. The assumption that all the associated variance covariance terms are zero is not necessarily appropriate, and has been a source of discussion on several previous occasions in this forum.

As to using the FIX option on individual elements in the BLOCK - you are quite correct in this. A statement such as the following FIXES all the records within the BLOCK:

$OMEGA BLOCK(3)

.1

.01 .1

.01 .01 .1 FIX

However, using the BAND approach, you can selectively FIX elements to zero.

> However, the elements in the BAND matrix

> must, of course, be symmetrical. Therefore a BAND matrix of

>

> $OMEGA BLOCK(3)

> .1

> .01 .1

> 0 0 .1

>

> will produce an error from NONMEM.

>

> ACTUALLY THE ABOVE OMEGA BLOCK IS STILL SYMMETRICAL SO I'M NOT SURE WHY THIS

> EXAMPLE SHOULD BOMB BUT NOT THE FIRST EXAMPLE WITH ONLY ONE OFF-DIAGONAL SET

> TO ZERO.

Sorry all - I apologize for not describing this more concisely. Perhaps it is more clear to say that the lower triangular elements have been set to zero. To extend the example that I gave previously into a 4x4 BLOCK:

$OMEGA BLOCK(4)

.1

.01 .1

0 .01 .1

0 0 .01 .1

would run successfully. I think that it would be good to just try this out and experiment a bit.

> $OMEGA BLOCK(2)

> .1

> .01 .1

> $OMEGA .1

>

> YES, THIS IS STANDARD BLOCKING OF AN OMEGA MATRIX (IE., ELEMENTS BETWEEN

> BLOCKS ARE UNCORRELATED BUT ELEMENTS WITHIN A BLOCK ARE CORRELATED).

Yes, exactly.

> I have found the use of the BAND matrix to be quite useful at times,

> particularly if the model is to be used later for simulation work for

> example.

>

> YES, IT IS IMPORTANT TO GIVE AS MUCH ATTENTION TO THE COVARIANCE STRUCTURE

> AS THE FIXED-EFFECTS STRUCTURAL MODEL IF YOU KNOW THE MODEL WILL BE USED FOR

> SIMULATION PURPOSES.

Agreed. Given the fact that models are frequently built and then later used for simulation work, I am beginning to wonder too if we should distinguish between a simulation model and a descriptive one.

============================================================================

As a separate note to the other NMUSERS, Leonid Gibiansky wrote in with another way to handle this aspect:

I used to express the off-diagonal elements in terms of the THETA parameters, keeping the OMEGA matrix diagonal and FIXED to 1, something like

MYETA1 = THETA(1)*ETA(1)

MYETA2 = THETA(2)*ETA(2)+THETA(3)*ETA(1)

MYETA3 = THETA(4)*ETA(3)+THETA(5)*ETA(2)+THETA(6)*ETA(1)

$OMEGA BLOCK(3) FIXED

10

0 10

0 0 10

Then you can control correlation, and OMEGA elements are expressed in terms of

THETA(1)-THETA(6)

Alternatively, you may introduce THETAs so that they are equal to OMEGA elements, and re-express coefficients in the expressions for MYETAs. Yet another alternative is to introduce THETAs as diagonal elements of OMEGA and correlation coefficients. However, for high dimension of OMEGA matrix this is not feasible, and the representation above is the only way to control correlation that I know.

==============================================================

Best Regards

Diane

*****

From: "KOWALSKI, KENNETH G. [PHR/1825]" <kenneth.g.kowalski@pharmacia.com>

Subject: RE: Rounding errors

Date: Fri, 23 Mar 2001 16:32:48 -0600

Diane, Bill, ALL

Thanks. OK now I understand.

In Diane's examples,

> $OMEGA BLOCK(3)

> ..1

> ..01 .1

> 0 .01 .1

>

> No further coding is necessary. However, the elements in the BAND matrix

> must, of course, be symmetrical. Therefore a BAND matrix of

>

> $OMEGA BLOCK(3)

> ..1

> ..01 .1

> 0 0 .1

both of the omega blocks represent symmetrical matrices but only the first example is BAND-symmetric. Band symmetric implies that all elements on a diagonal must be the same. I'm not sure how valuable this is. How often are we in a situation say where we want to assume that the variances for ka, V and CL are the same and that the covariance between ka and V is the same as the covariance between V and CL?

Band-symmetric matrices may indeed reduce the dimensionality of omega so as to get rid of the overparameterization problem but I really wonder how often such matrices lead to the most parsimonious form for omega? I could envision cases where a full unstructured matrix may be overparameterized and fitting a diagonal omega converges and leads to a lower objective function than a band-symmetric matrix. Perhaps because the diagonal omega allows for different values on the diagonal that the band-symmetric matrix does not. Even if the full unstructured matrix is giving some indication that certain etas should be correlated, forcing the variances to be the same using the band-symmetric form may be worse (increase in ELS) relative to forcing all the covariances to be zero in a diagonal matrix.

Ken

-----Original Message-----

From: Bachman, William [mailto:bachmanw@globomax.com]

Sent: Friday, March 23, 2001 3:50 PM

To: Gibiansky, Leonid; KOWALSKI, KENNETH G. [PHR/1825]; 'diane r mould'

Cc: Gibiansky, Ekaterina

Subject: RE: Termination due to rounding errors

The only reference I have been able to find is in NONMEM V Supplemental Guide, p.1:

"2. Band Symmetric Matrices

An intial estimate of a diagonal block of either the OMEGA or SIGMA matrices may have a band symmetric form, in which case the final estimate had the same from."

Bill

-----Original Message-----

From: Gibiansky, Leonid

Sent: Friday, March 23, 2001 4:38 PM

To: 'KOWALSKI, KENNETH G. [PHR/1825]'; 'diane r mould'; Gibiansky, Leonid

Cc: Gibiansky, Ekaterina; Bachman, William

Subject: RE: Termination due to rounding errors

Katya tried it in our NONMEM V, and it worked exactly as Diane described Leonid

-----Original Message-----

From: KOWALSKI, KENNETH G. [PHR/1825]

[mailto:kenneth.g.kowalski@pharmacia.com]

Sent: Friday, March 23, 2001 4:36 PM

To: 'diane r mould'; Gibiansky, Leonid

Cc: Gibiansky, Ekaterina; Bachman, William

Subject: RE: Termination due to rounding errors

Diane,

Can you point to me where in the documentation in NONMEM V that allows banding...I can't seem to find it. Are you sure its not a feature of NONMEM VI which hasn't been released yet?

Thanks,

Ken

-----Original Message-----

From: diane r mould [mailto:drmould@attglobal.net]

Sent: Friday, March 23, 2001 2:44 PM

To: Gibiansky, Leonid

Cc: Gibiansky, Ekaterina; KOWALSKI, KENNETH G. [PHR/1825]; Bachman, William

Subject: Re: Termination due to rounding errors

Dear Leonid

Hi. Yes, I seem to recall seeing the documentation to BAND somewhere in the NONMEM manual, but when I looked for it just before my reply to NMUSERS, I could not find reference to it. Perhaps it was my imagination? I only learned about this feature recently and so can not say if it was available in NONMEM IV. It is certainly available in NONMEM V, however.

Yes, the construction of the BLOCK statement tells NONMEM whether or not you are using a BAND matrix. Your interpretation below is entirely correct. No fancy coding is required, although, as Tom Ludden has suggested, 'sometimes appropriate manipulation of the elements of the variance-covariance matrix are required'. I am not sure if he was specifically referring to this aspect of NONMEM or not but the idea was certainly apt.

Are you thinking of trying out BAND matricies? I have been very interested in learning more about other users experiences with trying to describe variance covariance terms. Some NONMEM users are strongly against describing this information, others feel strongly that it should be included. BAND matricies offer a useful alternative to those who wish to keep this information but find some elements poorly identifiable.

Best Regards

Diane

----- Original Message -----

From: "Gibiansky, Leonid" <gibianskyl@globomax.com>

To: "'diane r mould'" <drmould@attglobal.net>

Cc: "Gibiansky, Ekaterina" <gibianskye@globomax.com>; <kenneth.g.kowalski@pharmacia.com>; "Bachman, William" <bachmanw@globomax.com>

Sent: Friday, March 23, 2001 3:15 PM

Subject: RE: Termination due to rounding errors

> Dear Diane,

>

> Is this BAND feature documented somewhere ? Is it NONMEM VI feature

> unavailable in NONMEM V ? From what you wrote I understood that the initial

> values of OMEGA are somehow interpreted to create the OMEGA-BAND matrix ? Am

> I understood you correctly that:

>

> $OMEGA BLOCK(4)

> 10

> 1 10

> 1 1 10

> 1 1 1 10

>

> is interpreted as full 4 by 4 matrix;

>

> $OMEGA BLOCK(4)

> 10

> 1 10

> 1 1 10

> 0 1 1 10

>

> will keep (4,1)=(1,4) element equal to zero;

>

> $OMEGA BLOCK(4)

> 10

> 1 10

> 0 1 10

> 0 0 1 10

>

> will keep (4,1)=(1,4)= (3,1)=(1,3)=(2,4)=(4,2) elements equal to zero;

>

> $OMEGA BLOCK(4)

> 10

> 1 10

> 0 1 10

> 0 0 0 10

>

> will give an error that the matrix is not in the BAND form ?

>

>

> Thank you for your insight,

> Leonid

>

*****

From: "KOWALSKI, KENNETH G. [PHR/1825]" <kenneth.g.kowalski@pharmacia.com>

Subject: RE: Rounding errors

Date: Fri, 23 Mar 2001 16:47:08 -0600

Leonid, ALL,

Thanks! Hopefully, future documentation in NONMEM will clearly define what is meant by band symmetric. I guess Diane's choice of examples mislead me. So, I take it that

$OMEGA BLOCK(3)

.1

.01 .2

0 .02 .3

would also be admissable.

Ken

-----Original Message-----

From: Gibiansky, Leonid [mailto:gibianskyl@globomax.com]

Sent: Friday, March 23, 2001 4:38 PM

To: KOWALSKI, KENNETH G. [PHR/1825]

Subject: RE: Termination due to rounding errors

No, band symmetric does not mean that the elements are equal. This means that they all are not equal to zero.

$OMEGA BLOCK(3)

.1

.01 .1

0 .02 .1

is admissible

but

$OMEGA BLOCK(3)

.1

.01 .1

0 .0 .1

is not

Leonid

*****

From: "diane r mould" <drmould@attglobal.net>

Subject: Re: Rounding errors

Date: Fri, 23 Mar 2001 19:06:01 -0500

Dear Ken et al

Yes, your example of a band matrix in your email below should run just fine. The big issue is how you handle those elements that are being set to zero. I probably should have given other examples in my description but didnt think of it.

Best Regards

Diane