Approximate expected value of the decision given survey information
Source:R/approx_evdsi.R
approx_evdsi.Rd
Calculate the expected value of the management decision given survey information. This metric describes the value of the management decision that is expected when the decision maker conducts a surveys a set of sites to inform the decision. To speed up the calculations, an approximation method is used.
Usage
approx_evdsi(
site_data,
feature_data,
site_detection_columns,
site_n_surveys_columns,
site_probability_columns,
site_management_cost_column,
site_survey_scheme_column,
site_survey_cost_column,
feature_survey_column,
feature_survey_sensitivity_column,
feature_survey_specificity_column,
feature_model_sensitivity_column,
feature_model_specificity_column,
feature_target_column,
total_budget,
site_management_locked_in_column = NULL,
site_management_locked_out_column = NULL,
prior_matrix = NULL,
n_approx_replicates = 100,
n_approx_outcomes_per_replicate = 10000,
seed = 500
)
Arguments
- site_data
sf::sf()
object with site data.- feature_data
base::data.frame()
object with feature data.- site_detection_columns
character
names ofnumeric
columns in the argument tosite_data
that contain the proportion of surveys conducted within each site that detected each feature. Each column should correspond to a different feature, and contain a proportion value (between zero and one). If a site has not previously been surveyed, a value of zero should be used.- site_n_surveys_columns
character
names ofnumeric
columns in the argument tosite_data
that contain the total number of surveys conducted for each each feature within each site. Each column should correspond to a different feature, and contain a non-negative integer number (e.g. 0, 1, 2, 3). If a site has not previously been surveyed, a value of zero should be used.- site_probability_columns
character
names ofnumeric
columns in the argument tosite_data
that contain modeled probabilities of occupancy for each feature in each site. Each column should correspond to a different feature, and contain probability data (values between zero and one). No missing (NA
) values are permitted in these columns.- site_management_cost_column
character
name of column in the argument tosite_data
that contains costs for managing each site for conservation. This column should havenumeric
values that are equal to or greater than zero. No missing (NA
) values are permitted in this column.- site_survey_scheme_column
character
name oflogical
(TRUE
/FALSE
) column in the argument tosite_data
that indicates which sites are selected in the scheme or not. No missingNA
values are permitted. Additionally, only sites that are missing data can be selected or surveying (as per the argument tosite_detection_columns
).- site_survey_cost_column
character
name of column in the argument tosite_data
that contains costs for surveying each site. This column should havenumeric
values that are equal to or greater than zero. No missing (NA
) values are permitted in this column.- feature_survey_column
character
name of the column in the argument tofeature_data
that containslogical
(TRUE
/FALSE
) values indicating if the feature will be surveyed in the planned surveys or not. Note that considering additional features will rapidly increase computational burden, and so it is only recommended to consider features that are of specific conservation interest. No missing (NA
) values are permitted in this column.- feature_survey_sensitivity_column
character
name of the column in the argument tofeature_data
that contains probability of future surveys correctly detecting a presence of each feature in a given site (i.e. the sensitivity of the survey methodology). This column should havenumeric
values that are between zero and one. No missing (NA
) values are permitted in this column.- feature_survey_specificity_column
character
name of the column in the argument tofeature_data
that contains probability of future surveys correctly detecting an absence of each feature in a given site (i.e. the specificity of the survey methodology). This column should havenumeric
values that are between zero and one. No missing (NA
) values are permitted in this column.- feature_model_sensitivity_column
character
name of the column in the argument tofeature_data
that contains probability of the initial models correctly predicting a presence of each feature in a given site (i.e. the sensitivity of the models). This column should havenumeric
values that are between zero and one. No missing (NA
) values are permitted in this column. This should ideally be calculated usingfit_xgb_occupancy_models()
orfit_hglm_occupancy_models()
.- feature_model_specificity_column
character
name of the column in the argument tofeature_data
that contains probability of the initial models correctly predicting an absence of each feature in a given site (i.e. the specificity of the models). This column should havenumeric
values that are between zero and one. No missing (NA
) values are permitted in this column. This should ideally be calculated usingfit_xgb_occupancy_models()
orfit_hglm_occupancy_models()
.- feature_target_column
character
name of the column in the argument tofeature_data
that contains the \(target\) values used to parametrize the conservation benefit of managing of each feature. This column should havenumeric
values that are equal to or greater than zero. No missing (NA
) values are permitted in this column.- total_budget
numeric
maximum expenditure permitted for conducting surveys and managing sites for conservation.- site_management_locked_in_column
character
name of the column in the argument tosite_data
that containslogical
(TRUE
/FALSE
) values indicating which sites should be locked in for (TRUE
) being managed for conservation or (FALSE
) not. No missing (NA
) values are permitted in this column. This is useful if some sites have already been earmarked for conservation, or if some sites are already being managed for conservation. Defaults toNULL
such that no sites are locked in.- site_management_locked_out_column
character
name of the column in the argument tosite_data
that containslogical
(TRUE
/FALSE
) values indicating which sites should be locked out for (TRUE
) being managed for conservation or (FALSE
) not. No missing (NA
) values are permitted in this column. This is useful if some sites could potentially be surveyed to improve model predictions even if they cannot be managed for conservation. Defaults toNULL
such that no sites are locked out.- prior_matrix
numeric
matrix
containing the prior probability of each feature occupying each site. Rows correspond to features, and columns correspond to sites. Defaults toNULL
such that prior data is calculated automatically usingprior_probability_matrix()
.- n_approx_replicates
integer
number of replicates to use for approximating the expected value calculations. Defaults to 100.- n_approx_outcomes_per_replicate
integer
number of outcomes to use per replicate for approximation calculations. Defaults to 10000.- seed
integer
state of the random number generator for simulating outcomes when conducting the value of information analyses. Defaults to 500.
Details
This function uses approximation methods to estimate the
expected value calculations. The accuracy of these
calculations depend on the arguments to
n_approx_replicates
and n_approx_outcomes_per_replicate
, and
so you may need to increase these parameters for large problems.
Examples
# set seeds for reproducibility
set.seed(123)
# load example site data
data(sim_sites)
print(sim_sites)
#> Simple feature collection with 6 features and 13 fields
#> Geometry type: POINT
#> Dimension: XY
#> Bounding box: xmin: 0.02541313 ymin: 0.07851093 xmax: 0.9888107 ymax: 0.717068
#> CRS: NA
#> # A tibble: 6 × 14
#> survey_cost management_cost f1 f2 f3 n1 n2 n3 e1 e2
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 19 99 0 0 0 0 0 0 1.13 0.535
#> 2 22 87 0 1 0.25 4 4 4 -1.37 -1.45
#> 3 13 94 1 1 0 1 1 1 0.155 -0.867
#> 4 19 61 0 0 0 0 0 0 -0.792 1.32
#> 5 9 105 0 0 0 0 0 0 -0.194 0.238
#> 6 12 136 0 0 0 0 0 0 1.07 0.220
#> # ℹ 4 more variables: p1 <dbl>, p2 <dbl>, p3 <dbl>, geometry <POINT>
# load example feature data
data(sim_features)
print(sim_features)
#> # A tibble: 3 × 7
#> name survey survey_sensitivity survey_specificity model_sensitivity
#> <chr> <lgl> <dbl> <dbl> <dbl>
#> 1 f1 TRUE 0.951 0.854 0.711
#> 2 f2 TRUE 0.990 0.832 0.722
#> 3 f3 TRUE 0.986 0.808 0.772
#> # ℹ 2 more variables: model_specificity <dbl>, target <dbl>
# set total budget for managing sites for conservation
# (i.e. 50% of the cost of managing all sites)
total_budget <- sum(sim_sites$management_cost) * 0.5
# create a survey scheme that samples the first two sites that
# are missing data
sim_sites$survey_site <- FALSE
sim_sites$survey_site[which(sim_sites$n1 < 0.5)[1:2]] <- TRUE
# calculate expected value of management decision given the survey
# information using approximation method
approx_ev_survey <- approx_evdsi(
sim_sites, sim_features,
c("f1", "f2", "f3"), c("n1", "n2", "n3"), c("p1", "p2", "p3"),
"management_cost", "survey_site",
"survey_cost", "survey", "survey_sensitivity", "survey_specificity",
"model_sensitivity", "model_specificity",
"target", total_budget)
# print mean value
print(mean(approx_ev_survey))
#> [1] 1.224692