RE: [NMusers] $PRIOR with normal for OMEGA?

2016-11-11 Thread Mats Karlsson
Hi Mark,

As I’m sure you know NONMEM has the TNPRI functionality for that. If you want 
to use it without the TNPRI functionality, you can estimate OMEGA as THETA and 
use a multivariate normal for that. If you have off-diagonal elements, you may 
want to do a Cholesky transformation (you can get that automatically in PsN).

As Andy writes there are pros and cons with different priors. While IW has a 
better shape to its prior for variances, it is problematic that there is no 
correlation between the typical value estimates and their variances.

Best regards,
Mats


Mats Karlsson, PhD
Professor of Pharmacometrics

Dept of Pharmaceutical Biosciences
Faculty of Pharmacy
Uppsala University
Box 591
75124 Uppsala

Phone: +46 18 4714105
Fax + 46 18 4714003
www.farmbio.uu.se/research/researchgroups/pharmacometrics/

From: owner-nmus...@globomaxnm.com [mailto:owner-nmus...@globomaxnm.com] On 
Behalf Of Gewitz, Andrew
Sent: Friday, November 11, 2016 6:53 AM
To: Mark Sale
Cc: nmusers@globomaxnm.com
Subject: Re: [NMusers] $PRIOR with normal for OMEGA?

Mark,

Without getting too technical, recall that the inverse wishart is a 
distribution on matrices, and is naturally conjugate to the multivariate normal 
distribution (i.e. on vectors of random variables.) Generally, this is chosen 
because posterior computations are simplified and it is easy to sample from 
this posterior distribution.

What you're suggesting is the Matrix Normal distribution. Since it is not 
conjugate to the multivariate normal, posterior computations can cause 
headaches. So while it is *possible* to use such a distribution as a prior, it 
is cumbersome to work with in practice and requires thinking about some things 
like correlation and scale in non straightforward ways.




--
Andy Gewitz, PhD
Bioengineering and Therapeutic Sciences
University of California, San Francisco

On Nov 10, 2016, at 7:57 PM, Mark Sale 
mailto:ms...@nuventra.com>> wrote:

Is it possible to use a normal prior for OMEGA? The default is inverse Wishart, 
but I'd be interested in using Normal (insuring that it is positive definite) 
Any ideas?

thanks





Mark Sale M.D.
Vice President, Modeling and Simulation
Nuventra Pharma Sciences, Inc.
2525 Meridian Parkway, Suite 280
Durham, NC 27713
Phone (919)-973-0383
ms...@nuventra.com
CONFIDENTIALITY NOTICE The information in this transmittal (including 
attachments, if any) may be privileged and confidential and is intended only 
for the recipient(s) listed above. Any review, use, disclosure, distribution or 
copying of this transmittal, in any form, is prohibited except by or on behalf 
of the intended recipient(s). If you have received this transmittal in error, 
please notify me immediately by reply email and destroy all copies of the 
transmittal.




Re: [NMusers] $PRIOR with normal for OMEGA?

2016-11-11 Thread Jakob Ribbing
Hi Mark,

Indeed there is: As an alternative to NWPRI, there is the TNPRI subroutine that 
you can use with $PRIOR (frequentist prior).
This functionality is tripple normal, with regards to thetas, omegas and 
sigma(s).
I will describe this more in detail than Mark would need (hopefully for the 
benefit of others).

I used to think that TNPRI was an appealing alternative when the standard error 
of population parmeters were all modest. The implementation appears to be 
appealing at a first glance (less error prone): Simply plug in the MSFO file 
from a previous run (generating the prior), as a prior representing the 
covariance matrix from that previous run.
In addition, if from that previous run one has reported SEs based on the 
covariance matrix, it may be appealing to use the same distribution when 
simulating with uncertainty in population parameters (what I call simulation 
mode, below), or as a prior in the next analysis with a new analysis data set 
(what I call estimation mode, below).
However, over the years I have been using it less and less due to various 
limitations and “features”.
I am not sure if Marks question was with regards to estimation with support of 
a prior (estimation mode), or simulation with uncertainty in population 
parameters based on a prior distribution (simulation mode), but separate the 
list of bugs/features/limitations we have come across, below.
Some of these features are documented, whereas others I believe are not.

In estimation mode (using TNPRI) there are only a few limitations that comes to 
my mind:
Any thetas that are fixed must appear as the last thetas in your model (already 
when generating the prior)
When generating the prior, do not use the UNCONDITIONAL option for the 
covariance step. Even in cases where the estimation is successful (so that the 
UNCONDITIONAL option is not needed), the subsequent estimation with TNPRI will 
fail (If I recall correctly, it will run forever).
If you use PsN: TNPRI is not supported by all programs, in particular, you can 
not use scm. Some may raise their eyebrows, thinking that the prior does not 
allow testing for (new) covariates, so I will adress that comment right away. 
With a new patient population at hand, you may want to use scm to test whether 
there is a significant difference in any of the population parameters, as 
compared to the prior (prior not including the new patient population).

