Skip to content

How to calculate time steps from a time series

Zakariyya Mughal edited this page Jan 5, 2015 · 1 revision

Suppose you have a time series. For example, you've tracked your health really well and noted when you come down with a cold; you want to know the average time you tend to go without a cold. Or, you've got measurement data from a Geiger-counter that clicks whenever it detects a particle, and you want to characterize the distribution of times between events.

If you were to tackle this problem like a C programmer, you'd probably try something like this, which works but is not the PDL way:

 $time_series = when_I_get_colds();
 $gone_without = zeroes($time_series->nelem - 1);

for($i = 0; $i

use

d NiceSlice in all of these.

To do: discuss using Inline::Pdlpp

Clone this wiki locally