Appendix E Prob Workbook

E.1 Learning Goals

By the end of this in-class session, you will be able to:

  1. Interpret and compare PDFs and CDFs for environmental variables.
  2. Choose reasonable probability models (Normal, Lognormal, Gamma, Exponential, Weibull, Poisson, Gumbel) for a given process.
  3. Estimate simple distribution parameters from data (quick method-of-moments).

E.2 Run the Tree Height Demo App

Background The data in this file is from a large sampling of an established forest. 500 tree heights were surveyed.

In the overview tab you are given some information on the data. In your own words describe what the following mean to you

  • mean
  • standard deviation (variance)
  • mode (can you determine where it is?)
  • median (can you determine where it is?)

Class Discussion

  • How is the kind of data used?
  • What kinds of insights can we extract?
  • How could we use this in modeling?

PDFs the math kind

Observe the bar graph of probabilities.

  • How does it compare to the histogram on the previous tab?
  • What’s the same / different?
  • There are two fitted curves (distributions) to the data, one is normal the other empirical - what do you think the difference is?
  • Which of the fitted distributions do you think is right?

Set the lower and upper bound to 24

  • What probability do you get for the empirical and theoretical distributions?

Set the lower bound to 17 and upper bound to 23

  • What probability do you get for the empirical and theoretical distributions?

Can you explain how the probability is calculated?

CDFs

Cumulative distributions functions are the accumulation of the pdf curve. Or in mathematical language, the integration of the PDF.

Lets see what you remember from calc

  • The point of inflection on the CDF correspons to what on the pdf (its derivative)

  • Examine the slopes of the CDF, describe what is happening from 10 to 30 (in everyday words)

Now repeat what we did earlier, set the lower and upper bound to 24

  • What probability do you get for the empirical and theoretical distributions?

Set the lower bound to 17 and upper bound to 23

  • What probability do you get for the empirical and theoretical distributions?

Can you explain how the probability is calculated?

Sampling from a CDF

How Sampling from a CDF Works

The Cumulative Distribution Function (CDF) tells us, for any value \(x\), the probability that a random variable is less than or equal to that value —
\[ F(x) = P(X \le x) \]

If we reverse this process, we can generate new samples that follow the same distribution as the data.
Here’s the logic:

  1. Draw a random number \(u\) between 0 and 1 — this represents a cumulative probability.
  2. Find the value \(x\) where \(F(x) = u\).
  3. That value \(x\) becomes one of your simulated samples.

In other words, each \(u\) tells you how far up the CDF to go, and you then read off the corresponding \(x\)-value on the horizontal axis.
Doing this repeatedly produces data that follow the same shape and probabilities as your original dataset.


Try It Yourself

  • Click “Draw 1 sample” to see how a random \(u\) maps to a tree height \(x\) on the CDF.
  • Draw 10 samples at a time to see how your histogram begins to approximate the original data.
  • Watch the Running KDE (samples) curve below — does it begin to match the Empirical KDE (full data) or the Normal(μ,σ) fit?
  • Reflect: Why does the sample-based distribution become smoother and more similar as the number of samples increases?
    (Hint: the Law of Large Numbers.)

Class discussion

What does this kind of statistics / probability allows us to do?

E.3 Lab 3: Exploring NOAA Climate Data

In this activity, you will work with real-world climate data from the National Centers for Environmental Information (NCEI).

Step 1: Download Data

  1. Go to the NOAA Climate Data Online (CDO).
  2. Under “Data Tools”, select “Search Tool”. Run a search with the search term Seattle.
  3. Select a dataset such as Daily Summaries (GHCND).
  4. Choose a date range (for example, the past 10 years) and download the data as a .csv file (I’ve donwloaded a file for you on CANVAS)
  5. Once you get to the map view, find a station and click the View Full Details link.

Pay special attention to ‘data coverage’ - this lets you know how much missing data there is in the time period

Step 2: Read the Documentation

Before analyzing the data, read the GHCND (Global Historical Climatology Network – Daily) documentation:

GHCND Documentation (NOAA)

