epinowcast
Loading...
Searching...
No Matches
filt_obs_indexes.stan File Reference

Go to the source code of this file.

Functions

array[] int filt_obs_indexes (int start, int end, array[] int csl, array[] int sl)
 

Function Documentation

◆ filt_obs_indexes()

array[] int filt_obs_indexes ( int  start,
int  end,
array[]int  csl,
array[]int  sl 
)

Find the contiguous interval of flattened observations

Identifies the range of contiguous observation indexes in a flattened observation array between two specified snapshot IDs. The function calculates the starting and ending indexes of the observations corresponding to the snapshots and determines the length of this interval.

Parameters
startThe ID of the starting snapshot.
endThe ID of the ending snapshot.
cslArray of cumulative start indexes for each snapshot.
slArray of start index for each observation period.
Returns
An array containing three elements: the index of the first observation in the starting snapshot, the index of the last observation in the ending snapshot, and the total number of observations in the interval.
Note
This function is particularly useful in contexts where data is segmented into snapshots and needs to be processed or analyzed over continuous intervals.

Definition at line 25 of file filt_obs_indexes.stan.