AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Censored Regression

skill-jskherman-engg-skills-censored-regression · by jskherman

>-

No reviews yet
0 installs
0 views
view→install

Install

$ agentstack add skill-jskherman-engg-skills-censored-regression

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-jskherman-engg-skills-censored-regression)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Censored Regression? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Censored Regression (Censored Normal / Censored Lognormal)

Overview

Many process lab measurements (H2S, COS, mercaptans, DMS, disulfides, unknown sulfur, trace metals) are reported as below-LOD, below-LOQ, above an instrument range, or within an interval. Ordinary least squares on log(S + epsilon) is biased and understates uncertainty; the correct treatment is a likelihood-based censored regression.

This skill provides:

  • A censored-normal regression on the log scale by default (censored lognormal

on the original response scale).

  • A censored-normal regression on the raw scale with --no-log.
  • Left, right, and interval censoring.
  • Maximum-likelihood fitting through SciPy.

The implementation uses a hand-rolled SciPy likelihood. It does not calculate standard errors, robust covariance estimates, or the naive substitution fit. Use bootstrap/profile-likelihood checks externally when inference quality matters.

Prerequisites

  1. uv available.
  2. The script declares numpy, scipy, and pandas in its PEP-723 header.
  3. On first use, writes LICENSE_NOTIFICATION.txt.

When to Use

  • Lab data has below-LOQ rows that you cannot drop without introducing

selection bias.

  • Reported values include intervals, for example between LOD and LOQ.
  • Fitting a regression of log(species) on operating variables, where the

species is sometimes censored.

Don't use for

  • Fully uncensored regression: use engineering-statistics.
  • Time-to-event survival analysis: use a survival-analysis package.
  • Compositional response data (sulfur speciation fractions): combine with

compositional-data-analysis.

Utility Scripts

  • uv run scripts/censored.py fit --data data.csv --response S_total --predictors temperature,c5_c6plus_balance --lower-col LOQ --output /tmp/fit.json
  • uv run scripts/censored.py interval --data data.csv --response S_total --predictors temperature --lower-col LOD --upper-col LOQ --output /tmp/int.json

Input CSV layout:

  • One row per observation.
  • response column with the measured value when fully observed; NaN or blank

when censored.

  • lower-col and/or upper-col columns with the censoring bound for censored

rows.

  • Predictor columns referenced by name in --predictors.

Censoring-column semantics used by the script:

  • finite response: exact observation; bounds ignored.
  • missing response + only lower-col finite: left-censored, meaning

y = upper_col (above-range row).

  • missing response + both bounds finite: interval-censored, meaning

`lower_col 80%), report only the censoring fraction and rank/order conclusions; full regression coefficients are unstable.

  • If the row order is a time series, use block bootstrap or a dynamic model for

uncertainty rather than i.i.d. inference.

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/censored_likelihood.md — likelihood derivation.
  • Greene, Econometric Analysis, chapter on truncated/censored models.
  • Helsel, Statistics for Censored Environmental Data Using MINITAB and R.

Anti-Patterns

  • Hiding the censoring fraction in the report.
  • Reporting a censored-lognormal coefficient as if it were on the original

response scale; by default, the response model is on log scale.

  • Using ordinary bootstrap on autocorrelated censored data without preserving

time dependence.

Source & license

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

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

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.