catch22: CAnonical Time-series CHaracteristics
catch22 GitHub
  • Welcome to catch22
    • Citing catch22
    • Publications using catch22
  • LANGUAGE-SPECIFIC DOCS
    • Python
    • MATLAB
    • R
    • Julia
    • C-compiled
  • INFORMATION ABOUT CATCH22
    • Feature Descriptions
      • Feature Overview Table
      • Distribution shape
      • Extreme event timing
      • Linear autocorrelation structure
      • Nonlinear autocorrelation
      • Symbolic
      • Incremental differences
      • Simple forecasting
      • Self-affine scaling
      • Other
    • API Reference
      • Python API
      • Julia API
      • R API
      • MATLAB API
    • Contributing to catch22
      • Contributor Code of Conduct
    • Related Packages
    • License
Powered by GitBook
On this page
  • MATLAB Usage Guide
  • Installation
  • Getting Started: Basic Usage
  • Expected Input
  • Computing catch22 features
  • Expected output
  • Advanced Usage
  • 1. Catch24
  • 2. Computing Individual Features
  • 3. Short Names
  • FAQ
  1. LANGUAGE-SPECIFIC DOCS

MATLAB

A detailed usage guide for installing and using catch22 in MATLAB.

PreviousPythonNextR

Last updated 1 year ago

MATLAB Usage Guide

Select a card below to access MATLAB-specific usage information.



Installation


  1. To get started with installing catch22 in MATLAB, clone the repository to a location of your choice using the following command in Bash/CMD:

git clone https://github.com/DynamicsAndNeuralSystems/catch22.git
  1. In MATLAB, navigate to the wrap_MATLAB directory in the cloned repo and call mexAll from the MATLAB command window. Ensure you include the folder in your MATLAB path to use the package:

cd('catch22/wrap_MATLAB')
addpath('catch22/wrap_MATLAB') % add folder in MATLAB path
mexAll 

Getting Started: Basic Usage

Here we outline how you can jump straight into computing catch22 features on your time series data with a basic usage example.

Expected Input

catch22 MATLAB only accepts one univariate time series at a time, with the input being passed in as a column vector. Consider the following example for a single time series of length 10 (i.e., 10 points):

>> data = rand(10,1)
% example of the expected format for your time series data
data =
    0.5672
    0.9982
    0.1319
    ...
    0.0813
    0.6592

Computing catch22 features

All features are bundled into a function called catch22_all. By default, the extended catch24 feature set will be computed unless a boolean flag which corresponds to the argument doCatch24 (which can either be set to true or false) is used in the function call:

  • true -> return the catch24 feature set (catch22 + mean + std. dev.).

  • false -> return the standard catch22 feature set.

% compute catch24 features
[vals, names] = catch22_all(data);
% for the catch22 feature set
[vals, names] = catch22_all(data, false);

Expected output

An array of feature outputs and a cell of feature names (24x1 if catch24, 22x1 if catch22) will be returned by MATLAB. The order in which the feature outputs are returned corresponds to the order in which feature names are returned, e.g., the feature output in vals(1) corresponds to the feature name names(1):

% Print feature name and value
for i = 1:size(names,1)
    fprintf('%s: %f\n', names{i}, vals(i));
end

And that's it! You now have all the knowledge you need to apply catch22 to your time series data. To access some of the additional functionality of catch22, keep reading for advanced usage tips and examples.



Advanced Usage

Ready to explore some of the additional functionality of catch22? Here we provide a usage guide for some of the

1. Catch24

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. In MATLAB, users can enable the catch24 feature set by passing the boolean flag true into the catch22_all function call:

tsData = rand(100,1) % create some time series
[vals, names] = catch22_all(tsData, true)

2. Computing Individual Features

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.

As an example, let's compute only the feature DN_HistogramMode_5 on a single univariate time series:

tsData = rand(1, 1000) % create length 1000 time series
f = catch22_DN_HistogramMode_5(tsData) % returns a double
fprintf('DN_HistogramMode_5 value: %f\n', f) 

Note that here we pass our time series as a row vector (1x1000) to the individual feature function. On the other hand, the catch22_all function for computing the entire feature set only accepts time series as a column vector (1000x1).

3. Short Names

In MATLAB, short names can be included in the output when calling catch22_all by specifying an additional output:

tsData = rand(1000, 1) % your time series data
[feature_vals, long_names, short_names] = catch22_all(tsData, false)
% print the short name and corresponding feature value
for i=1:size(feature_vals, 1):
    fprintf("%s : %f\n", short_names{i}, feature_vals(i))
end

Now, in addition to the cell of long names and feature values, we also obtain an additional cell (22x1 for catch22, 24x1 for catch24) of short feature names.


FAQ

Click one of the expandable tabs below to explore commonly asked questions about pycatch22 in MATLAB:

How can I submit a bug report for catch22?


To compute individual features in MATLAB, you can call the corresponding function given by catch22_{featureName} where featureName is the feature's long name (as in the ). For example, catch22_DN_HistogramMode_5 can be called to compute the feature . You can retrive all feature names by calling GetAllFeatureNames.

For each feature, we also include a unique 'short name' for easier reference (as outlined in the ).

If you would like to submit a bug report, you can access our Bug Tracker . For guidelines on submitting an ideal bug report, see our page on .

feature overview table
DN_HistogramMode_5
feature overview table
here
contributing to catch22
Page cover image
Cover

Installation

Cover

Getting started

Cover

Advanced usage

Cover

Frequently Asked Questions

Cover

API Reference