Simulate conservation project data to develop simulated prioritizations.

ppp_simulate_data(number_species, cost_mean = 100, cost_sd = 5,
  success_min_probability = 0.7, success_max_probability = 0.99,
  funded_min_persistence_probability = 0.5,
  funded_max_persistence_probability = 0.9,
  not_funded_min_persistence_probability = 0.01,
  not_funded_max_persistence_probability = 0.4,
  locked_in_proportion = 0, locked_out_proportion = 0)

Arguments

number_species

numeric number of species.

cost_mean

numeric average cost for the actions. Defaults to 100.

cost_sd

numeric standard deviation in action costs. Defaults to 5.

success_min_probability

numeric minimum probability of the projects succeeding if they are funded. Defaults to 0.7.

success_max_probability

numeric maximum probability of the projects succeeding if they are funded. Defaults to 0.99.

funded_min_persistence_probability

numeric minimum probability of the species persisting if their projects are funded and successful. Defaults to 0.5.

funded_max_persistence_probability

numeric maximum probability of the species persisting if their projects are funded and successful. Defaults to 0.9.

not_funded_min_persistence_probability

numeric minimum probability of the species persisting if their projects are not funded. Defaults to 0.01.

not_funded_max_persistence_probability

numeric maximum probability of the species persisting if their projects are not funded. Defaults to 0.4.

locked_in_proportion

numeric of actions that are locked into the solution. Defaults to 0.

locked_out_proportion

numeric of actions that are locked into the solution. Defaults to 0.

Value

A list object containing the elements:

"project_data"

A tibble containing the data for the conservation projects. It contains the following columns:

"name"

character name for each project.

"success"

numeric probability of each project succeeding if it is funded.

"S1" ... "SN"

numeric columns for each species, ranging from "S1" to "SN" where N is the number of species, indicating the enhanced probability that each species will persist if it funded.

"S1_action" ... "SN_action"

logical columns for each action, ranging from "S1_action" to "SN_action" where N is the number of actions (equal to the number of species in this simulated data), indicating if an action is associated with a project (TRUE) or not (FALSE).

"action_data"

A tibble containing the data for the conservation actions. It contains the following columns:

"name"

character name for each action.

"cost"

numeric cost for each action.

"locked_in"

logical indicating if certain actions should be locked into the solution.

"locked_out"

logical indicating if certain actions should be locked out of the solution.

"species_data"

A tibble containing the data for the species. It contains the following columns:

"name"

character name for each species.

"weight"

numeric weight for each species. For each species, this is calculated as the amount of time that elapsed between the present and the species' last common ancestor. In other words, the weights are calculated as the unique amount of evolutionary history that each species has experienced.

"tree"

phylo phylogenetic tree for the species.

Details

The simulated data set will contain one conservation project for each species and a "baseline" (do nothing) project to reflect species' persistence when none of their conservation projects are not funded. Each conservation project is associated with a single action, and no conservation projects share any actions. Specifically, the data are simulated as follows:

  1. A conservation project is created for each species, and each project is associated with its own single action.

  2. Cost data for each action are simulated using a normal distribution and the cost_mean and cost_sd arguments.

  3. A set proportion of the actions are randomly set to be locked in and out of the solutions using the locked_in_proportion and locked_out_proportion arguments.

  4. The probability of each project succeeding if its action is funded is simulated by drawing probabilities from a uniform distribution with the upper and lower bounds set as the success_min_probability and success_max_probability arguments.

  5. The probability of each species persisting if its project is funded and is successful is simulated by drawing probabilities from a uniform distribution with the upper and lower bounds set as the funded_min_persistence_probability and funded_max_persistence_probability arguments.

  6. An additional project is created which represents the "baseline" (do nothing) scenario. The probability of each species persisting when managed under this project is simulated by drawing probabilities from a uniform distribution with the upper and lower bounds set as the not_funded_min_persistence_probability and not_funded_max_persistence_probability arguments.

  7. A phylogenetic tree is simulated for the species using rcoal.

  8. Species data are created from the phylogenetic tree. The weights are calculated as the amount of evolutionary history that has elapsed between each species and its last common ancestor.

Examples

# create a simulated data set s <- ppp_simulate_data(number_species = 5, cost_mean = 100, cost_sd = 5, success_min_probability = 0.7, success_max_probability = 0.99, funded_min_persistence_probability = 0.5, funded_max_persistence_probability = 0.9, not_funded_min_persistence_probability = 0.01, not_funded_max_persistence_probability = 0.4, locked_in_proportion = 0.01, locked_out_proportion = 0.01) # print data set print(s)
#> $project_data #> # A tibble: 6 x 13 #> name success S1 S2 S3 S4 S5 S1_action S2_action S3_action #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <lgl> <lgl> <lgl> #> 1 S1_p~ 0.756 0.789 0 0 0 0 TRUE FALSE FALSE #> 2 S2_p~ 0.889 0 0.511 0 0 0 FALSE TRUE FALSE #> 3 S3_p~ 0.723 0 0 0.808 0 0 FALSE FALSE TRUE #> 4 S4_p~ 0.936 0 0 0 0.838 0 FALSE FALSE FALSE #> 5 S5_p~ 0.980 0 0 0 0 0.655 FALSE FALSE FALSE #> 6 base~ 1 0.373 0.0232 0.162 0.101 0.0776 FALSE FALSE FALSE #> # ... with 3 more variables: S4_action <lgl>, S5_action <lgl>, #> # baseline_action <lgl> #> #> $action_data #> # A tibble: 6 x 4 #> name cost locked_in locked_out #> <chr> <dbl> <lgl> <lgl> #> 1 S1_action 101. TRUE FALSE #> 2 S2_action 104. FALSE FALSE #> 3 S3_action 106. FALSE TRUE #> 4 S4_action 94.4 FALSE FALSE #> 5 S5_action 91.2 FALSE FALSE #> 6 baseline_action 0 FALSE FALSE #> #> $species_data #> # A tibble: 5 x 2 #> name weight #> <chr> <dbl> #> 1 S2 1.24 #> 2 S1 0.0686 #> 3 S3 0.0686 #> 4 S4 0.177 #> 5 S5 0.177 #> #> $tree #> #> Phylogenetic tree with 5 tips and 4 internal nodes. #> #> Tip labels: #> [1] "S2" "S1" "S3" "S4" "S5" #> #> Rooted; includes branch lengths. #>