This file describes:

  • The meaning of each column
  • Units
  • Flags that indicate data quality or measurement conditions

What units are precipitation and temperature in?

Step 3: Raw data exploration - Daily

Save the sea_tac.R file to your Models folder

Be sure the place the dataset seatac_data.csv in a folder titled data (which should be inside your Models folder)

In the Daily Time Series Tab

  • Any outliers? are they real? or are they errors?
  • Do the values make sense?
  • Observe any trends
  • Zoom in on a period of 5 years, what do you notice about daily rainfall?

Step 4: Raw data exploration - Annual

Hit the Update Annual button

  • What do you notice about the means?
  • Would you say rainfall is stationary?

Now hit the Update Distribution button

  • Toggle on the Exclude zero-rain days (hit update)
    • Why do you this we exclude the zeros?
    • What kind of distribution is this?
    • Comment on the tail of this distribution
  • Toggle on the Overlay Period B button
    • Make period B run from 2015 to present
    • Discuss what you observe

Step 5: Raw data exploration - Monthly

Repeat what you did for the Annual but now in the Monthly Tab

  • Which months are interesting in terms of how they are changing
  • Describe their change in terms of the distribution shifts

Step 6: Conceptual Modelling of Rainfall

Go back to the Daily Time Series Tab Set the dates from 2024-10-15 to 2025-10-15

  • In a small group, think about how you would create an synthetic timeseries of rainfall.
  • How could you use the dataset we downloaded?
  • What statistics could we utilize?
  • Any ideas on how we could use probabilities to build a timeseries?

E.4 Lab 4: 🌧️ Guided Activity: Exploring Rainfall Variability and Simulation

Goal:

  • Use the Sea-Tac Rainfall Explorer app to explore precipitation patterns, fit statistical distributions, and simulate realistic rainfall sequences.
  • Over several short sessions, you will move from describing data → fitting models → testing simulations → reflecting on model strengths and weaknesses.

E.4.1 Exploring the Data

1. Start the App

Open the Shiny app Sea-Tac Rainfall Explorer.
You’ll begin in the Annual Data → Daily precipitation tab.

2. Observe the Daily Record

  • Zoom in and out on the time series to examine wet and dry periods.
  • Note any long dry spells, clustering of wet days, or long-term trends.

Prompt 1:

  • What is the longest consecutive dry period you can find?
  • How does it compare to the longest wet period?

Prompt 2:

  • Identify one or more years that appear unusually dry or wet.
  • What real-world factors (ENSO, climate trends, etc.) might explain these anomalies?

3. Examine Annual Totals

Navigate to Annual Data → Annual totals.

  • The blue bars show annual precipitation; the black line shows a 7-year moving average.

Prompt 3:

  • Describe at least two multi-year “wet” and “dry” spells.
  • Estimate their duration in years.

Prompt 4:

  • How can you use the moving average to find these ‘spells’?

Fitting Statistical Distributions

1. Explore Annual Distribution Fits

Open Annual Data → Distribution of annual totals.

  1. Select all the distribution fits.
  2. Observe how each distribution curve matches (or misses) the histogram.

Prompt 5:

  • Which distribution best captures the shape of the annual rainfall data?
  • What feature (e.g., skewness, tail behavior) informs your choice?

Prompt 6:

  • Inspect the Fit parameters panel.
  • How do the estimated mean and standard deviation compare across models?

2. Interpret the CDF

  • Look at the CDF plot (right side).
  • Notice how the 10% and 90% lines highlight extreme dry or wet years.

Prompt 7:

  • For the each fit, estimate the rainfall amount that marks the 10th and 90th percentile.
  • What do these regions represent?

3. Move to Daily Distributions

Explore the Daily Data tabs:

  • Volume: rainfall on wet days
  • Duration: consecutive wet days
  • Interstorm: consecutive dry days

Prompt 8:

  • Compare the typical shapes of these three distributions.
  • Which one is most skewed?
  • What physical processes might produce that shape?
  • Put your intuition to work - do these make sense?

