You can paste the below code into an online Python compiler like https://python-fiddle.com/ and grab the result instantly.
This script will generate a plot that illustrates:
- The original model (blue line).
- A scenario with a steeper slope (red line), showing a more rapid increase in flood risk with rainfall.
- A scenario with a gentler slope (green line), showing a more gradual increase in risk.
- A scenario with a less negative intercept (purple line), resulting in higher probabilities at lower rainfall amounts.
- A scenario with a more negative intercept (orange line), requiring more rainfall to reach moderate flood probabilities.
The plot also includes:
- A horizontal dashed line at 0.5 probability for reference.
- A vertical dotted line at 226.95 mm rainfall, corresponding to your example.
This visualization should help in understanding how changes in slope and intercept affect the relationship between rainfall and flood probability in your model.