   [num-months]
   (i/bind-columns (ones-column num-months)
                   (seasonal-rows num-months)))
+
 
 (defn deseasonalize
   "deseasonalize a time-series [ts] using monthly dummies. returns

  (let [avg-seq (repeat (count ts) (average ts))
        X    (seasonal-matrix (count ts))
        fix  (i/mmult (variance-matrix X) (i/trans X) ts)
        adj  (i/mmult (i/sel X :except-cols 0) (i/sel fix :except-rows 0))
        ats  (i/plus avg-seq (i/minus ts adj))]
  ats))

; 
(def plot1 (c/line-chart (range (count test-ts)) (deseasonalize test-ts)))
; (c/add-lines plot1 (range 50) (range 50))

; WHOOPBANG

(defn whoop-cofactor
  "construct a matrix of cofactors; first column is comprised 
  of ones, second column is a range from 1 to [num-months].  The 
  result is a [num-months]x2 incanter matrix."
  [num-months]
  (i/trans (i/bind-rows (repeat num-months 1) (range 1 (inc num-months)))))


  [x]
  (i/matrix (repeat x 1)))

;De-seasonalize time-series

(defn seasonal-rows [n]
  "lazy sequence of monthly dummy vectors"
  (vec
   (take n (partition 11 1 (cycle (cons 1 (repeat 11 0)))))))

(defn seasonal-matrix
  "create a matrix of [num-months]x11 of monthly dummies, where
