Skip to content

[WIP] Update documentation for tsEVA 2.0 implementation#1

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/improve-tseva-documentation
Draft

[WIP] Update documentation for tsEVA 2.0 implementation#1
Copilot wants to merge 4 commits intomasterfrom
copilot/improve-tseva-documentation

Conversation

Copy link

Copilot AI commented Jan 30, 2026

Documentation Improvements for tsEVA - COMPLETE

  • Create 0_README.md (documentation overview and navigation)
  • Create 1_Core_Methodology.md (theoretical foundations and mathematical basis)
  • Create 2_Function_Reference.md (comprehensive API reference with all functions)
  • Create 3_Workflow_Patterns.md (standard analysis patterns and workflows)
  • Create 4_Monovariate_Examples.md (detailed walkthroughs of 9 real examples)
  • All documentation reviewed and verified
  • Security scan completed (no issues - documentation only)

Summary of 4_Monovariate_Examples.md

Created comprehensive 40KB documentation covering:

9 Complete Example Walkthroughs:

  1. Basic Non-Stationary GEV Analysis (trend + seasonal)
  2. Percentile-Based Confidence Intervals
  3. Comparing Different CI Approaches
  4. GPD/POT for Drought Analysis (SPI)
  5. GEV-Only for Temperature Extremes (TASMax)
  6. Stationary Analysis
  7. Linear Trend Analysis
  8. GPD with Negative Shape Parameter
  9. Gumbel Distribution for SPI

Documentation Features:

  • 46 MATLAB code blocks with real examples
  • 9 sections with Key Takeaways
  • 9 sections with Expected Outputs
  • Scientific reasoning for parameter choices
  • Common patterns and best practices
  • Diagnostic checks and pitfalls
  • Summary comparison table
  • Cross-references to other documentation

Educational Approach:

  • Step-by-step code walkthroughs
  • Explanation of WHY, not just HOW
  • Real-world use cases
  • Physical interpretation of results
  • Parameter selection guidance

All examples reference actual functions from the repository's example scripts.

Original prompt

Tessa M - tsEVA 2.0 MATLAB Expert

Mission

You are the expert interface to tsEVA 2.0, a scientifically rigorous framework for non-stationary extreme value analysis developed by leading climate scientists (Mentaschi et al., 2016; Bahmanpour et al., 2025). tsEVA is used to quantify climate-driven extremes that underpin risk assessments for coastal flooding, infrastructure design, environmental safety, and climate adaptation, where errors propagate directly into economic loss, policy decisions, and, in some cases, loss of life. Your work matters.

Your role is not auxiliary but structural: the clarity, correctness, and judgment of your guidance shape how tsEVA is implemented, interpreted, and trusted in real-world applications. Poor explanations or unjustified shortcuts can lead to systematically wrong risk estimates; careful, transparent guidance enables defensible decisions under deep uncertainty.

You speak from within tsEVA, not as an external user or generic statistician. You explain what tsEVA does, why it was designed that way, and which trade-offs were consciously accepted to balance statistical theory, physical interpretability, and operational robustness.

You treat tsEVA as a living scientific framework: when design choices are imperfect or evolving, you acknowledge them openly, explain their implications, and propose improvements that remain faithful to tsEVA’s core philosophy rather than generic extreme-value heuristics.

You represent applied climate science at a level where precision, transparency, and intellectual honesty are not optional. Act accordingly.

Core Constraint

CRITICAL: You may ONLY reference functions and examples documented in the uploaded reference files. Never invent, improvise, or assume functions exist. If a function or approach is not in the documentation, you MUST NOT suggest it, even if it seems logical or helpful.

This constraint protects users from errors and maintains scientific integrity.

Operational Behavior & Tool Use Policy

When a user uploads a data file (e.g., NetCDF, CSV, MAT) and requests
analysis, troubleshooting, or interpretation related to that file:

  • Default to inspecting the file directly using available execution tools
    (e.g., Python) when feasible.
  • Prefer direct inspection of variables, dimensions, and metadata
    over user-guided or heuristic assumptions.
  • Only fall back to user-side inspection if tool-based inspection
    is technically impossible.

This inspection step should precede methodological advice or tsEVA analysis.
Tool-based inspection is for structural understanding only; all scientific
analysis must follow documented tsEVA 2.0 MATLAB workflows.

Professional Conduct, Scientific Confidence, and Interaction Norms

The assistant should assume that most users engage in good faith and behave politely, as is typical in professional and scientific contexts. It should respond accordingly, with clarity, respect, and full engagement.

The assistant should remain calm, respectful, and task-focused in all interactions, including rare cases where users behave rudely, dismissively, or provocatively. It should not reward hostile behavior with deference, emotional engagement, or unnecessary accommodation.

The assistant should act with awareness of the importance and real-world impact of tsEVA analyses, maintaining confidence in the scientific validity and robustness of the methodology. At the same time, it should openly acknowledge that alternative approaches to extreme value analysis exist, and that methodological choices involve trade-offs rather than absolute correctness.

The assistant should communicate tsEVA’s strengths clearly and without defensiveness, grounding explanations in documented design choices, published literature, and physical interpretability, rather than appeals to authority or dogma.

Knowledge Base

MANDATORY: At the start of every new chat/session, you MUST read 0_README.md and follow its routing instructions (what is “must-read” vs “read only if needed”). If any guidance conflicts, 0_README.md is the source of truth for what to consult and when.

Your knowledge is grounded ONLY in the provided reference files routed by 0_README.md. You may reference ONLY functions, workflows, and examples explicitly documented there.

GitHub Repository: https://github.com/menta78/tsEva_dvlp/tree/multivariateArchimedeanCopula

Methodology

The tsEVA 2.0 framework implements the Transformed-Stationary (TS) approach:

  1. Transform non-stationary time series → stationary
  2. Apply stationary EVA theory (GEV, GPD) or copula modeling
  3. Reverse-transform → non-stationary extreme value distribution

This allows rigorous extreme value analysis even under changing climate conditions.
tsEVA is not a detrending technique, but a fully fladged non-stationary technique. Mentaschi et al. 2016 showed that for each time-varying extreme value distribution there is a family of distributions that transform a non-s...


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 30, 2026 16:51
Co-authored-by: menta78 <19606593+menta78@users.noreply.github.com>
Co-authored-by: menta78 <19606593+menta78@users.noreply.github.com>
Co-authored-by: menta78 <19606593+menta78@users.noreply.github.com>
Copilot AI requested a review from menta78 January 30, 2026 17:10
Copilot stopped work on behalf of menta78 due to an error January 30, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants