R/simulate_fludrug_fit.R
simulate_fludrug_fit.Rd
This function fits the simulate_virusandtx_ode model, which is a compartment model using a set of ordinary differential equations. The model describes a simple viral infection system in the presence of drug treatment. The user provides initial conditions and parameter values for the system. The function simulates the ODE using an ODE solver from the deSolve package.
simulate_fludrug_fit(
U = 1e+07,
I = 0,
V = 1,
dI = 1,
dV = 2,
b = 0.002,
blow = 0,
bhigh = 100,
p = 0.002,
plow = 0,
phigh = 100,
g = 0,
glow = 0,
ghigh = 100,
k = 0,
fitmodel = 1,
iter = 1
)
: initial number of uninfected target cells : numeric
: initial number of infected target cells : numeric
: initial number of infectious virions : numeric
: rate at which infected cells die : numeric
: rate at which infectious virus is cleared : numeric
: rate at which virus infects cells : numeric
: lower bound for infection rate : numeric
: upper bound for infection rate : numeric
: rate at which infected cells produce virus : numeric
: lower bound for virus production rate : numeric
: upper bound for virus production rate : numeric
: unit conversion factor : numeric
: lower bound for unit conversion factor : numeric
: upper bound for unit conversion factor : numeric
: drug efficacy (between 0-1) : numeric
: fitting model 1 or 2 : numeric
: max number of steps to be taken by optimizer : numeric
The function returns a list containing the best fit timeseries, the best fit parameters, the data and the AICc for the model.
A simple compartmental ODE models describing an acute viral infection with drug treatment mechanism/model 1 assumes that drug treatment reduces rate of new cell infection. mechanism/model 2 assumes that drug treatment reduces rate of new virus production.
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.
See the Shiny app documentation corresponding to this function for more details on this model.
# To run the code with default parameters just call the function:
result <- simulate_fludrug_fit()
# To apply different settings, provide them to the simulator function, like such:
result <- simulate_fludrug_fit(k = 0.5, iter = 5, fitmodel = 2)