# Dummy data for demonstration (replace with your actual data)
set.seed(123)
historical_data_for_target <- floor(fit_powerlaw(n = 500, alpha = 2, xmin = 10, xmax = 10000))
event_surfaces <- fit_powerlaw(n = 10000, alpha = 2, xmin = 10, xmax = 10000)
# Discard simulated fires that are too large (below 110% max historical size)
event_surfaces <- event_surfaces[event_surfaces < max(historical_data_for_target) * 1.1]
# Default configuration: logaritmic transformation on fire size
target_info_example <- build_target_hist(num_bins = 10, logaritmic = TRUE,
sizes = historical_data_for_target,
event_surfaces = event_surfaces)
# Print results
target_hist <- target_info_example$target_hist
print(target_hist)
bins <- target_info_example$bins
print(bins)
# Alternate configuration: original frequency distribution on fire size
target_info_example <- build_target_hist(num_bins = 10, logaritmic = FALSE,
sizes = historical_data_for_target,
event_surfaces = event_surfaces)
# Print results
target_hist <- target_info_example$target_hist
print(target_hist)
bins <- target_info_example$bins
print(bins)
Run the code above in your browser using DataLab