incline.TrendEstimate

class incline.TrendEstimate(axis, values, derivative, order, provenance, se=None, ci_lower=None, ci_upper=None, confidence_level=0.95, index=None)[source]

A smoothed series and the derivative of that smooth, with uncertainty.

Variables:
  • axis (TimeAxis) – The time axis the estimate lives on.

  • values (npt.NDArray[np.float64]) – The smoothed series.

  • derivative (npt.NDArray[np.float64]) – The derivative of the smooth, per unit of axis.x.

  • order (int) – Which derivative derivative holds.

  • provenance (Provenance) – How the estimate was produced.

  • se (npt.NDArray[np.float64] | None) – Standard error of derivative, or None when unavailable.

  • ci_lower (npt.NDArray[np.float64] | None) – Lower interval bound, or None.

  • ci_upper (npt.NDArray[np.float64] | None) – Upper interval bound, or None.

  • confidence_level (float) – Confidence level of the interval.

  • index (pd.Index | None) – Original pandas index, preserved for to_frame.

Parameters:
  • axis (TimeAxis)

  • values (npt.NDArray[np.float64])

  • derivative (npt.NDArray[np.float64])

  • order (int)

  • provenance (Provenance)

  • se (npt.NDArray[np.float64] | None)

  • ci_lower (npt.NDArray[np.float64] | None)

  • ci_upper (npt.NDArray[np.float64] | None)

  • confidence_level (float)

  • index (pd.Index | None)

__init__(axis, values, derivative, order, provenance, se=None, ci_lower=None, ci_upper=None, confidence_level=0.95, index=None)
Parameters:
  • axis (TimeAxis)

  • values (npt.NDArray[np.float64])

  • derivative (npt.NDArray[np.float64])

  • order (int)

  • provenance (Provenance)

  • se (npt.NDArray[np.float64] | None)

  • ci_lower (npt.NDArray[np.float64] | None)

  • ci_upper (npt.NDArray[np.float64] | None)

  • confidence_level (float)

  • index (pd.Index | None)

Return type:

None

Methods

__init__(axis, values, derivative, order, ...)

to_frame([source])

Render the estimate as a DataFrame.

with_uncertainty(se, se_method[, ci_lower, ...])

Return a copy carrying uncertainty.

Attributes

ci_lower

ci_upper

confidence_level

has_uncertainty

Whether this estimate carries a standard error.

index

se

significant

Where the interval excludes zero.

axis

values

derivative

order

provenance

axis: TimeAxis
values: npt.NDArray[np.float64]
derivative: npt.NDArray[np.float64]
order: int
provenance: Provenance
se: npt.NDArray[np.float64] | None = None
ci_lower: npt.NDArray[np.float64] | None = None
ci_upper: npt.NDArray[np.float64] | None = None
confidence_level: float = 0.95
index: pd.Index | None = None
property has_uncertainty: bool

Whether this estimate carries a standard error.

property significant: NDArray[bool]

Where the interval excludes zero.

All False when no interval was computed – absence of evidence is not reported as a significant trend.

A zero standard error also yields False. That case arises when the noise level is estimated as exactly zero, which means there is no evidence about the noise rather than evidence of no noise. The interval then collapses onto the point estimate, and without this guard a derivative of 3e-17 – floating-point dust on a flat line – excludes zero and gets reported as a significant trend at every point.

to_frame(source=None)[source]

Render the estimate as a DataFrame.

Parameters:

source (DataFrame | None) – The original input frame. When given, its columns are preserved and the estimate’s columns appended.

Returns:

A frame carrying every column in CORE_COLUMNS, plus the smoother’s own parameters.

Return type:

DataFrame

with_uncertainty(se, se_method, ci_lower=None, ci_upper=None, confidence_level=0.95, noise=None, simultaneous=False)[source]

Return a copy carrying uncertainty.

When ci_lower/ci_upper are omitted a normal-theory interval is built from se. Bootstrap percentile intervals are not symmetric about the point estimate, so those are passed explicitly.

Parameters:
  • se (NDArray[float64] | None) – Standard errors, or None.

  • se_method (str | None) – Label recorded in provenance.

  • ci_lower (NDArray[float64] | None) – Explicit lower bounds.

  • ci_upper (NDArray[float64] | None) – Explicit upper bounds.

  • confidence_level (float) – Confidence level for a normal-theory interval.

  • noise (str | None) – Description of the noise model used.

  • simultaneous (bool) – Whether the band is simultaneous.

Returns:

A new TrendEstimate.

Return type:

TrendEstimate