fisher_evaluation is used to evaluate the Fisher information matrix for both continuous and discrete data in nonlinear mixed effect models using Markov Chains Monte Carlo.
fisher_evaluation(t, y_ini=1, model, model2, model3, params, dim_b,
set_seed=TRUE, seed=42, n_samp, n_rep=1, n_iter, n_burn, CV=FALSE,
plot_graph=0, L_boot=1000, nb_patients=1)Vector of sampling times (or doses).
A possible value for the response y to initialize the MCMC process. The default value is set at 1 (which works for many types of outcomes: continuous, binary, ...).
Compiled STAN model describing the response model to sample in the conditionnal distribution of b given y.
Compiled STAN model describing the response model for calculating the derivative of the log-likelihood with respoect to each parameter.
Compiled STAN model describing the response model to sample in the marginal distribution of the response y.
Vector of parameters given as follows: fixed effetcs, variances of the random effets, standard deviations of the residual errors (if continuous data).
Number of random effects.
Boolean indicating if the seed shoud be fixed. The default value is set at TRUE.
Integer for the fixed seed. Used only if set_seed is TRUE. The default value is set at 42.
Integer representing the number of Monte Carlo (MC) samples, (i.e. number of samples for the outcome y).
Integer representing the number of repeated measures at the same time (or dose) for each patient. The default value is set at 1 (for continuous data).
Integer representing the number of Markov Chains Monte Carlo (MCMC) samples.
Integer representing the number of burn-in samples for MCMC.
Boolean indicating if some convergence information (variance of the determinant, mean of b, mean log-likelihood, ...) should be returned. The default value is set at FALSE.
An integer with value 0 (no graph should be plotted), 1 (graph of the determinant of the FIM), 2 (graph of the determinant of the FIM with confidence intervals assuming normal distribution), 3 (graph of the determinant of the FIM with bootstrap confidence intervals) or 4 (graph of the determinant of the FIM with both bootstrap confidence intervals and confidence intervals assuming normal distribution). The default value is set at 0.
Number of samples for bootstrap estimation of the confidence intervals of the normalized determinant of the FIM. This argument is used/required only if plot_graph = 3 or 4. The default value is set at 1000.
Number of patients with the same elementary design for which the FIM is evaluated. The default value is set at 1.
An list is returned, composed of the following variables:
Expected Fisher information matrix (FIM). Of note, the FIM is an individual FIM and is calculated for nb_patients patients.
Variance-covariance matrix of the FIM. (Of note, its dimension is of size 4 as the FIM is in dimension 2.)
Inverse of the FIM.
Relative standard errors (square root of the diagonal elements of the inverse of the FIM).
Vector containing the lower bound of the bootstrap confidence interval of the RSEs.
Vector containing the upper bound of the bootstrap confidence interval of the RSEs.
Normalized determinant of the FIM.
Vector containing the lower and upper bound of the confidence interval of the normalized determinant of the FIM assuming normal distribution.
Vector containing the lower and upper bound of the bootstrap confidence interval of the normalized determinant of the FIM.
Mean of the partial derivatives of the log-likelihood according to the first MCMC sample and MC sample. Should be equal approximately to 0.
Mean of the partial derivatives of the log-likelihood according to the second MCMC sample and MC sample. Should be equal approximately to 0.
Variance of the partial derivatives of the log-likelihood according to the first MCMC sample and MC sample.
Variance of the partial derivatives of the log-likelihood according to the second MCMC sample and MC sample.
Mean of the samples in the conditionnal distribution of b given y. Should be equal approximately to 0.
Vector containing for each value sampled of the response y, the estimation of the integral of the partial derivatives of the log-likelihood over the random effects according to the first MCMC sample of the random effects b given y.
Vector containing for each value sampled of the response y, the estimation of the integral of the partial derivatives of the log-likelihood over the random effects according to the second MCMC sample of the random effects b given y.
In addition, plot_graph enables to plot a graph of the normalized determinant of the FIM with normal and bootstrap confidence intervals in function of the number of MC samples.
Riviere, M-K., Ueckert, S. and Mentre, F,. Evaluation of the Fisher information matrix in nonlinear mixed effect models using Markov Chains Monte Carlo.
# NOT RUN {
############################
# PLEASE UNCOMMENT EXAMPLE #
############################
#times = c(0.5,1,2,6,24,36,72,120)
#params = c(1,8,0.15,0.6,0.02,0.07,0.1)
# Files cen be found in external data
#model = stan_model("model_b_given_y.stan")
#model2 = stan_model("model_derivatives.stan")
#model3 = stan_model("model_y.stan")
#model_Warfarin = fisher_evaluation(t=times, y_ini=0.5, model=model,
#model2=model2, model3=model3, params=params, dim_b=3, set_seed=TRUE, seed=42,
#n_samp=1000, n_rep=1, n_iter=200, n_burn=500, CV=TRUE, plot_graph=4,
#nb_patients=32)
#model_Warfarin
# }
Run the code above in your browser using DataLab