Simulation and Model Evaluation

1. Simulate a Single Year

Go to Simulation → Procedure.

Click Sample Step several times and observe how the model builds a time series:

  • First sampling dry days (interstorm),
  • Then wet-spell duration,
  • Then rain volumes.

Prompt 9:

  • How realistic does the simulated pattern look compared to the actual daily record?
  • Are wet and dry spells too frequent, too long, or about right?

Prompt 10:

  • After clicking Complete 1-Year Simulation, check the summary panel.
  • How does the total simulated rainfall compare to the historical mean?
  • Reset and run again - do things stay the same? are the different?

2. Compare Distributions

Scroll to Sampled vs. Historical Distributions.
Look at how the simulated (red line) distributions compare with historical histograms.

Prompt 11:

  • Which distribution (volume, duration, interstorm) is reproduced most accurately?
  • Which differs most from the historical shape?
  • Reset and run again, do things change?

3. Simulate Multiple Years

Move to Simulation → Bulk sim.

  • Choose a 3-year window of historical data.
  • Click Simulate 3 years.

Compare the Historical and Simulated plots.

Prompt 12:

  • Does the simulation reproduce realistic sequences of wet and dry spells at this multi-year scale?
  • What differences stand out?

4. Add Seasonality

Now open Simulation → Bulk Month sim.

This simulation varies the distribution parameters by month, capturing seasonal changes in rainfall characteristics.

Prompt 13:

  • Compare the Bulk sim and Bulk Month sim results.
  • What visual or statistical differences do you notice?

Prompt 14:

  • Which months contribute most to the total rainfall in the simulation?
  • Is that consistent with the historical record?

5. Think Critically — Model Limitations and Extensions

Prompt 15:

  • What are the key assumptions behind this rainfall generator?

Prompt 16:

  • List two aspects of real rainfall the model ignores.
  • How might you modify the model to include them?

Prompt 17:

  • If you were to apply this model to a different station (e.g., Phoenix or Miami),
    what challenges would you expect?

Optional Extensions (for advanced exploration)

  1. Parameter Sensitivity:
    Adjust the Gamma parameters manually (in R) to see how changing shape/rate alters rainfall variability.

  2. Spatial Extension:
    Imagine repeating this analysis for multiple stations across the Pacific Northwest.
    How might you assess regional coherence in rainfall trends?

  3. Climate Change Scenario:
    Suppose the mean annual precipitation increases by 10%.
    How would that shift the fitted distributions and simulated outcomes?


Wrap-Up Reflection

Write a short (1-page) reflection answering:

  • Which part of the rainfall record is most predictable, and which is most stochastic?
  • What does this modeling exercise reveal about the relationship between data and simulation?
  • How could similar probabilistic modeling approaches help in environmental forecasting (e.g., streamflow, drought risk)?

Submission:
Upload your responses (prompts + reflection) to Canvas.


E.5 Lab 5 - Coupling Models

In this lab, you’ll explore how forest biomass responds to varying rainfall conditions using a logistic growth model with rainfall-dependent growth rate \(r_t\).

You’ll use an interactive Shiny app to:

  1. Visualize the logistic growth model and its differential equation.
  2. Examine rainfall distributions and how they are modeled statistically.
  3. Simulate forest growth under different rainfall scenarios — historical, synthetic, and climate-altered.
  4. Explore how drought intensity and mortality influence long-term forest dynamics.

Background: Logistic Growth and Rainfall Dependence

The logistic model describes how biomass or population grows over time under resource limitations: \[ B(t) = \frac{K}{1 + \left(\frac{K - B_0}{B_0}\right)e^{-r_t t}} \]

and it’s derivative:

\[ \frac{dB}{dt} = r_t B \left(1 - \frac{B}{K}\right) \]

Here:

  • \(B(t)\): biomass (or population size) at time \(t\)
  • \(r_t\): intrinsic growth rate, possibly varying with rainfall
  • \(K\): carrying capacity of the forest
  • \(B_0\): initial biomass

