Skip to content

Instantly share code, notes, and snippets.

@ribsy
Created April 19, 2022 02:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ribsy/72d70d9ad9e939b97e5575655084bfa0 to your computer and use it in GitHub Desktop.
Save ribsy/72d70d9ad9e939b97e5575655084bfa0 to your computer and use it in GitHub Desktop.
source("manifesto_functions.R")
### OPTIONAL A/B Case Study
### Code Slide #1
# Declare list to hold configurations
base_configs <- list()
# Amount of simulation
base_configs["n_draws"] <- 100000
# Product A Events (bugs, phis, malware etc)
base_configs["a_n_events"] <- 34
# Product B Events (bugs, phis, malware etc)
base_configs["b_n_events"] <- 37
# Time Frame: Months(12), Weeks(52), Days(365
base_configs["time_multiple"] <- 365
### Slide #2
# Beliefs about error counts prior to testing
event_priors <- list()
event_priors["median_errors"] <- 0.20
event_priors["edge_errors"] <- 0.45
# True Error Counts
event_counts <- list()
event_counts["product_a_errors"] <- 10
event_counts["product_b_errors"] <- 13
### Slide #3
# Forecasted range of error response hours that can happen per event
eng_hour_range <- list()
eng_hour_range["mode"] <- 3 # Expect hours
eng_hour_range["low"] <- 1 # Low hours
eng_hour_range["high"] <- 5 # Max hours
# Forecasted cost of responding to an error event for ONE HOUR
eng_cost_range <- list()
eng_cost_range["mode"] <- 600 # Expected cost per event
eng_cost_range["low"] <- 200 # Low end cost per event
eng_cost_range["high"] <- 2000 # High end cost per event
### Slide #4
# Year 1 Deterministic Cost of Product A & B license or subscription etc
product_costs <- list()
product_costs["prod_a_cost"] <- 72000.00
product_costs["prod_b_cost"] <- 65000.00
product_costs["prod_a_run"] <- 10000 # Additional Operational Cost
product_costs["prod_b_run"] <- 10000 # Additional Operational Cost
runProductCostComparison(base_configs, event_priors, event_counts,
eng_hour_range, eng_cost_range, product_costs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment