Timeseries

class alan.Timeseries(init, trans)[source]

In progress!!!!

See examples/timeseries.py

Parameters:
  • init (str) – string, representing the initial state as a random variable. This random variable must have been sampled in the immediately above plate.

  • trans (Dist) – transition distribution.

As an example:

Plate(
    ts_init = Normal(0., 1.),
    T = Plate(
        ts = Timeseries('ts_init', Normal(lambda ts: 0.9*ts, 0.1)),
    )
)

In the exmplae:

  • T is the plate (i.e. all_platesizes['T']) is the length of the timeseries. Note that this is a slight abuse of the term “Plate”, which is usually only used to refer to independent variables.

  • ts is the name of the timeseries random variable itself.

  • Normal(lambda ts: 0.9*ts, 0.1) is the transition distribution. Note that it refers to the previous step of itself using the timeseries name itself, ts, as an argument.

  • ts_init is the initial state. Must be a string representing a random variable in the previous plate.

Non-split implementation notes:

  • Non-split log_PQ_plate returns a K_ts_init tensor.

  • Splitting log_PQ_plate:

    • Uses a backward pass, so at the start of the backward pass, we sum from the back.

    • At the start of the backward pass, log_PQ_plate takes one unusual input: initial timeseries state, with dimension K_ts. If initial timeseries state is provided as a kwarg, we ignore Timeseries.init.

    • log_PQ_plate returns K_ts dimensional tensor, resulting from summing all the way from the back to the start of the split.

    • The next split takes two unusual arguments: the initial state, and the log_pq from the last split evaluated by the backward pass.

Note

You can’t currently split along a timeseries dimension (and you may never be able to).

Note

OptParam and QEMParam are currently banned in timeseries.