Generates synthetic rainfall series for multiple stations using stochastic climate dynamics and climate-zone controls.

simulate_rainfall(
  stations,
  time_index,
  wetday_prob = 0.35,
  gamma_shape = 2,
  gamma_scale = 8,
  ar_coeff = 0.4,
  seasonal_strength = 1,
  extreme_event_prob = 0.01,
  extreme_multiplier = 3,
  max_rainfall = 800,
  seed = NULL
)

Arguments

stations

data.frame from create_stations()

time_index

data.frame from generate_time_index()

wetday_prob

Numeric. Base wet-day probability. Used mainly for daily simulations. Default = 0.35

gamma_shape

Numeric. Shape parameter for Gamma rainfall generation. Default = 2

gamma_scale

Numeric. Scale parameter for Gamma rainfall generation. Default = 8

ar_coeff

Numeric. Temporal persistence coefficient. Default = 0.4

seasonal_strength

Numeric. Controls rainfall seasonality intensity. Default = 1

extreme_event_prob

Numeric. Probability of extreme rainfall occurrence. Default = 0.01

extreme_multiplier

Numeric. Multiplier applied during extreme events. Default = 3

max_rainfall

Numeric. Maximum allowable rainfall amount. Default = 500

seed

Optional numeric seed.

Value

data.frame containing:

Station

Station name

LON

Longitude

LAT

Latitude

ELEV

Elevation

DATE

Simulation timestamp

Year

Calendar year

Month

Calendar month

Season

Climatological season

Rainfall

Simulated rainfall amount (mm)

Wet_Day

Wet occurrence indicator

Extreme_Event

Extreme rainfall indicator

Rain_Anomaly

Rainfall anomaly

Details

The simulation incorporates:

  • wet/dry occurrence processes,

  • seasonal rainfall regimes,

  • spatial climate variability,

  • coastal moisture effects,

  • elevation enhancement,

  • temporal persistence,

  • extreme rainfall events,

  • Gamma-distributed rainfall amounts.

Supports:

  • daily simulations,

  • monthly simulations,

  • yearly simulations.

Examples

stations <- create_stations(
  n = 5,
  seed = 123
)
#> Generating synthetic station network...
#> Generated 5 synthetic stations within bounding box.
#> Deriving climate-aware station attributes...

time_index <- generate_time_index(
  start_date = "2000-01-01",
  end_date = "2005-12-31",
  frequency = "monthly"
)
#> Generated 72 time steps at monthly resolution.

rain <- simulate_rainfall(
  stations = stations,
  time_index = time_index,
  seed = 123
)
#> Rainfall simulation complete for 5 stations.

head(rain)
#>      Station       LON      LAT  ELEV CLIMATE_ZONE RAIN_REGIME       DATE Year
#> 1  Station_1 -2.062112 4.818895 765.5      Coastal     Bimodal 2000-01-16 2000
#> 6  Station_1 -2.062112 4.818895 765.5      Coastal     Bimodal 2000-02-15 2000
#> 11 Station_1 -2.062112 4.818895 765.5      Coastal     Bimodal 2000-03-16 2000
#> 16 Station_1 -2.062112 4.818895 765.5      Coastal     Bimodal 2000-04-15 2000
#> 21 Station_1 -2.062112 4.818895 765.5      Coastal     Bimodal 2000-05-16 2000
#> 26 Station_1 -2.062112 4.818895 765.5      Coastal     Bimodal 2000-06-15 2000
#>    Month  Season Rain_Days Rainfall Wet_Day Extreme_Event Rain_Anomaly
#> 1      1     Dry        10   568.27       1             0       305.66
#> 6      2     Dry        13    97.15       1             0       -56.27
#> 11     3 Pre-Wet        13   235.13       1             0        80.68
#> 16     4 Pre-Wet        18   257.52       1             0       -44.30
#> 21     5 Pre-Wet        21   193.62       1             0       -96.45
#> 26     6     Wet        20   166.08       1             0      -190.13