
Last chance! 50% off unlimited learning
Sale ends in
The deSolve
package uses timeseries as forcing functions. In lieu of hard-
coding time evolution of parameters into a model, these timeseries may be used
to change the value of parameters in time. The function get_input_parm_timeseries
queries a virutal population and non-parametrically produces timeseries that
preserve the percentile score of the given starting values.
get_input_param_timeseries(
model,
chem.cas = NULL,
chem.name = NULL,
dtxsid = NULL,
initial.params = NULL,
initial.percentiles = NULL,
start.age = 360,
days = 10,
gender = c("Male", "Female"),
weight_category = c("Underweight", "Normal", "Overweight", "Obese"),
gfr_category = c("Normal", "Kidney Disease", "Kidney Failure"),
reths = c("Mexican American", "Other Hispanic", "Non-Hispanic White",
"Non-Hispanic Black", "Other"),
bandwidth = 12,
get.median.param.vals = FALSE,
input.param.dir = NULL
)
A list of two-column matrices indexed by names of compiled parameters for the designated model. The first column contains a list of times (in days) and the second the total change in that parameter from the initial value.
The name of a model which can accept timeseries as forcing functions.
Chemical Abstract Services Registry Number (CAS-RN) -- the chemical must be identified by either CAS, name, or DTXISD
Chemical name (spaces and capitalization ignored) -- the chemical must be identified by either CAS, name, or DTXISD
EPA's 'DSSTox Structure ID (https://comptox.epa.gov/dashboard) -- the chemical must be identified by either CAS, name, or DTXSIDs
The values for each parameter at the beginning of the simulation.
All compiled parameters should be present. The output of the parameterize_<model>
function is appropriate for initial.params
.
If initial.params
are not provided, initial.percentiles
will designate a starting value for each parameter according to the corresponding
percentile within the NHANES population. Values should be between zero and one. If
neither initial.params
nor initial.percentiles
are provided, the initial
value for the parameter is taken to be the median of the population value.
The age in months of the individual at the beginning of the simulation. Used for determining the percentile score of the initial parameter values when producing the timeseries determining parameter changes.
The length of the simulation in days. Equivalent to the days
parameter in solve_model
.
The next four parameters play the same role here as in httkpop_generate
:
the user may restrict the data available to the non-parametric regression by
specifying demographics.
Optional: The gender categories to include in the popualtion;
default c("Female", "Male")
.
Optional: The weight categories to include in the
population. Default is c('Underweight', 'Normal', 'Overweight',
'Obese')
. User-supplied vector must contain one or more of these strings.
The kidney function categories to include in the
population. Default is c('Normal','Kidney Disease', 'Kidney
Failure')
to include all kidney function levels.
Optional: a character vector giving the races/ethnicities to
include in the population. Default is c('Mexican American','Other
Hispanic','Non-Hispanic White','Non-Hispanic Black','Other')
, to include
all races and ethnicities in their proportions in the NHANES data.
User-supplied vector must contain one or more of these strings.
Dictates the length of time centered around the present to use when calculating non-parametric regressions.
Return, instead of the timeseries, the median values for the dynamic model parameters at the given start age.
The path to the input_params_data_files
directory,
which is used to store all input_param
data files. If input_params_data_files
does not exist, this function will create it in the specified path. Default NULL
,
in which case the present working directory is used as default.
Colin Thomson
For each time-dependent model, there should be a function (such as gen_input_params
)
that determines the model parameter values for each individual in the NHANES dataset.
The resulting value are used to form the non-parametric regression curve.
solve_pbtk_lifestage
gen_input_params
# \donttest{
params <- parameterize_pbtk(chem.name = 'Bisphenol A')
ts <- get_input_param_timeseries("pbtk_lifestage",
chem.name = 'Bisphenol A',
initial.params = params,
start.age = 600, # age fifty
days = 365,
weight_category=c('Underweight',
'Normal',
'Overweight'))
# }
Run the code above in your browser using DataLab