Timeseries namespaces; all timeseries are lazy, potentially infinite sequences of numeric values.
Timeseries namespaces; all timeseries are lazy, potentially infinite sequences of numeric values.
(arma-seq {:keys [std phi theta c seed] :as arma-model})
ARMA - AutoRegressive-Moving-Average - sequence generation.
An ARMA model describes a stochastic process in terms of two polynomials: the autogregression term and the moving average term. The model is written as such:
X_t = epsilon_t + SUM(phi_i X_t-i, i=1, p) + SUM(theta_i epsilon_t-i, i=1, q)
where X_t
is the t
-th value, epsilon_i
are white noise parameters and
phi_i
and theta_i
are the central parameters for the AR and MA models,
respectively.
Besides :phi
and :theta
, which are colls of p
and q
double values
respectively, the arma-model
option map also has these additional params:
:std
, the standard deviation of the Gaussian distribution from which each
epsilon_t
is sampled from (the mean is fixed at zero):seed
, the seed to create the epsilon_t
-generating RNG with.:c
, a constant to add to each result X_t
Returns an infinite lazy seq of ARMA values.
ARMA - AutoRegressive-Moving-Average - sequence generation. An ARMA model describes a stochastic process in terms of two polynomials: the autogregression term and the moving average term. The model is written as such: ``` X_t = epsilon_t + SUM(phi_i X_t-i, i=1, p) + SUM(theta_i epsilon_t-i, i=1, q) ``` where `X_t` is the `t`-th value, `epsilon_i` are white noise parameters and `phi_i` and `theta_i` are the central parameters for the AR and MA models, respectively. Besides `:phi` and `:theta`, which are colls of `p` and `q` double values respectively, the `arma-model` option map also has these additional params: - `:std`, the standard deviation of the Gaussian distribution from which each `epsilon_t` is sampled from (the mean is fixed at zero) - `:seed`, the seed to create the `epsilon_t`-generating RNG with. - `:c`, a constant to add to each result `X_t` Returns an infinite lazy seq of ARMA values.
(time-seqs &
{:keys [t-zero sample-ms zone]
:or {t-zero 0 zone (t/zone-id "UTC")}})
Given a :t-zero
(simulation start), an exclusive upper bound of
:sample-ms
milliseconds and an optional local time zone
, return a map
of useful lazy time sequences. (Note that since these are lazy seqs, we do
not waste performance overhead on unused sequences.)
There are three kinds of sequences: sequences of milliseconds (intervals being equal to the time unit used); cyclic sequences of time with relation to the larger unit; and sinusoidal sequences of time with relation to the day-night cycle, where 1.0 represents midnight, -1.0 represents noon, positive numbers nighttime, and negative numbers daytime.
Time sequences in the returned map:
Sequence Key | Description |
---|---|
:milliseconds-seq | Sequence of epoch milliseconds since t-zero (e.g. (0 1 2 ...) ) |
:second-ms-seq | Sequence of epoch ms with an interval of one second (e.g. (0 1000 ...) ) |
:minute-ms-seq | Sequence of epoch ms with an interval of one minute (e.g. (0 60000 ...) ) |
:hour-ms-seq | Sequence of epoch ms with an interval of one hour (e.g. (0 3600000 ...) ) |
:day-ms-seq | Sequence of epoch ms with an interval of one day (e.g. (0 86400000 ...) ) |
:week-ms-seq | Sequence of epoch ms with an interval of one week (e.g. (0 604800000 ...) ) |
:minute-of-hour-seq | Cyclic sequence of minutes per hour (e.g. (0 1 ... 59 0 ...) ) |
:minute-of-day-seq | Cyclic sequence of minutes per day (e.g. (0 1 ... 1440 0 ...) ) |
:hour-of-day-seq | Cyclic sequence of hours per day (e.g. (0 1 ... 23 0 ...) ) |
:day-of-week-seq | Cyclic sequence of the day of the week (e.g. (1 2 ... 7 1 ...) ) |
:day-of-month-seq | Cyclic sequence of the day of the month (e.g. (1 2 ... 31 1 ...) ) |
:day-of-year-seq | Cyclic sequence of the day of the year (e.g. (1 2 ... 365 1 ...) ) |
:minute-day-night-seq | Sinusoidal sequence of milliseconds in relation to the day-night cycle. |
:hour-day-night-seq | Sinusoidal sequence of milliseconds in relation to the day-night cycle. |
Given a `:t-zero` (simulation start), an exclusive upper bound of `:sample-ms` milliseconds and an optional local time `zone`, return a map of useful lazy time sequences. (Note that since these are lazy seqs, we do not waste performance overhead on unused sequences.) There are three kinds of sequences: sequences of milliseconds (intervals being equal to the time unit used); cyclic sequences of time with relation to the larger unit; and sinusoidal sequences of time with relation to the day-night cycle, where 1.0 represents midnight, -1.0 represents noon, positive numbers nighttime, and negative numbers daytime. Time sequences in the returned map: | Sequence Key | Description | --- | --- | `:milliseconds-seq` | Sequence of epoch milliseconds since `t-zero` (e.g. `(0 1 2 ...)`) | `:second-ms-seq` | Sequence of epoch ms with an interval of one second (e.g. `(0 1000 ...)`) | `:minute-ms-seq` | Sequence of epoch ms with an interval of one minute (e.g. `(0 60000 ...)`) | `:hour-ms-seq` | Sequence of epoch ms with an interval of one hour (e.g. `(0 3600000 ...)`) | `:day-ms-seq` | Sequence of epoch ms with an interval of one day (e.g. `(0 86400000 ...)`) | `:week-ms-seq` | Sequence of epoch ms with an interval of one week (e.g. `(0 604800000 ...)`) | `:minute-of-hour-seq` | Cyclic sequence of minutes per hour (e.g. `(0 1 ... 59 0 ...)`) | `:minute-of-day-seq` | Cyclic sequence of minutes per day (e.g. `(0 1 ... 1440 0 ...)`) | `:hour-of-day-seq` | Cyclic sequence of hours per day (e.g. `(0 1 ... 23 0 ...)`) | `:day-of-week-seq` | Cyclic sequence of the day of the week (e.g. `(1 2 ... 7 1 ...)`) | `:day-of-month-seq` | Cyclic sequence of the day of the month (e.g. `(1 2 ... 31 1 ...)`) | `:day-of-year-seq` | Cyclic sequence of the day of the year (e.g. `(1 2 ... 365 1 ...)`) | `:minute-day-night-seq` | Sinusoidal sequence of milliseconds in relation to the day-night cycle. | `:hour-day-night-seq` | Sinusoidal sequence of milliseconds in relation to the day-night cycle.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close