API for zoo - Incanter 2.0 (in development)

by David Edgar Liebke

Full namespace name: incanter.zoo

Overview

This is a port of Zoo from R in order to create the basis
of a library for time series data.

This library is built on Parallel Colt
(http://sites.google.com/site/piotrwendykier/software/parallelcolt),
an extension of the Colt numerics library
(http://acs.lbl.gov/~hoschek/colt/).

Public Variables and Functions



$$

function
Usage: ($$ ind ts)
       ($$ ind cols ts)
       ($$ ind-1 ind-2 cols ts)
This is the equivalent of :: in xts. That is, it slices out
the timeseries between ind-1 and ind-2. These are any values
that can be coerced into clj-time values.

    
    
    Source
  


aligned?

function
Usage: (aligned? & zs)
Is the :index column identical for all zs.

    
    
    Source
  


coredata

function
Usage: (coredata x)
Return the :rows of a dataset, with :index dissoc'd.
Intended to be used internally time series function to get at data.

    
    
    Source
  


lag

function
Usage: (lag z)
       (lag z n)
Return the timeseries lagged by n units or 1 if not specified.
No time calculations are made in the index column. The output
timeseries is of the same length as the input.

    
    
    Source
  


roll-apply

function
Usage: (roll-apply f n coll)
A generic function for applying a function to rolling window of a collection.

Arguments:
f -- function to be applied
n -- size of rolling window
coll -- collection of data

    
    
    Source
  


roll-max

function
Usage: (roll-max n coll)
Returns the rolling max of the previous n elements.

    
    
    Source
  


roll-mean

function
Usage: (roll-mean n coll)
Returns the unweighted mean of the previous n data points.

References:
http://en.wikipedia.org/wiki/Moving_average#Simple_moving_average
http://www.learningclojure.com/2010/03/moving-average-of-list.html

    
    
    Source
  


roll-median

function
Usage: (roll-median n coll)
Returns the rolling median of the previous n elements.

    
    
    Source
  


roll-min

function
Usage: (roll-min n coll)
Returns the rolling min of the previous n elements.

    
    
    Source
  


within-zoo?

function
Usage: (within-zoo? t z)
Is t between the first and last indices.

    
    
    Source
  


zoo

function
Usage: (zoo x)
       (zoo x index-col)
Return the given dataset as a zoo value which is simply a dataset
that contains an column of clj-time values specified by index-col,
default :index. That column must contain values that can be coerced
into Jodas using the TimeCoercible Protocol.

    
    
    Source
  


zoo-apply

function
Usage: (zoo-apply f n zoo column & args)
Behave as for roll-apply but accept a zoo and a single column
upon which to roll-apply f. Returns a zoo of the same length
as input zoo with pre-pended nils

    
    
    Source
  


zoo-row-map

function
Usage: (zoo-row-map f & zs)
Accept a number of aligned zoo object and pass them row-wise
into f, return a zoo. f must accept and return maps. The :index
column is stripped out before f is applied, and then replaced
afterwards with the :index of the first.

    
    
    Source
  


zoo-row-map-

function
Usage: (zoo-row-map- f & zs)
Accept a number of aligned zoo object and pass them row-wise into f,
return a seq of maps of the output of the output.
f must accept and return maps. The :index column is stripped out before
f is applied, and then replaced afterwards.

    
    
    Source
  


zoo-row-map-occupied

function
Usage: (zoo-row-map-occupied f & s)
zoo-row-map- and remove the empties. This returns a seq of maps

    
    
    Source
  
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.