In this lab we are going to relax the assumption that \(r_t\) is constant and allow it to change each year depending on rainfall \(R_t\).


Conceptual Exploration: Before Using the App

Before interacting with the model, take time to reason through the following questions.

Task 1

Situation: You planted a forest on the weekend, you want to model its growth over time.

Discuss in pairs or small groups, then record your individual thoughts.

1. How might rainfall influence forest growth?

  • Which aspects of rainfall are most important? (e.g., total annual amount, intensity, timing, variability)

  • Is the relationship likely to be linear, or are there thresholds or saturation points?

2. What timescales of rainfall change matter most?

  • Daily variation? Seasonal cycles? Multi-year droughts?

  • How quickly could a forest respond to a change in rainfall?

3. How could you simplify the problem to start?

  • What assumptions might you make to build a minimal model?

  • How could rainfall data be summarized or reduced to one or two key parameters?

Write down one simple conceptual model of your own that links rainfall to forest biomass growth. Use words, a short equation, or a flow diagram.

Be prepared to compare your model with the one implemented in the Shiny app.


Part 1 — Exploring the Logistic Model

  1. Open the “Logistic Growth” tab in the Shiny app.
  2. Use the sliders to vary:
    • Growth rate \(r\)
    • Carrying capacity \(K\)
    • Initial biomass \(B_0\)
  3. Observe how each parameter affects the curve of \(B(t)\).

This is just to refamiliarize yourself with how the paramters impact your model.


Part 2 — Understanding Rainfall Distributions

Navigate to the “Distributions” tab.
Examine the fitted Gamma distributions for:

  • Wet-day rainfall volume
  • Wet-spell duration
  • Interstorm duration

Note how these variables differ in their means and spread.

Task 2

  1. Why is the Gamma distribution more appropriate than a Normal distribution for rainfall-related variables?

  2. What might a longer “right tail” in the interstorm duration distribution imply about drought frequency?

  3. Do you think these annual distributions help answer the questions you are asking abouut the growth of your forest?





Part 3 — Linking Rainfall to Growth

In this lab, \(r_t\) changes each year depending on rainfall \(R_t\), relative to a fixed historical mean \(\overline{R}\):

\[ r_t = r_0 \min\!\big(1 + \max(\tfrac{R_t}{\overline{R}}-1, 0), 1.2\big) - m \max\!\big(1 - \tfrac{R_t}{\overline{R}}, 0\big) \]

where \(m\) controls how strongly drought reduces the growth rate.

Task 3

  • Explain how this equation works. How does it augment \(r_t\).
  • Can you reason your way to why each component is included?
  • Examine the limits of \(r_t\)




Step A: No Rainfall Dependence

View the “No Rainfall Dependence” panel.
This represents constant \(r = r_0\), independent of rainfall.

Step B: Historical Rainfall

Switch to the “Historical Rainfall” panel.
Here, \(r_t\) changes annually with observed rainfall.

Task 4

Adjust the mortality parameter (m) and note how it affects long-term biomass.

Comment on what you see - link it to your understanding of the equation used to model \(r_t\).






Step C: Synthetic Rainfall

Try the “Simulated Annual Rainfall” panel.
This version generates rainfall sequences from fitted Gamma distributions.

Task 5

  • When mortality \(m\) increases, how does the equilibrium biomass change? - How do wet years versus dry years appear in the growth trajectory?
  • Why might it be useful to compare results using a fixed historical mean \(\overline{R}\)?

Part 4 — Exploring Climate Scenarios

Use the next two tabs to simulate rainfall under modified climate conditions.

Tab 4: Adjust the mean and variance of annual rainfall.
Tab 5: Simulate daily rainfall from the fitted Gamma distributions.

Task 6

Compare biomass trajectories between these different rainfall regimes.

  • What happens to average biomass when mean rainfall decreases by 10%?
  • How does increased rainfall variability (higher SD) affect stability?
  • Which approach—annual or daily rainfall modeling—produces more realistic dynamics?

Part 5 — Ensemble Simulations

