# Time Series Process Data Analysis

> >-

- **Type:** Skill
- **Install:** `agentstack add skill-jskherman-engg-skills-time-series-process-data-analysis`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [jskherman](https://agentstack.voostack.com/s/jskherman)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [jskherman](https://github.com/jskherman)
- **Source:** https://github.com/jskherman/engg-skills/tree/main/skills/time-series-process-data-analysis

## Install

```sh
agentstack add skill-jskherman-engg-skills-time-series-process-data-analysis
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Time-Series Diagnostics and Block Bootstrap for Process Data

## Overview

Process data are almost always autocorrelated, which means ordinary i.i.d.
inference (Wald CIs, t-tests, normal CIs) understates uncertainty. This
skill provides:

- Sample ACF and PACF.
- A simple block-length heuristic (`2 × first lag where |rho| < 2/sqrt(n)`).
- Moving-block bootstrap (Kuensch 1989) for built-in statistics exposed by
  the CLI: mean, median, standard deviation, minimum, and maximum.

The ACF/PACF are useful for picking residual-autocorrelation orders for
regressions and for selecting a sensible block length.

## Prerequisites

1. `uv` available.
2. On first use, the script writes `LICENSE_NOTIFICATION.txt`.

## When to Use

- Computing a CI for the mean of a daily lab series.
- Diagnosing autocorrelation before using a separate regression workflow.
- Diagnosing the order of a residual AR(p) for ARIMA / DLM modelling.
- Picking a block length for downstream block-bootstrap procedures.

## Don't use for

- Stationary white-noise data — use `engineering-statistics`.
- Forecasting future values — use a state-space model.
- Strongly non-stationary data — pre-process (detrend, deseasonalise) first.

## Utility Scripts

- `uv run scripts/ts.py acf --data series.csv --column y --max-lag 30 --output /tmp/acf.json`
- `uv run scripts/ts.py pacf --data series.csv --column y --max-lag 30 --output /tmp/pacf.json`
- `uv run scripts/ts.py block-len --data series.csv --column y --output /tmp/L.json`
- `uv run scripts/ts.py bootstrap --data series.csv --column y --block-length 8 --n-resamples 2000 --statistic mean --output /tmp/bs.json`

## Procedure

1. Compute ACF and PACF; eyeball the lag structure.
2. Pick a block length:
   - Use the `block-len` helper as a starting point.
   - For short series (< 200), constrain block length to ≤ n/4.
   - For long series, consider Politis-White optimal block length
     (not implemented; use `statsmodels` if needed).
3. Choose a supported statistic (`mean`, `median`, `std`, `min`, or `max`).
4. Run the bootstrap. Compare the bootstrap SE / CI against the i.i.d.
   counterpart; the bootstrap should be wider for positively autocorrelated
   data.
5. Report both intervals for transparency.

## Pitfalls

- Using ordinary bootstrap (i.i.d. resampling) on autocorrelated data; the
  CI is too narrow.
- Using a tiny block length (e.g. 2-3) for very autocorrelated data; the
  CI is still too narrow.
- Using a huge block length (≥ n/4); the bootstrap has very few effective
  resamples and the CI is unreliable.
- Reporting block-bootstrap CIs without specifying the block length.
- Treating the PACF as if it were independent of ACF; they are connected
  by the Durbin-Levinson recursion.
- Treating spikes outside `±2/sqrt(n)` as automatically meaningful; the
  multiple-testing rate is not controlled.
- Failing to detrend / deseasonalise before computing ACF; non-stationary
  trends inflate the ACF.

## Fallback Strategies

- If the series is too short for block bootstrap (<50), report the i.i.d.
  CI with a warning that it likely understates uncertainty.
- If `statsmodels` is available, use it for ARIMA-style residual diagnostics
  (not implemented here).

## Verification

- Run the listed script with representative inputs and an `--output` file when a deterministic calculation is available.
- Confirm the JSON result contains `ok: true`, expected units, and no unhandled warnings.
- Check result magnitudes against the stated assumptions, references, and a hand calculation or known operating range before reporting them.

## References

- `references/methods_notes.md` — block-bootstrap derivation, references.
- Kuensch, H. R. "The Jackknife and the Bootstrap for General Stationary
  Observations," Annals of Statistics, 1989.
- Politis & Romano, *Subsampling*.

## Anti-Patterns

- Quoting "p < 0.05" on a process-data regression without addressing
  autocorrelation.
- Designing SPC limits assuming independence on data that is clearly
  serially correlated.
- Using the bootstrap to "rescue" a model that is misspecified.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [jskherman](https://github.com/jskherman)
- **Source:** [jskherman/engg-skills](https://github.com/jskherman/engg-skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-jskherman-engg-skills-time-series-process-data-analysis
- Seller: https://agentstack.voostack.com/s/jskherman
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
