I didn't see this coming:
ClearAll[randomTimeSeries]
randomTimeSeries[seed_ : RandomInteger[{10^6, 10^7}], m_ : 3, n_ : 30,iRandRng_ : {1, 7}] :=
Module[{ds, vs, junk, ts},
{junk, {ts}} = Do[
BlockRandom[
ds = NestList[(DatePlus[#, -RandomInteger[iRandRng]] &), AbsoluteTime[], n - 1] // Reverse;
vs = RandomReal[{0, 1}, n] // Accumulate;
TimeSeries[vs, {ds}, ResamplingMethod -> {"Interpolation", 0}, MetaInformation -> {"seed" -> seed + j}] // Quiet /* Sow,
RandomSeeding -> seed + j], {j, 1, m}] // Reap;
ts // (TimeSeriesThread[Mean, #] &)
]
Every single time I evaluate randomTimeSeries[RandomInteger[{10^6, 10^7}]] // Accumulate
I get
- Error messages about interpolation even though I am using
Quiet
- High memory and CPU usage and
- The Kernel quits with messages about there being insufficient memory
I'm on Win10, using v.12.1.
Does anybody know whats going on ?
Quiet
? It really threw my schedule out the window today but I think the problem is due to the fact that there are non-regular series involved; usingTemporalRegularity->True
seems to make the Kernel happy $\endgroup$