Closed mattfidler closed 5 years ago
Hi @billdenney
This is to collect my thoughts as well as to explain the current state of things in nlmixr. Since you requested it I am tagging you.
I could see where standard errors or variances on covariances/correlations would be useful because:
omega
s.Currently as it stands:
nlme
does not calculate standard errors on covariance termssaem
calculates some standard errors on covariance terms while optimizing, but these are not always accurate.focei
and family skips calculation of standard errors on covariance terms.For focei
calculation of standard errors could be turned on, however:
nlmixr
's focei does not estimate omega
covariance, but a more stable transformation with two steps:
chol(solve(omega))
and diag(chol(solve(omega))) =
some transformation (by default x^2
or sqrt
). omega
matrix is always symmetric positive definiteomega
would not make it to a report and care would have to be taken when simulating from these parameters to back-transform to the correct scaleThis details sampling from the uncertainty in the parameter estimates themselves.
In this approach a multivariate normal is used to simulate the variance and covariance components that are estimated. Even with the transformations discussed in the FOCEi section, the co-variance could be calculated from the simulations and simulated from for each "study".
Advantages
Disadvantages
This is the approach that stan
advocates.
In this approach a multivariate normal is used to simulate the fixed effect variance components that are estimated. Once the variance components are simulated, the correlation is simulated by the LKJ distribution and the covariance is constructed from the caluclated pieces.
Advantages
eta
; I could name it for clarity etaLKJ
LKJ
prior simulation is more efficient than the inverse wishart prior simulation.Disadvantages
etaLKJ
is not specified or calculated by the model or literature; the modeler would have to choose a value from 1
(approx uniform from -1 to 1 for the correlations) to Inf
(correlations are zero), which is arbitrary.Some of these objections can be overcome by using the inverse wishart to simulate the correlation matrix instead of the LKJ
distribution. Then:
But it is slower than the LKJ
distribution.
This is the approach that RxODE currently uses.
Advantages:
Already implemented
Allows correlation structure to be specified by estimated covariance matrix
Allows off-diagonal simulations for covariances that may exist but were not observed in the data
The degrees of freedom can be easily calculated from the data estimated and the covariance matrix being estimated.
Disadvantages:*
Variability is specified only by one parameter: the degrees of freedom
These include (and are discussed here)
If I implement standard errors on the covariance matrix, then a simulation strategy could be:
LJK
or simulated inverse wishart correlation matrixHowever it is simpler to explain and simply use inverse wishart, so perhaps that could also be an option for simulation.
One other note, the etaLJK
parameter can be related to degrees of freedom see: https://arxiv.org/pdf/1809.04746.pdf
alpha_{d-1} = (nu - d +1)/2 = etaLJK + (d -2)/2
etaLJK = (nu-d+1)/2 - (d-2)/2 = (nu-1)/2
Which also implies you need at least nu=3
degrees of freedom.
WOW! Thank you for the details here. They are eye-opening (and very well described).
I can't claim to have an understanding of what the best method is, but your summary gives a lot of thought to items to consider. I do maintain the desire to simulate with parameter uncertainty, but I now feel like we as a discipline are often doing that wrong (when we do it) for the omega
matrix.
I agree; before working on this nlmixr
project I never considered the omega
matrix simulation in this detail. @wwang-at-github is the one who told me about the inverse wishart in the first place.
Overall I think the inverse wishart is the most flexible since it can handle modeled covariance terms and is the default for RxODE simulations.
If that is a good way to simulate covariances, the SE terms become unneeded parameters (except for possibly diagnosing model problems). If you use SEs in prior distribution via one of the above methods, SEs on covariance terms may not be needed (although because of the parameterization, the covariance terms could affect the variance terms so I have to think carefully about excluding them...)
The following publication seems to support when covariances are modeled it is reasonable to use an inverse wishart, though the separation strategy is preferred otherwise
This publication shows a way to simulate a full covariance prior but would require a mixture model through mcmc fitting, so I think it is too much:
Here is my current thinking:
nlme
and saem
methods of calculating covarinace do not calculate standard error on covariance parametersfocei
can be forced to calculate the standard errors, but since they may not be multivariate normal this could be one of the biggest reasons why a covariance step fails. I'm not sure I want to add that instability in the covariance matrix step
SAEM
and nlme
and I cannot add it with the current methodologiesfocei
which has standard errors on covariance parameters, and using inverse wishart on all other approachesWith all that in mind, I am thinking not adding SEs on estimated covariance/standard deviation components for now.
However, the simulation methodologies now exist in the development branch of RxODE
.
That makes perfectly good sense, and thank you for the thoughtful and detailed discussion.
See Issue #243 for discussion.