Use Tab 6 to run multiple stochastic simulations.

  1. Click “Add 1 Simulation” or “Add 10 Simulations” to build an ensemble of runs. Each run samples new rainfall sequences.

  2. Use the Year X slider to explore the distribution of biomass at that year.

    • The histogram shows biomass across simulations.
    • The dashed line shows a fitted normal distribution.
  3. Use “Reset Plot” to clear the ensemble and try new parameter settings.

Start with this model setup up

  • m=0
  • all rainfall characteristics at 0% change
  • run 50 sims
  • move the slider to examine the distribution

This represents the forest’s growth with no dependency on rainfall and no changes to rainfall charateristics

Task 7

Set the parameters and tell me a modeling story

  • Use the ‘base’ condition to compare your change scenario to
  • What are the implications to the your forest?







Part 6 — Reflection

Task 8

The reality of future change in the PNW is increased large storm events and longer interstorms - with little to no impact to annual rainfall.

This model uses a historical annual mean \(\overline{R}\) to drive the drought stress.

  • Why won’t this show much change given the reality of PNWs future change?
  • How could you adjust (don’t code it) this dependence into the model, what might you change?

Learning Outcomes

By the end of this lab, you should be able to:

  • Explain how the logistic growth model represents biomass dynamics.
  • Describe how rainfall variability affects intrinsic growth rate \(r_t\).
  • Use simulation to evaluate resilience and collapse under drought stress.
  • Connect conceptual modeling with data-driven exploration in a Shiny environment.

E.6 In-Class Activity — Markov Chains and Daily Energy Levels

In this activity, you’ll explore how a Markov chain models changes between different “states” of energy and focus throughout a typical day.

You’ll experience the concept firsthand by simulating transitions between Tired, Awake, Focused, Distracted, and Exhausted states — just like how your real energy levels fluctuate during a long day of classes.


Background

A Markov chain represents a system that moves between discrete states with certain probabilities.
At any time \(t\), the system is in one state, and at time \(t + 1\), it transitions to another (or stays the same) based on a fixed transition matrix.

\[ \mathbf{x}_{t+1} = \mathbf{x}_t P \]

Each row of the matrix represents the current state, and each column the next one.


The States

State Description Emoji
1 Tired — not awake yet, regretting that all-nighter 😴
2 Awake — caffeine kicking in, alert but not yet productive 🙂
3 Focused — fully engaged and working effectively 🔥
4 Distracted — scrolling, chatting, or daydreaming 🙃
5 Exhausted — mentally checked out; can’t continue 😩

The Base Transition Matrix

Below is a sample transition matrix representing one hour in the life of a student:

From  To Tired Awake Focused Distracted Exhausted
Tired 0.2 0.7 0.0 0.0 0.1
Awake 0.0 0.3 0.5 0.1 0.1
Focused 0.0 0.1 0.6 0.2 0.1
Distracted 0.1 0.2 0.2 0.3 0.2
Exhausted 0.5 0.0 0.0 0.0 0.5

Each row sums to 1.
The values represent the probability of moving from one state to another in a single time step (one “hour” in this model).


Step 1 — Experience the Model

  1. Each student starts as Tired.

  2. At each simulated hour, roll a 10-sided die or use a random-number generator.

  3. Use the current row of the matrix to determine your new state.
    Example:

    • A roll of 1-3 means you stay Tired (30% chance).
    • A roll of 4-6 means you go from Tired → Awake (60% chance).
    • A roll of 10 means you become Exhausted (10% chance).
  4. What state are you now in? Record that state, move to that state’s row and repeat for the next hour

  5. Repeat for 100 hours

  6. In the googlesheet record the number of hours you spent in each state


Step 2 — Visualize the System

Task 1

  • Which states dominate after several rounds?
  • Does the class settle into a stable distribution (a “steady energy mix”)?
  • What state seems “absorbing” — once you’re there, you rarely leave?

Step 3 — Personality Profiles

Different people move through their day with different energy dynamics.
Below are three alternate transition matrices, each representing a “personality type.”


🦸 Over-Caffeinated Optimist

