This function runs a simulation of a compartment model using a set of ordinary differential equations. The model describes a simple viral infection system.
simulate_fit_confint(U = 1e+05, I = 0, V = 10, n = 0, dU = 0,
dI = 2, p = 0.01, g = 0, b = 0.01, blow = 1e-06,
bhigh = 1000, dV = 2, dVlow = 0.001, dVhigh = 1000, iter = 20,
nsample = 10, rngseed = 100, parscale = "lin")
: initial number of uninfected target cells : numeric
: initial number of infected target cells : numeric
: initial number of infectious virions : numeric
: rate of uninfected cell production : numeric
: rate at which uninfected cells die : numeric
: rate at which infected cells die : numeric
: rate at which infected cells produce virus : numeric
: unit conversion factor : numeric
: rate at which virus infects cells : numeric
: lower bound for infection rate : numeric
: upper bound for infection rate : numeric
: rate at which infectious virus is cleared : numeric
: lower bound for virus clearance rate : numeric
: upper bound for virus clearance rate : numeric
: max number of steps to be taken by optimizer : numeric
: number of samples for conf int determination : numeric
: seed for random number generator to allow reproducibility : numeric
: 'lin' or 'log' to fit parameters in linear or log space : character
The function returns a list containing the best fit time series, the best fit parameters for the data, the final SSR, and the bootstrapped confidence intervals.
This function does not perform any error checking. So if you try to do something nonsensical (e.g. specify negative parameter or starting values), the code will likely abort with an error message.
A simple compartmental ODE model mimicking acute viral infection is fitted to data. Data can either be real or created by running the model with known parameters and using the simulated data to determine if the model parameters can be identified. This code is part of the DSAIRM R package. For additional model details, see the corresponding app in the DSAIRM package.
# NOT RUN {
# To run the code with default parameters just call the function:
# }
# NOT RUN {
result <- simulate_fit_confint()
# }
# NOT RUN {
# To apply different settings, provide them to the simulator function, like such:
result <- simulate_fit_confint(iter = 5, nsample = 5)
# }
Run the code above in your browser using DataLab