科研 Skill

种群动态建模

population-dynamics-modeling

Models population dynamics with logistic/exponential growth, Lotka-Volterra, matrix population models, mark-recapture abundance estimation. Use for quantitative population ecology.

发布者 Codar安全审核通过v0.1.0更新于 2026-11-18

SKILL.md

Population Dynamics Modeling

Purpose

Covers the standard quantitative tools for modeling how a population changes over time: simple growth models, multi-species interaction models, age/stage-structured matrix models, and estimating abundance from field mark-recapture data. These are core population-ecology methods (distinct from the species-occurrence and habitat-suitability focus of gbif-biodiversity, and from the community-composition focus of ecological-diversity-analysis) needed for questions like "is this population growing or declining," "what harvest/removal rate is sustainable," or "how many individuals are actually in this population given imperfect detection."

Use when a task involves projecting population size forward in time, fitting a growth or interaction model to time-series count data, or estimating true abundance from repeated capture surveys.

When to Use

  • Fitting exponential or logistic growth models to population count/density time series.
  • Modeling predator-prey or competing-species dynamics.
  • Projecting an age- or stage-structured population forward (e.g., for a species with distinct juvenile/adult survival and fecundity) and computing the population growth rate.
  • Estimating population abundance from mark-recapture or repeated count survey data where not every individual is detected.

Prerequisites

  • Python: numpy, scipy (for ODE integration via scipy.integrate.solve_ivp and curve fitting via scipy.optimize.curve_fit); pandas for data handling.
  • For mark-recapture estimation, the field-standard tools are R's RMark/Rcapture/secr packages or the standalone program MARK; Python has partial coverage (e.g., simple Lincoln-Petersen calculations by hand) but no equivalently complete mark-recapture ecosystem — use R/MARK for anything beyond closed-population two-sample estimators.
  • Time-series or capture-history data already organized (counts per time step, or individual capture histories per sampling occasion).

Workflow

1. Fit simple growth models

Exponential growth (unlimited resources): dN/dt = r*N, solution N(t) = N0 * exp(r*t).

Logistic growth (carrying capacity K): dN/dt = r*N*(1 - N/K).

from scipy.optimize import curve_fit
import numpy as np

def logistic(t, N0, r, K):
    return K / (1 + ((K - N0) / N0) * np.exp(-r * t))

popt, pcov = curve_fit(logistic, t_data, N_data, p0=[N_data[0], 0.1, max(N_data) * 1.5])
r_fit, K_fit = popt[1], popt[2]
  • Report parameter uncertainties from pcov (the covariance matrix), not just point estimates.
  • Check residuals for autocorrelation — ecological count time series often violate the independent-errors assumption behind naive nonlinear least squares; consider a state-space model (e.g., statsmodels unobserved-components models) if autocorrelation is strong.
  • Distinguish "fitting a growth model to observed counts" from "deriving r mechanistically from vital rates" (birth minus death rate) — the two can disagree if the population is not at the assumed equilibrium behavior the model implies.

2. Multi-species interaction models (Lotka-Volterra)

from scipy.integrate import solve_ivp

def lotka_volterra(t, y, alpha, beta, delta, gamma):
    prey, predator = y
    dprey = alpha * prey - beta * prey * predator
    dpred = delta * prey * predator - gamma * predator
    return [dprey, dpred]

sol = solve_ivp(lotka_volterra, [0, 100], [40, 9],
                 args=(1.1, 0.4, 0.1, 0.4), dense_output=True)
  • The classical Lotka-Volterra model produces neutral (non-damped) cycles that are structurally unstable to small perturbations — for anything beyond a qualitative/teaching illustration, use a model with density dependence in the prey term (e.g., Rosenzweig-MacArthur) to get biologically realistic damped or limit-cycle dynamics.
  • Fit interaction parameters to real paired time-series data with scipy.optimize on the ODE solution, not by eye; report parameter confidence intervals where possible (e.g., via bootstrap).

3. Structured population models (Leslie/Lefkovitch matrices)

import numpy as np

# Rows/cols ordered by age class or stage; entry [i, j] = contribution
# of class j to class i next time step (fecundity in row 0, survival
# probabilities on the subdiagonal)
leslie = np.array([
    [0.0, 0.5, 1.2],   # fecundity of age classes 0,1,2 into age 0
    [0.7, 0.0, 0.0],   # survival age 0 -> age 1
    [0.0, 0.6, 0.0],   # survival age 1 -> age 2
])