From  To Tired Awake Focused Distracted Exhausted
Tired 0.1 0.8 0.1 0.0 0.0
Awake 0.0 0.2 0.6 0.1 0.1
Focused 0.0 0.1 0.6 0.2 0.1
Distracted 0.0 0.1 0.3 0.4 0.2
Exhausted 0.5 0.1 0.0 0.0 0.4

🧘 Steady Strategist

From  To Tired Awake Focused Distracted Exhausted
Tired 0.30 0.60 0.00 0.00 0.10
Awake 0.00 0.50 0.30 0.10 0.10
Focused 0.00 0.10 0.70 0.10 0.10
Distracted 0.10 0.30 0.20 0.30 0.10
Exhausted 0.30 0.20 0.00 0.00 0.50

🦥 Procrastinating Dreamer

From  To Tired Awake Focused Distracted Exhausted
Tired 0.40 0.40 0.00 0.10 0.10
Awake 0.10 0.30 0.10 0.40 0.10
Focused 0.00 0.10 0.40 0.30 0.20
Distracted 0.10 0.10 0.10 0.50 0.20
Exhausted 0.50 0.00 0.00 0.00 0.50

Step 4 — Group Simulation

  1. Divide into groups
    • Group 1 = Over-Caffeinated Optimists
    • Group 2 = Steady Strategists
    • Group 3 = Procrastinating Dreamers
  2. Run your simulations for 20 hours each recording how many hours your spend in each state.

Task 3

  • Which group had the most “focused” time?
  • With the data you now have - can you explain why your distribution of states looks the way it does?

Step 5 — Reflect and Connect

Task 4

  1. What does the stationary distribution represent in this context?
  2. How can personality differences (modeled as probabilities) explain variation in real-world behavior?
  3. How is this similar to populations in nature, where different species or individuals have distinct life-history strategies?
  4. How could you extend this to an environmental problem?

Learning Outcomes

By the end of this activity, you should be able to:

  • Explain how a Markov chain models transitions between behavioral or energetic states.
  • Interpret how transition probabilities affect system stability and outcomes.
  • Recognize that different “personalities” (or ecological strategies) can be represented by different transition matrices.
  • Relate the stationary distribution to long-term patterns in both human and ecological systems.

E.7 Lab 6 — Modeling Mosquito Population Dynamics with Markov Chains

In this lab, you’ll explore how the life cycle of a mosquito can be represented using a Markov chain model — a framework that describes how populations transition between discrete life stages with certain probabilities.

You’ll use an interactive Shiny app to:

  1. Examine how the transition matrix encodes daily probabilities of survival and development.
  2. Simulate changes in mosquito populations across egg, larva, pupa, and adult stages.
  3. Explore how mortality and reproduction rates affect population stability and persistence.
  4. Investigate how stochastic (random) variation influences population outcomes.

Background: Markov Chains and Life Cycles

Many organisms pass through a series of life stages, each with characteristic survival and transition probabilities. A Markov chain models these transitions as probabilistic changes from one stage to another.

Let

\[ \mathbf{x}_t = [x_{E,t}, x_{L,t}, x_{P,t}, x_{A,t}, x_{D,t}] \]

represent the number of individuals in each stage — Egg, Larva, Pupa, Adult, Dead — at time \(t\). Then, the population evolves according to:

\[ \mathbf{x}_{t+1} = \mathbf{x}_t P \]

where \(P\) is the transition matrix:

\[ P = \begin{bmatrix} p_{EE} & p_{EL} & p_{EP} & p_{EA} & p_{ED} \\ p_{LE} & p_{LL} & p_{LP} & p_{LA} & p_{LD} \\ p_{PE} & p_{PL} & p_{PP} & p_{PA} & p_{PD} \\ p_{AE} & p_{AL} & p_{AP} & p_{AA} & p_{AD} \\ p_{DE} & p_{DL} & p_{DP} & p_{DA} & p_{DD} \end{bmatrix} \]

