Commit 09dd7f9
committed
Pre-allocate nns_arma recursive forecast buffer
Replace the per-step np.concatenate in the nns_arma recursive forecast
loop with a pre-allocated buffer and a length pointer. The previous
approach reallocated and copied the entire series on every horizon step
(O(N^2) over the horizon); writing into a fixed buffer and passing a
view of the populated prefix to the helpers is O(1) per step and leaves
the forecast math unchanged.1 parent d8df069 commit 09dd7f9
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
437 | 445 | | |
438 | 446 | | |
| 447 | + | |
439 | 448 | | |
440 | 449 | | |
441 | 450 | | |
| |||
496 | 505 | | |
497 | 506 | | |
498 | 507 | | |
499 | | - | |
| 508 | + | |
| 509 | + | |
500 | 510 | | |
501 | 511 | | |
502 | 512 | | |
| |||
0 commit comments