cost_eco_model_linker.cost_calculations

Attributes

Functions

get_NK(nsims, n_factors)

Calculate number of input Sobol samples, N, given number of total simulations required and number of factors.

cost_types(cost, contingency, nsims)

Calculate key cost codes:

initialise_cost_df(years, nsims)

Initialize dataframe for storing sampled cost data.

sample_cost_model(nsims)

Sample cost model parameters.

update_factors(deploy_factors, prod_factors, iv_spec, ...)

Update sampled cost model parameter dataframes with intervention specific parameters.

calc_setup_costs(deploy_factors, prod_factors, ...)

Update number of corals to correctly calculate setup cost for years after the first

calculate_costs(stores, ID_key_fn, nsims, ...[, ...])

Sample costs for a set of interventions specified in ID_key, sampling nsims.

Module Contents

cost_eco_model_linker.cost_calculations.THIS_DIR
cost_eco_model_linker.cost_calculations.get_NK(nsims, n_factors)

Calculate number of input Sobol samples, N, given number of total simulations required and number of factors. Want an output number of samples, N*K , as close to the required number of sims as possible, where K = (2*n_factors + 2). See https://salib.readthedocs.io/en/latest/api.html#sobol-sensitivity-analysis

cost_eco_model_linker.cost_calculations.cost_types(cost, contingency, nsims)

Calculate key cost codes: - 1 : CAPEX, sum of production and deployment cost - 2 : Contingency CAPEX, % of CAPEX - 3 : OPEX, sum of production and deployment cost - 4 : Sustaining capital OPEX, set to zero for now (assumed to be included in OPEX through contract) - 5 : Contingency OPEX, % of OPEX - 6 : Vessel fuel, only relevant if volunteer vessels are used - set to zero for now - 7 : CAPEX-monitoring, set to zero (assumed no monitoring cost) - 8 : Contingency CAPEX-monitoring, % of CAPEX-monitoring - 9 : OPEX-monitoring, set to zero (assumed no monitoring cost) - 10 : Sustaining capital OPEX-monitoring, set to zero (assumed no monitoring cost) - 11 : Contingency OPEX-monitoring, % of OPEX-monitoring

Parameters:
  • cost (dataframe) – Dataframe containing ‘Cost’ and ‘setupCost’

  • contingency (float) – Contingency proportion.

  • nsims (int) – Total number of simulations (from metrics sampling)

cost_eco_model_linker.cost_calculations.initialise_cost_df(years, nsims)

Initialize dataframe for storing sampled cost data.

Parameters:
  • years (np.array) – Intervention years

  • nsims (int) – Total number of simulations (from metrics sampling)

Returns:

cost_df

Return type:

dataframe

cost_eco_model_linker.cost_calculations.sample_cost_model(nsims)

Sample cost model parameters.

Parameters:

nsims (int) – Total number of simulations (from metrics sampling)

Returns:

  • factor_specs_dep (dict) – Factor specification for sampling factors in the deployment cost model.

  • factors_df_dep (dataframe) – Sampled factors for the deployment cost model.

  • factor_specs_prod (dict) – Factor specification for sampling factors in the production cost model.

  • factors_df_prod (dataframe) – Sampled factors for the production cost model

cost_eco_model_linker.cost_calculations.update_factors(deploy_factors, prod_factors, iv_spec, ecol_idx, nsims)

Update sampled cost model parameter dataframes with intervention specific parameters.

Parameters:
  • deploy_factors (dataframe) – Factors dataframe for the deployment cost model.

  • prod_factors (dataframe) – Factors dataframe for the production cost model

  • iv_spec (dataframe) – Intervention specification dataframe containing intervention parameters.

  • ecol_idx (int) – Indices mapping scenario IDs in the RME results to samples in nsims.

  • nsims (int) – Number of simulations drawn (may be smaller than dataframe size to get correct number of samples for Sobol Sampling).

cost_eco_model_linker.cost_calculations.calc_setup_costs(deploy_factors, prod_factors, iv_spec, ecol_idx, nsims)

Update number of corals to correctly calculate setup cost for years after the first intervention year. Setup costs are only accrued for additional corals deployed relative to the previous year.

Parameters:
  • deploy_factors (dataframe) – Factors dataframe for the deployment cost model.

  • prod_factors (dataframe) – Factors dataframe for the production cost model

  • iv_spec (dataframe) – Intervention specification dataframe containing intervention parameters.

  • ecol_idx (int) – Indices mapping scenario IDs in the RME results to samples in nsims.

  • nsims (int) – Number of simulations drawn (may be smaller than dataframe size to get correct number of samples for Sobol Sampling).

cost_eco_model_linker.cost_calculations.calculate_costs(stores: cost_eco_model_linker.setup_results.OutputStores, ID_key_fn: str, nsims: int, deploy_model_filepath: str, prod_model_filepath: str, cont_p: float = 0.25, iter_id: int = 0)

Sample costs for a set of interventions specified in ID_key, sampling nsims.

Parameters:
  • stores (OutputStores) – Data class holding output directory locations

  • ID_key_fn (str) – Target filename for output.

  • nsims (int) – Total number of draws to sample cost models, should match ecological metrics sampling.

  • deploy_model_filepath (string) – Path to deployment cost model.

  • prod_model_filepath (string) – Path to production cost model.

  • cont_p (float) – Contingency cost proportion.

  • iter_id (int) – ID used for parallel sampling to keep track of batches for ordered recombination.