科研 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.
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 viascipy.integrate.solve_ivpand curve fitting viascipy.optimize.curve_fit);pandasfor data handling. - For mark-recapture estimation, the field-standard tools are R's
RMark/Rcapture/secrpackages 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.,
statsmodelsunobserved-components models) if autocorrelation is strong. - Distinguish "fitting a growth model to observed counts" from
"deriving
rmechanistically 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.optimizeon 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
lambda1of the projection matrix gives the asymptotic per-time-step growth rate:lambda1 > 1growing,< 1declining,= 1stable. - 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
lambda1changes 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 thanlambda1alone. Compute via the standard formulasensitivity_ij = v_i * w_j / (v . w)wherev,ware the dominant left/right eigenvectors.
4. Mark-recapture abundance estimation
- Closed population, two samples (Lincoln-Petersen):
N_hat = (n1 * n2) / m2wheren1= marked in first sample,n2= total caught in second sample,m2= marked individuals recaught in second sample. Use the Chapman correctionN_hat = ((n1+1)(n2+1)/(m2+1)) - 1for small sample sizes to reduce bias. - Closed population, multiple samples: use closed-capture models
(
M0,Mt,Mb,Mhin program MARK or R'sRcapture) 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) ormarked/RCapturepackages. - 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/secror program MARK, which are not bundled with this skill. - Does not cover spatial capture-recapture (density estimation
accounting for individual movement), which needs the
secrpackage 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增长和矩阵种群模型评估这个种群的增长趋势。
所属插件
安装该插件会一并获得同领域的 18 个 Skill / MCP。
同插件的其他科研 Skill
- OpenAQ空气质量分析Accesses OpenAQ air quality data (PM2.5, O3, NO2), runs spatial interpolation, health exposure indices, city comparisons. Use for air pollution monitoring and exposure analysis.
- Copernicus气候数据下载Downloads climate/weather data from the Copernicus Climate Data Store (ERA5, seasonal forecasts) via cdsapi, covering API setup and request splitting. Use for any CDS/ECMWF download.
- 气候趋势检验分析Runs climate trend analysis: Mann-Kendall test, Sen’s slope, extreme indices (RX1day, R10mm), percentile thresholds, IPCC-style figures. Use to detect and visualize climate trends.
- 生态多样性群落分析Computes community-ecology diversity metrics and ordination: Shannon/Simpson indices, rarefaction, NMDS/PCoA, PERMANOVA. Use when analyzing species-by-site community composition data.
- ERA5再分析气候数据Downloads and analyzes ERA5 reanalysis data via the Copernicus CDS API: anomalies, trends, publication-quality climate maps. Use for ERA5-specific climate analysis end to end.
- GBIF物种分布建模Queries GBIF occurrence records, applies spatial thinning, and fits species distribution models (MaxEnt, BRT) with pygbif/geopandas/elapid. Use for occurrence and habitat-suitability analysis.
- 综合地理空间科学分析Covers broad geospatial workflows: satellite imagery, vector/raster GIS, spatial ML, point clouds, cloud-native formats (STAC, COG). Use as a general entry point for remote sensing or GIS tasks.
- GeoPandas矢量GIS分析Performs vector GIS analysis with GeoPandas: spatial joins, overlays, buffer/dissolve, choropleth maps, rasterio integration. Use for vector spatial analysis and raster-vector workflows.
- DEM水文地貌分析Runs DEM-based hydrological analysis with pysheds: watershed delineation, flow direction/accumulation, stream networks, runoff estimation. Use for terrain-driven hydrology modeling.
- 海洋碳酸盐化学Computes seawater carbonate chemistry with PyCO2SYS: pH, pCO2, aragonite/calcite saturation, air-sea CO2 flux. Use for ocean carbon-cycle and acidification analysis.
- MetPy大气探空分析Performs atmospheric analysis with MetPy/Siphon: downloads NWP data, plots skew-T log-P diagrams, computes CAPE/CIN, builds synoptic composites. Use for weather-sounding meteorology analysis.
- 地震波形数据处理Analyzes seismological data with ObsPy: waveform download, filtering, P/S phase picking, moment magnitude, spectral analysis. Use for earthquake and seismic-waveform analysis.
- 海洋再分析数据分析Downloads and analyzes oceanographic data from Copernicus Marine Service and Argo floats with gsw/xarray: mixed layer depth, eddy kinetic energy, T-S diagrams. Use for physical oceanography.
- 物理海洋学论文绘图绘制物理海洋学论文图:区域/全球/极地地图、多面板、垂向剖面、Hovmöller图、cmocean配色与期刊版式。投稿级海洋学图件排版和配色时使用。
- QGIS自动化地理处理Drives QGIS (PyQGIS, processing, GDAL) for GIS/remote sensing tasks: raster/vector ops, spectral indices, reprojection, zonal statistics, map layouts. Use for any QGIS-based geospatial task.
- 多光谱遥感影像处理Reads, reprojects, and analyzes multispectral GeoTIFF imagery with rioxarray/rasterio: NDVI/EVI, cloud masking, mosaicking, Cloud-Optimized GeoTIFF export. Use for raster remote-sensing processing.
- Google Earth Engine卫星分析Runs Google Earth Engine satellite analysis with geemap/ee: NDVI time series, land-cover classification, change detection, GeoTIFF export. Use for cloud-based large-scale satellite analysis.
常见问题
种群动态建模能做什么?
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 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。