Each row represents the current stage, and each column represents the next stage on the following day. For example, \(p_{LP}\) is the probability that a larva becomes a pupa in one day.


Life Stages in This Model

State Description Typical Duration Color
1 Egg 1–3 days Light blue
2 Larva 5–10 days Orange
3 Pupa 1–2 days Red
4 Adult 1–3 weeks Dark red
5 Dead Absorbing state Gray

The Dead state is absorbing — once entered, individuals remain there. The Adult stage contributes new eggs to the population through the reproduction rate parameter.


Conceptual Exploration: Before Using the App

Task 1

Reflect and discuss:

  1. What biological processes determine how mosquitoes move between life stages?
  2. Why might daily transition probabilities differ between stages (e.g., larval crowding, temperature effects)?
  3. Why do we include a “Dead” state in the model — and what does it mean mathematically for it to be absorbing?
  4. How does reproduction act as an external input rather than a transition?

Part 1 — Exploring the Transition Matrix

  1. Open the “Overview” tab and read through the background.
    • Each row of the transition matrix must sum to 1.
    • The probabilities represent development, survival, and mortality.
  2. In the left panel, click on the table cells to edit probabilities (in 0.05 increments).
    • Rows that do not sum to 1 will show a warning message.

Task 2

  • What does a larger diagonal entry \(p_{ii}\) imply about a stage’s stability (e.g., larvae remaining larvae)?
  • How does increasing \(p_{12}\) (Egg → Larva) change the speed of development?
  • What happens if mortality (probability to Dead) increases in any row?

Part 2 — Running the Simulation

  1. Keep the initial population at 100 individuals.
  2. Set the simulation length to 60 days.
  3. Keep mortality at 0.01 and reproduction rate at 0.5 eggs/adult/day.
  4. Click “Run Simulation” and watch the population change across stages.

Task 3

  • Which stage dominates early in the simulation?
  • Do you observe steady growth, decline, or oscillations in total population?
  • Why does the adult population not grow indefinitely, even with reproduction?

Part 3 — Varying Mortality and Reproduction

Now explore how environmental factors alter population outcomes.

  1. Increase mortality to 0.05 and rerun the model.
    • Observe how quickly the population declines.
  2. Set mortality = 0.01 but increase reproduction rate = 1.0.
    • Compare total population and stage composition over time.

Task 4

  • How sensitive is the total population size to changes in mortality vs. reproduction?
  • Which life stage’s survival appears most critical for population persistence?
  • What environmental scenarios might correspond to high or low mortality?

Part 4 — Understanding Stochasticity

This model uses multinomial sampling to represent daily survival and transitions. That means even with the same parameters, each run can produce slightly different results.

  1. Run the simulation several times with identical settings.
  2. Observe how much variation appears in the trajectories.

Task 5

  • What does this variability represent biologically?
  • How might random variation lead to different population fates in small mosquito populations?
  • Why might stochastic models better reflect real-world ecological dynamics than deterministic ones?

Part 5 — Experimenting with Development Rates

Try altering the transition probabilities between life stages:

  1. Increase \(p_{EL}\), \(p_{LP}\), and \(p_{PA}\) to simulate warmer conditions (faster development).
  2. Decrease these same probabilities to mimic cooler conditions.
  3. Compare total population trends under both scenarios.

Task 6

  • How does temperature (through development rate) affect the timing and amplitude of population peaks?
  • Why might warmer conditions lead to more overlapping generations?

Part 6 — Synthesis and Reflection

Task 7

  • What does the long-term population trend look like — stable, growing, or declining?
  • Which parameters (mortality, reproduction, or stage durations) most strongly control equilibrium size?
  • How could this type of model be extended to include disease transmission, predation, or control interventions?

Learning Outcomes

By the end of this lab, you should be able to:

  • Describe how a Markov chain represents biological life stages.
  • Interpret the transition matrix as a set of daily probabilities of survival and development.
  • Explain how mortality and reproduction affect mosquito population dynamics.
  • Recognize how stochasticity influences ecological outcomes.
  • Apply matrix-based reasoning to analyze complex population processes.