if (FALSE) {
model_analytic_function=function(x){
observation_time=c(0.1,0.2,0.4,0.6,1,2,3,6,12)
Dose=1000
F=1
ka=10^x[1]
V1=10^x[2]
CL_2=10^x[3]
t=observation_time
Cp=ka*F*Dose/(V1*(ka-CL_2/V1))*(exp(-CL_2/V1*t)-exp(-ka*t))
log10(Cp)
}
observation=log10(c(4.91, 8.65, 12.4, 18.7, 24.3, 24.5, 18.4, 4.66, 0.238))
CGNM_result=Cluster_Gauss_Newton_method(
nonlinearFunction=model_analytic_function,
targetVector = observation,
initial_lowerRange = c(-1,-1,-1), initial_upperRange = c(1,1,1),
num_iter = 10, num_minimizersToFind = 500, saveLog=TRUE)
## the minimum example
plot_2DprofileLikelihood("CGNM_log")
## we can draw profilelikelihood also including bootstrap result
CGNM_result=Cluster_Gauss_Newton_Bootstrap_method(CGNM_result,
nonlinearFunction = model_analytic_function)
## example with various options
plot_2DprofileLikelihood(c("CGNM_log","CGNM_log_bootstrap"),
showInitialRange = TRUE,index_x = c("ka","V1"))
}
Run the code above in your browser using DataLab