Julia
A detailed usage guide for installing and using catch22 in Julia (Catch22.jl).
Last updated
A detailed usage guide for installing and using catch22 in Julia (Catch22.jl).
Last updated
Select a card below to access Julia-specific usage information.
Julia users can install the latest version of catch22 using the following:
Here we outline how you can jump straight into computing catch22 features on your time series data with a basic usage example.
The input time series can be provided as a Vector{Float64}
or Array{Float64, 2}
. If an array is provided, the time series must occupy its columns. For example, this package contains a few test time series from catch22:
Once your time series data is in the correct form, all catch22 features can then be evaluated with:
If an array is provided (multiple univaraite time series), containing one time series in each of N columns:
A 22 x N
FeatureArrray
of feature values will be returned (a subtype of AbstractDimArray
).
If a vector is provided (a single time series) :
A vector of feature values will be returned as a FeatureVector
, a one dimensional FeatureArray
.
You can access the output for each SPI individually using the corresponding symbol i.e., :DN_HistogramMode_5
for the DN_HistogramMode_5 feature.
Ready to explore some of the additional functionality of Catch22.jl?
If the location and spread of the raw time series distribution may be important for your application, you can enable catch24.
Catch24 is an extension of the original catch22 feature set to include mean and standard deviation, yielding a total of 24 time series features. To access catch24 you can use the catch24
FeatureSet:
If you do not wish to compute the full catch22 feature set on your time series, you can alternatively compute each feature (including mean and std. deviation) individually.
Each feature can be evaluated for a time series array or vector with the catch22 FeatureSet
. You can do this by indexing the catch22 FeatureSet
using the feature names (as in the feature overview table) as a symbol. In Julia, you can obtain a list of features (as symbols) by using getnames(catch22)
.
As an example, let's compute only the feature DN_HistogramMode_5
using its symbol. Here we will compute the feature for both a single univariate time series (as a vector) and an array with 10 univariate time series:
For our time series vector, we obtain a scalar Float64 corresponding to the value of DN_HistogramMode_5
for our single time series. Similarly, for an array of multiple time series, we obtain a matrix of Float64 values, corresponding to the value of the feature for each time series in the original array.
Alternatively, functions that calculate each feature individually are exported. For example, DN_HistogramMode_5
can be evaluated with:
For each feature, we also include a unique 'short name' for easier reference (as outlined in the feature overview table).
Returning short names as outputs
In Julia, short names can be returned in place of the corresponding long feature names by calling c22
(instead of catch22
) on your time series data. Since c22
is also a FeatureSet type, it accepts the same inputs as catch22:
Here is an example of (part of) the FeatureArray
returned:
You can also access the individual results using their associated short name symbol e.g., :mode5
. To obtain the full list of short names, you can use getnames(c22)
.
2.Computing individual features by their short name
Using the c22
FeatureSet
, you can index individual time series features by their short name (as symbols). For example, to compute the feature FC_LocalSimple_mean3_stderr
with short name forecast_error
, you can do the following:
Click one of the expandable tabs below to explore commonly asked questions about Catch22 in Julia: