pub struct EventData { /* private fields */ }Expand description
Event-indexed dataset with irregular event times and mark columns.
Integer lag algorithms must not treat event indices as regular time steps
(§5.4). Use Self::align_to_grid (duration bins), or native event models.
Implementations§
Source§impl EventData
impl EventData
Sourcepub fn try_new(
storage: OwnedColumnarStorage,
event_times_ns: impl Into<Arc<[i64]>>,
) -> Result<Self, DataError>
pub fn try_new( storage: OwnedColumnarStorage, event_times_ns: impl Into<Arc<[i64]>>, ) -> Result<Self, DataError>
Construct from mark/covariate storage and event timestamps.
§Errors
Length mismatch, empty data, or timestamps that are not non-decreasing.
Sourcepub fn event_times_ns(&self) -> &[i64]
pub fn event_times_ns(&self) -> &[i64]
Event timestamps (nanoseconds).
Sourcepub fn storage(&self) -> &OwnedColumnarStorage
pub fn storage(&self) -> &OwnedColumnarStorage
Borrow mark / covariate storage.
Sourcepub const fn regularity(&self) -> SamplingRegularity
pub const fn regularity(&self) -> SamplingRegularity
Sampling regularity is always irregular for event data.
Sourcepub fn reject_integer_lag_planning(&self) -> Result<(), DataError>
pub fn reject_integer_lag_planning(&self) -> Result<(), DataError>
Reject integer-lag sample planning (lags are not durations on irregular data).
§Errors
Always returns DataError::InvalidArgument.
Sourcepub fn align_to_grid(
&self,
interval_ns: u64,
) -> Result<TimeSeriesData, DataError>
pub fn align_to_grid( &self, interval_ns: u64, ) -> Result<TimeSeriesData, DataError>
Align irregular events onto a regular grid via duration bins.
Bins are half-open intervals [t0 + k·Δ, t0 + (k+1)·Δ) covering
[t0, t_last] where t0 / t_last are the first / last event times and
Δ = interval_ns. Within each bin the last event’s mark values are
kept. Empty bins are marked invalid (value zeroed).
The result is a regular TimeSeriesData suitable for integer-lag
temporal discovery / identification / estimation.
§Errors
Zero interval, empty events, or column construction failures.
Trait Implementations§
Source§impl TableView for EventData
impl TableView for EventData
Source§fn schema(&self) -> &CausalSchema
fn schema(&self) -> &CausalSchema
Source§fn column(&self, id: VariableId) -> Result<ColumnView<'_>, DataError>
fn column(&self, id: VariableId) -> Result<ColumnView<'_>, DataError>
id. Read moreSource§fn float64_values(&self, id: VariableId) -> Result<Vec<f64>, DataError>
fn float64_values(&self, id: VariableId) -> Result<Vec<f64>, DataError>
f64 buffer. Read more