In simulation mode (using TNPRI) there are additional limitations that I would 
tend to call bugs, and I will only mention a few:
From the TABLE output you can use IPRED (and the distribution of population 
parameters), but other PRED defined variables can not be trusted, including 
PRED itself: so any clever calculations you may do in your control stream (e.g. 
change from baseline): Do not use it! The output may have been generated based 
on the initial estimates (i.e. prior mode, despite TRUE=PRIOR), rather than 
based on the simulations that include uncertainty in population parameters
Limitations on which parameters needs to be fixed is even greater. If I 
remember correctly, the whole model must be re-formulated in case you have any 
terminal thetas: SIGMAs and OMEGAs must then also be fixed (to 1), and 
magnitudes estimated as fixed effects (representing e.g. standard error of IIV, 
or the covariance) - these additional thetas must then also appear before the 
fixed thetas. But this is when generating the prior (in estimation mode, before 
the subsequent simulation). Possibly, when using the prior in simulation mode, 
then all previously fixed thetas must be unfixed again.
When generating the prior, do not use the UNCONDITIONAL option for the 
covariance step. Even in cases where the estimation is successful (so that the 
UNCONDITIONAL option is not needed), the subsequent simulation step will fail 
(If I recall correctly, it will run forever).

At Pharmetheus, we have not used TNPRI widely and tend to use it less and less 
(favouring NWPRI), and we have never had the time to fully characterise these 
bug/features: as soon as we have concluded it works for the task at hand, we 
leave it without further exploring situations where TNPRI may provide an 
unexpected/erroneous output.
Consequently, you may find my bug/feature description above a bit unclear. I do 
not know exactly what situations trigger these bugs, and I could list 
additional vague descriptions of bugs/features we have come across, if I look 
back into previous projects. But I think if I do that it would raise more 
questions than it answers...
However, this discussion is mainly on simulations, and maybe missess out 
entirely on Marks question? Hopefully, someone will find it useful, still.

Finally, back more towards Marks question, if SE is large in the sense that the 
normal (uncertainty) distribution would go outside the boundaries (e.g. 
OMEGA<0), for any population parameter (fixed and random), then there is 
functionality to handle this.
I have never 

RE: [NMusers] $PRIOR with normal for OMEGA?

2016-11-11 Thread Åstrand , Magnus
Hi
To add on Martin’s suggestion, one item to think of when using theta for 
estimating the variances of eta is to use log scaled STD as your model 
parameter, so instead of THETA*ETA (with OMEGA fixed) use exp(THETA)*ETA.
This way you would assume a log-normal prior for the standard deviation of ETA 
which is more reasonable.
Moreover the log-normal is quite close to the gamma distribution which I 
believe is the (univariate) distribution of diagonal elements of the inverse 
Wishart.

Kind Regards

Magnus Åstrand
Principal Clinical Pharmacometrician, Ph.D.
_

AstraZeneca
Innovative Medicines | Quantitative Clinical Pharmacology
SE-431 83 Mölndal, Sweden
T: +46 (0)31 776 23 41
Mob: +46 (0)708 467 667
magnus.astr...@astrazeneca.com

Please consider the environment before printing this e-mail




From: owner-nmus...@globomaxnm.com [mailto:owner-nmus...@globomaxnm.com] On 
Behalf Of Martin Bergstrand
Sent: den 11 november 2016 08:32
To: Mark Sale 
Cc: nmusers@globomaxnm.com
Subject: Re: [NMusers] $PRIOR with normal for OMEGA?

Hi Mark,

Not sure about this but how about estimating THETAS scaling fix OMEGAs (e.g. CL 
= THETA(1)*EXP(THETA(2)*ETA(1)) ; $OMEGA 1 fix)? Then you can implement the 
prior in the same way for random effect parameters as you do for fixed effect 
parameters.

Ps. Probably not be compatible with MU-parameterization.

Best regards,

Martin Bergstrand, Ph.D.
Senior Consultant
Pharmetheus AB

+46(0)709 994 396
martin.bergstr...@pharmetheus.com
www.pharmetheus.com

+46(0)18 513 328
U-A Science Park, Dag Hammarskjölds v. 52b
752 37 Uppsala, Sweden

Skickat från min iPhone
11 nov. 2016 kl. 04:57 skrev Mark Sale 
mailto:ms...@nuventra.com>>:

Is it possible to use a normal prior for OMEGA? The default is inverse Wishart, 
but I'd be interested in using Normal (insuring that it is positive definite) 
Any ideas?

thanks





