(->double x)Coerces a number or a numeric string to a double. Returns nil for nil or a blank string, so optional columns the preprocessor left as strings can be read without knowing their type.
Coerces a number or a numeric string to a double. Returns nil for nil or a blank string, so optional columns the preprocessor left as strings can be read without knowing their type.
(add-aprc dir headers data-files)Data augmentation of adding aprc to each file
Data augmentation of adding aprc to each file
(add-aprc-file data price-index ret-index security-index)Appends INIT-PRICE, APRC and CUM-RET to every row of one daily file.
CUM-RET is the cumulative natural-log return since the security's first
appearance (0.0 on that first day), so APRC = INIT-PRICE * exp(CUM-RET)
and APRC(t) / APRC(t-1) = 1 + RET(t). Per-security state lives in the
initial-price and cum-ret atoms, which add-aprc resets.
Appends INIT-PRICE, APRC and CUM-RET to every row of one daily file. CUM-RET is the cumulative natural-log return since the security's first appearance (0.0 on that first day), so APRC = INIT-PRICE * exp(CUM-RET) and APRC(t) / APRC(t-1) = 1 + RET(t). Per-security state lives in the `initial-price` and `cum-ret` atoms, which `add-aprc` resets.
(get-file-date file)The date a grouped data file holds, decoded from its name.
The date a grouped data file holds, decoded from its name.
(group-file-name date)The name clojask gives a date's file: the base64url of the EDN group key.
The name clojask gives a date's file: the base64url of the EDN group key.
(mean xs)Arithmetic mean of a non-empty sequence of numbers.
Arithmetic mean of a non-empty sequence of numbers.
(sample-sd xs)Sample standard deviation (n-1 denominator); 0.0 for fewer than two values.
Sample standard deviation (n-1 denominator); 0.0 for fewer than two values.
(update-by-keys map keys f)Update values in a map by applying function (f) on keys
Update values in a map by applying function (f) on keys
(write-grouped-dataset dir columns rows-by-date)Writes a dataset in the layout clojask-script produces: <dir>/header holds
the column names and <dir>/grouped one file per date with one EDN vector
per row. rows-by-date maps each yyyy-MM-dd date to its rows.
Writes a dataset in the layout clojask-script produces: <dir>/header holds the column names and <dir>/grouped one file per date with one EDN vector per row. `rows-by-date` maps each yyyy-MM-dd date to its rows.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |