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
)data.frame from create_stations()
data.frame from generate_time_index()
Numeric. Base wet-day probability. Used mainly for daily simulations. Default = 0.35
Numeric. Shape parameter for Gamma rainfall generation. Default = 2
Numeric. Scale parameter for Gamma rainfall generation. Default = 8
Numeric. Temporal persistence coefficient. Default = 0.4
Numeric. Controls rainfall seasonality intensity. Default = 1
Numeric. Probability of extreme rainfall occurrence. Default = 0.01
Numeric. Multiplier applied during extreme events. Default = 3
Numeric. Maximum allowable rainfall amount. Default = 500
Optional numeric seed.
data.frame containing:
Station name
Longitude
Latitude
Elevation
Simulation timestamp
Calendar year
Calendar month
Climatological season
Simulated rainfall amount (mm)
Wet occurrence indicator
Extreme rainfall indicator
Rainfall anomaly
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.
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