Description Usage Arguments Value
View source: R/generate_logistic_data.R
Generate Example Logistic Growth Time-Series Data
1 2 3 4 5 6 7 8 9 10 | generate_logistic_data(
P0,
K = 1,
r,
max_t,
time_step,
noise = 0,
method = "analytic",
make_plot = FALSE
)
|
P0 |
Positive numeric; the initial population value. |
K |
Positive numeric; the carrying capacity. Defaults to 1, which is the value to use if the model is dimensionless/relative. |
r |
Positive numeric; the intrinsic population growth rate. |
max_t |
Positive numeric; the maximum time step at which to evaluate the model (note that the minimum time step is always 0). |
time_step |
Positive numeric; the size of steps to take between each evaluation of the model. The vector of times will be generated as a sequence from 0 to max_t in step-size of this parameter. |
noise |
Positive numeric; the amount of noise to add to the data, as a proportion of the equilibrium value. E.g. setting this to some "s" will add a normal random vector of noise to the data where all entries are drawn from the normal distribution with mean 0 and sd s*K. If you have an sd that you want to add manually, you will have to do the algebra to get it as a proportion of K. |
method |
Character; chosen from "analytic" ("a"), "discretized" ("d"), or "RK4" ("r"), which determines which method to use to generate the data. |
make_plot |
Logical; if true, the function will generate a plot of the generated time series for you. |
a data frame with columns "t", the time values at which the model was evaluated, and "P", the population size at each time step.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.