Mark Sale M.D.
Vice President, Modeling and Simulation
Nuventra Pharma Sciences, Inc.
2525 Meridian Parkway, Suite 280
Durham, NC 27713
Phone (919)-973-0383
ms...@nuventra.com
CONFIDENTIALITY NOTICE The information in this transmittal (including 
attachments, if any) may be privileged and confidential and is intended only 
for the recipient(s) listed above. Any review, use, disclosure, distribution or 
copying of this transmittal, in any form, is prohibited except by or on behalf 
of the intended recipient(s). If you have received this transmittal in error, 
please notify me immediately by reply email and destroy all copies of the 
transmittal.




Confidentiality Notice: This message is private and may contain confidential 
and proprietary information. If you have received this message in error, please 
notify us and remove it from your system and note that you must not copy, 
distribute or take any action in reliance on it. Any unauthorized use or 
disclosure of the contents of this message is not permitted and may be unlawful.


Re: [NMusers] $PRIOR with normal for OMEGA?

2016-11-11 Thread Mark Sale
thanks Mats,

  I've never had much luck getting TNPRI to work, pretty limited examples in 
the docs. I actually not not want to run NONMEM with normal OMEGA PRIOR, just 
want to validate some other work where I calculate the PRIOR penalty from a 
normal, and thought this might be a practical way to do it.

I'll look into the TNPRI (didn't realize that stood for triple normal, but that 
makes sense).


thanks

Mark



Mark Sale M.D.
Vice President, Modeling and Simulation
Nuventra Pharma Sciences, Inc.
2525 Meridian Parkway, Suite 280
Durham, NC 27713
Phone (919)-973-0383
ms...@nuventra.com
CONFIDENTIALITY NOTICE The information in this transmittal (including 
attachments, if any) may be privileged and confidential and is intended only 
for the recipient(s) listed above. Any review, use, disclosure, distribution or 
copying of this transmittal, in any form, is prohibited except by or on behalf 
of the intended recipient(s). If you have received this transmittal in error, 
please notify me immediately by reply email and destroy all copies of the 
transmittal.



From: Mats Karlsson 
Sent: Thursday, November 10, 2016 11:36:13 PM
To: Gewitz, Andrew; Mark Sale
Cc: nmusers@globomaxnm.com
Subject: RE: [NMusers] $PRIOR with normal for OMEGA?

Hi Mark,

As I'm sure you know NONMEM has the TNPRI functionality for that. If you want 
to use it without the TNPRI functionality, you can estimate OMEGA as THETA and 
use a multivariate normal for that. If you have off-diagonal elements, you may 
want to do a Cholesky transformation (you can get that automatically in PsN).

As Andy writes there are pros and cons with different priors. While IW has a 
better shape to its prior for variances, it is problematic that there is no 
correlation between the typical value estimates and their variances.

Best regards,
Mats


Mats Karlsson, PhD
Professor of Pharmacometrics

Dept of Pharmaceutical Biosciences
Faculty of Pharmacy
Uppsala University
Box 591
75124 Uppsala

Phone: +46 18 4714105
Fax + 46 18 4714003
www.farmbio.uu.se/research/researchgroups/pharmacometrics/

From: owner-nmus...@globomaxnm.com [mailto:owner-nmus...@globomaxnm.com] On 
Behalf Of Gewitz, Andrew
Sent: Friday, November 11, 2016 6:53 AM
To: Mark Sale
Cc: nmusers@globomaxnm.com
Subject: Re: [NMusers] $PRIOR with normal for OMEGA?

Mark,

Without getting too technical, recall that the inverse wishart is a 
distribution on matrices, and is naturally conjugate to the multivariate normal 
distribution (i.e. on vectors of random variables.) Generally, this is chosen 
because posterior computations are simplified and it is easy to sample from 
this posterior distribution.

What you're suggesting is the Matrix Normal distribution. Since it is not 
conjugate to the multivariate normal, posterior computations can cause 
headaches. So while it is *possible* to use such a distribution as a prior, it 
is cumbersome to work with in practice and requires thinking about some things 
like correlation and scale in non straightforward ways.




--
Andy Gewitz, PhD
Bioengineering and Therapeutic Sciences
University of California, San Francisco

On Nov 10, 2016, at 7:57 PM, Mark Sale 
mailto:ms...@nuventra.com>> wrote:

Is it possible to use a normal prior for OMEGA? The default is inverse Wishart, 
but I'd be interested in using Normal (insuring that it is positive definite) 
Any ideas?

thanks





Mark Sale M.D.
Vice President, Modeling and Simulation
Nuventra Pharma Sciences, Inc.
2525 Meridian Parkway, Suite 280
Durham, NC 27713
Phone (919)-973-0383
ms...@nuventra.com
CONFIDENTIALITY NOTICE The information in this transmittal (including 
attachments, if any) may be privileged and confidential and is intended only 
for the recipient(s) listed above. Any review, use, disclosure, distribution or 
copying of this transmittal, in any form, is prohibited except by or on behalf 
of the intended recipient(s). If you have received this transmittal in error, 
please notify me immediately by reply email and destroy all copies of the 
transmittal.