n = np.array([100, 40, 20])
n_next = leslie @ n

eigvals = np.linalg.eig(leslie)[0]
lambda1 = max(eigvals.real)  # asymptotic population growth rate
  • The dominant eigenvalue lambda1 of the projection matrix gives the asymptotic per-time-step growth rate: lambda1 > 1 growing, < 1 declining, = 1 stable.
  • Use a Leslie matrix for age-structured populations (fixed progression through age classes) and a Lefkovitch matrix for stage-structured populations (individuals can remain in a stage or skip stages, e.g., plants or indeterminate growers).
  • Sensitivity/elasticity analysis (how much lambda1 changes per unit or proportional change in each matrix entry) identifies which vital rate (e.g., juvenile vs. adult survival) most affects population growth — often more useful for conservation decisions than lambda1 alone. Compute via the standard formula sensitivity_ij = v_i * w_j / (v . w) where v, w are the dominant left/right eigenvectors.

4. Mark-recapture abundance estimation

  • Closed population, two samples (Lincoln-Petersen): N_hat = (n1 * n2) / m2 where n1 = marked in first sample, n2 = total caught in second sample, m2 = marked individuals recaught in second sample. Use the Chapman correction N_hat = ((n1+1)(n2+1)/(m2+1)) - 1 for small sample sizes to reduce bias.
  • Closed population, multiple samples: use closed-capture models (M0, Mt, Mb, Mh in program MARK or R's Rcapture) that allow for time-varying, behavioral, or individual heterogeneity in capture probability — a plain Lincoln-Petersen extension to many samples silently assumes constant, equal capture probability for everyone, which is rarely true in real field data.
  • Open population (births, deaths, migration between samples): Cormack-Jolly-Seber (CJS) models for survival and capture probability, or Pradel models for simultaneous survival and recruitment estimation — fit with R's RMark (wrapping program MARK) or marked/RCapture packages.
  • Always report the estimator's assumptions (population closure, equal catchability, no mark loss) and which, if any, are violated by the study design — this is usually a required discussion-section point for mark-recapture studies.

Limitations

  • ODE-based growth and interaction models assume continuous, deterministic dynamics; real populations have demographic and environmental stochasticity that these point-estimate models do not capture — for small populations or extinction-risk questions, a stochastic or individual-based model is more appropriate than a deterministic ODE.
  • Matrix population models assume a fixed matrix (constant vital rates) unless explicitly extended to a stochastic or density-dependent matrix model; density dependence, environmental variability, and demographic stochasticity require more advanced extensions not detailed here.
  • Mark-recapture estimation in Python covers only the simplest closed two-sample case by hand; production-quality mark-recapture analysis (time-varying capture probability, open-population survival models) requires R's RMark/Rcapture/secr or program MARK, which are not bundled with this skill.
  • Does not cover spatial capture-recapture (density estimation accounting for individual movement), which needs the secr package and additional spatial-design assumptions.

Quality Checklist

  • Growth-model fit reports parameter uncertainty, not just point estimates, and residuals checked for autocorrelation.
  • Lotka-Volterra or other interaction models state whether density dependence is included; pure classical LV cycles are flagged as structurally fragile if used.
  • Matrix population model's dominant eigenvalue interpreted correctly (growing/stable/declining) and, where relevant, sensitivity/elasticity reported alongside it.
  • Mark-recapture estimate states which closure/catchability assumptions apply and whether a bias correction (e.g., Chapman) was used.
  • Choice between closed- and open-population mark-recapture models matches whether the field study spans long enough for births/deaths/migration to matter.

示例提示词

帮我用logistic增长和矩阵种群模型评估这个种群的增长趋势。

所属插件

地球与环境科学面向地学、大气、海洋与生态研究:ERA5/CDS 气象数据、气候趋势、遥感与 GIS、水文、地震、空气质量、生物多样性与海洋绘图。

安装该插件会一并获得同领域的 18 个 Skill / MCP。

同插件的其他科研 Skill

常见问题

种群动态建模能做什么?

Models population dynamics with logistic/exponential growth, Lotka-Volterra, matrix population models, mark-recapture abundance estimation. Use for quantitative population ecology。

如何安装种群动态建模?

在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「种群动态建模」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。

种群动态建模需要哪些权限?

该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。

种群动态建模经过官方审核吗?

是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。