The data is first partitioned into \(k+1\) sequential blocks \(B_1\) to
\(B_{k+1}\). Each fold consists of two index vectors: one with in-sample row numbers,
the other with out-of-sample row numbers. The first fold uses \(B_1\) as in-sample
and \(B_2\) as out-of-sample data. The second one uses either \(B_2\)
(if type = "moving") or \(\{B_1, B_2\}\) (if type = "extending")
as in-sample, and \(B_3\) as out-of-sample data etc. Finally, the kth fold uses
\(\{B_1, ..., B_k\}\) ("extending") or \(B_k\) ("moving") as in-sample data,
and \(B_{k+1}\) as out-of-sample data. This makes sure that out-of-sample data
always follows in-sample data.