| sim.dp.byf2 {bootf2} | R Documentation |
Simulate Dissolution Profiles by f_2 Values
Description
Given any mean dissolution profile dp, this function will simulate a mean
dissolution profile such that when the newly simulated profile is compared
to dp, the calculated f_2 will be equal to the predefined target
f_2 value.
Usage
sim.dp.byf2(tp, dp, target.f2, seed = NULL, min.points = 3L,
regulation = c("EMA", "FDA", "WHO", "Canada", "ANVISA"),
model = c("Weibull", "first-order"), digits = 2L,
max.disso = 100, message = FALSE, both.TR.85 = FALSE,
time.unit = c("min", "h"), plot = TRUE, sim.dp.out,
sim.target = c("ref.pop", "ref.median", "ref.mean"),
model.par.cv = 50, fix.fmax.cv = 0, random.factor = 3)
Arguments
tp, dp |
Numeric vector of time points |
target.f2 |
Numeric value of target |
seed |
Integer seed value for reproducibility. If missing, a random seed will be generated for reproducibility purpose. |
min.points |
An integer indicating the minimum time points to be used
to calculate |
regulation |
Character strings indicating regulatory guidelines.
@seealso |
model |
Character strings of model names. Currently only |
digits |
An integer indicating the decimal points for the output. |
max.disso |
Numeric value for the maximum possible dissolution. In theory, the maximum dissolution is 100%, but in practice, it is not uncommon to see higher values, such as 105%, or much lower values, especially for products with low solubility. |
message |
Logical. If |
both.TR.85 |
Logical. If |
time.unit |
Character strings indicating the unit of time. It should
be either |
plot |
Logical. If |
sim.dp.out |
Output of function |
sim.target |
Character strings indicating to which target profile
should the newly simulated profile be compared for the calculation of
|
model.par.cv, fix.fmax.cv |
Numeric values expressed as percentages
used for random generation of model parameters and fmax when optimization
algorithm is not used, i.e., when |
random.factor |
Numeric value used for random generation of model
parameters when optimization algorithm is used, i.e., when |
Details
The main principle of the function is as follows:
For any given mean dissolution profile
dp, fit a suitable mathematical model and obtain model parameters.No precise fitting is required since those parameters will be served as initial value for further model fitting.
If
sim.dp.out, the output of the functionsim.dp(), is available, no initial fitting is necessary as model parameters can be read directly from the output, unless multivariate normal distribution approach was used insim.dp(). In such case, initial model fitting will be done.
Find a suitable model parameters and simulate a new dissolution profile, comparing the new profile to the provided reference profile
dpby calculatingf_2. If the the obtainedf_2is equal to, or within the lower and upper limit of, thetarget.f2, then the function will output the obtained model parameters and the new profile.
There are two approaches used to find the suitable model parameters:
If
target.f2is a single value, optimization algorithm will be used and the newly simulated dissolution profile will havef_2equal totarget.f2when compared todp(within numeric precision defined by the tolerance).If
target.f2is a vector of two numbers representing the lower and upper limit of targetf_2value, such astarget.f2 = c(lower, upper), then dissolution will be obtained by random searching and the calculatedf_2will be within the range of lower and upper.
For example, you can set target.f2 = c(54.95, 55.04) to have target
f_2 of 55. Since f_2 should be normally reported without
decimal, in practice, this precision is enough. You might be able to do with
c(54.99, 55.01) if you really need more precision. However, the narrower
the range, the longer it takes the function to run. With narrow range such as
c(54.999, 55.001), it is likely the program will fail. In such case,
provide single value to use optimization algorithm.
Arguments model.par.cv, fix.fmax.cv, and random.factor are certain
numeric values used to better control the random generation of model
parameters. The default values should work in most scenarios. Those values
should be changed only when the function failed to return any value. Read
vignette of the function (vignette("sim.dp.byf2", package = "bootf2"))
for more details.
The data frame sim.summary in sim.dp.out, the output of function
sim.dp(), contains dp, the population profile, and sim.mean and
sim.median, the mean and median profiles calculated with n.units of
simulated individual profiles. All these three profiles could be used as the
target profile that the newly simulated profile will be compare to. Argument
sim.target defines which of the three will be used: ref.pop, ref.mean,
and ref.median correspond to dp, sim.mean and sim.median,
respectively.
Value
A list of 2 components: a data frame of model parameters and a
data frame of mean dissolution profile generated using the said model
parameters. The output can be passed to function sim.dp() to further
simulate multiple individual profiles.
Examples
tp <- c(5, 10, 15, 20, 30, 45, 60)
mod.par.r <- list(fmax = 100, fmax.cv = 2, tlag = 0, tlag.cv = 0,
mdt = 25, mdt.cv = 4, beta = 2.1, beta.cv = 3)
d.r <- sim.dp(tp, model.par = mod.par.r, seed = 100, n.units = 120L,
plot = FALSE)
model.par1 <- sim.dp.byf2(sim.dp.out = d.r, target.f2 = 60, seed = 123)
model.par2 <- sim.dp.byf2(sim.dp.out = d.r, target.f2 = c(59.95, 60.04),
seed = 123)