   ([start-idx series]
      (let [elems (count series)]
        (timeseries-value start-idx
-                         (dec (+ start elems))
+                         (dec (+ start-idx elems))
                          series)))
   ([start-idx end-idx series]
      (when series

        (update-in [:avg-t-stat]     u/weighted-mean t-stat 1)
        (update-in [:min-short-drop] min short)
        (update-in [:min-long-drop]  min long)
        (update-in [:min-t-stat]     min t))))

(defn combine-neighbors
  "Returns a new forma neighbor value generated by merging together

(ns forma.schema
  (:require [clojure.string :as s]
            [forma.utils :as u]
            [forma.reproject :as r]
            [forma.date-time :as date]))

(defn boundaries
  "Accepts a sequence of pairs of <initial time period, collection>
