pjt222/agent-almanac/analyze-diffusion-dynamics
- community
Checking that the SKILL.md file is still in the repository.
Analyze the dynamics of diffusion processes using stochastic differential equations, Fokker-Planck equations, first-passage time distributions, and parameter sensitivity analysis. Use when deriving probability density evolution for a continuous-time diffusion process, computing mean first-passage times for bounded diffusion, analyzing how drift and diffusion parameters affect process behavior, or validating closed-form solutions against stochastic simulation.
Install
npx vskill@latest install pjt222/agent-almanac/analyze-diffusion-dynamicsSKILL.md
Analyze Diffusion Dynamics
Characterize the behavior of diffusion processes by specifying their stochastic differential equations, deriving the corresponding Fokker-Planck equation, computing first-passage time distributions analytically or numerically, performing parameter sensitivity analysis, and validating analytical results against Monte Carlo simulation.
Cuándo Usar
- Deriving the probability density evolution of a continuous-time diffusion process
- Computing mean first-passage times or full first-passage time distributions for bounded diffusion
- Analyzing how drift, diffusion coefficient, and boundary parameters affect process behavior
- Validating closed-form solutions against stochastic simulation
- Building intuition for the dynamics underlying drift-diffusion models or generative diffusion processes
Entradas
- Requerido: SDE specification (drift function, diffusion coefficient, domain/boundaries)
- Requerido: Parameter values or ranges for the drift and diffusion functions
- Requerido: Boundary conditions (absorbing, reflecting, or mixed)
- Opcional: Time horizon for transient analysis (default: auto-detect from dynamics)
- Opcional: Spatial discretization resolution for numerical PDE solvers (default: dx=0.001)
- Opcional: Number of Monte Carlo trajectories for simulation validation (default: 10000)
Procedimiento
Paso 1: Specify the SDE Model
Define the drift function, diffusion coefficient, and boundary conditions for the process.
- Write the SDE in standard Ito form:
where mu is the drift function, sigma is the diffusion coefficient, and W(t) is a standard Wiener process.
- Implement the SDE components in code:
- Define the initial condition:
- Validate parameter consistency:
Esperado: A fully specified SDE with finite drift values, strictly positive diffusion coefficient, and initial condition within the domain boundaries.
En caso de fallo: If the diffusion coefficient is zero or negative at any point in the domain, the process is degenerate -- check the functional form. If drift is infinite at a boundary, consider whether a reflecting boundary is more appropriate.
Paso 2: Derive the Fokker-Planck Equation
Convert the SDE to its equivalent partial differential equation for the probability density.
- Write the Fokker-Planck equation (FPE) for the transition density p(x, t):
- For constant coefficients (standard DDM case), this simplifies to:
- Implement numerical solution of the FPE via finite differences:
- Run and plot the evolving density:
Esperado: Density starts as a narrow peak at x0, spreads and drifts according to the SDE coefficients, and gradually decays as probability is absorbed at the boundaries. Survival probability decreases monotonically from 1 toward 0.
En caso de fallo: If the density develops oscillations or negative values, the time step is too large -- reduce dt. If density does not decay (survival stays near 1), the boundaries may be too far from x0 or drift pushes away from both boundaries. Check boundary conditions in the solver.
Paso 3: Compute First-Passage Time Distributions
Derive the distribution of times at which the process first reaches a boundary.
- Compute the first-passage time density from the survival function:
- For the standard DDM with constant drift, use the known analytic solution:
- Compute summary statistics of the FPT distribution:
- For two-boundary problems, separate FPT by boundary using probability flux at each absorbing wall (finite difference of density at the boundary grid points).
Esperado: FPT density is a right-skewed unimodal distribution. For the DDM with positive drift, the upper boundary FPT has more mass and a shorter mode than the lower boundary FPT. Mean FPT for typical DDM parameters (v=1, a=1.5, z=0.75) is approximately 0.5-2.0 seconds.
En caso de fallo: If the FPT density has negative values, the numerical differentiation is noisy -- apply a small Gaussian smoothing kernel. If total probability at both boundaries does not sum to approximately 1.0, either the time horizon is too short (increase t_max) or there is probability leakage in the solver.
Paso 4: Analyze Parameter Sensitivity
Quantify how changes in each parameter affect the first-passage time distribution.
- Define the parameter grid for sensitivity analysis:
- Sweep each parameter while holding others at baseline:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingi18n/es/skills/analyze-diffusion-dynamics/SKILL.md
Popularity
- Repository stars
- 24
- Repository forks
- 3
- 7-day trend score
- 16
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/pjt222/agent-almanac/analyze-diffusion-dynamics)