Skip to main content

Sequential Learning Algorithm for Nonlinear Time Series (SLANTS)

Project description

The 'slants' Python API

This package provides a Python implementation as well as an user-friendly API for the Sequential Adaptive Nonlinear Modeling of Time Series (SLANTS) algorithm, as proposed by Q. Han, J. Ding, E. M. Airoldi and V. Tarokh in the IEEE Transactions on Signal Processing Journal, Vol. 65, NO. 19, October 2017, pages [4994, 5005]. SLANTS provides a new method for online modeling and prediction of nonlinear and nonparametric autoregressive time series.

  • It uses splines to approximate a wide range of nonlinear functions and adaptive filtering to accommodate time varying data generating processes.
  • It is built on a new online group LASSO algorithm proposed in the reference paper.
  • It can be applied to high dimensional time series where the dimension is larger than the sample size.

Further details and theory about the algorithm can be found here [PDF]

A Quick Setup Guide

Getting Started

1. Install the 'slants' package using pip

# Installing test package
python -m pip install slants

2. Import the Model and Experiment API classes

Two fundamental API classes are available. The Model Class API provides online model fitting capabilities of the SLANTS algorithm for your data as well as diagnostic plot graphing functions to view learned optimal model parameters. The Experiment Class API is a utility data-loader class that will quickly set you up with the environment to test the SLANTS algorithm API by loading sample synthetic experiments. You may import both classes as follows:

from slants import Model, Experiment

Using the package

Experiment Class API

1. Load a synthetic experiment dataset using the Experiment.load() method

This method returns a dictionary containing the design data matrix + tunable parameters for the model.

exp = Experiment.load(1) # load synthetic experiment no. (1)
2. View number of available synthetic datasets
Experiment.load('?') 

All the tunable parameters for model fitting, inclusive of the data design matrix, can be accessed from the 'exp' dictionary.

Model Class API

1. Instantiate Model objects and viewing available methods:
model = Model()
model.help(ls=True) #ls ~ inspiration from linux bash-style command
2. Fit SLANTS algorithm on data design matrix:
# Consolidating spline spline configuration + optional tunable parameters 
spline_info = {
    'order': spline_info_order, 
    'num_Bsplines': spline_info_num_Bsplines
}

optional_params = {
    'test_size': test_size, 
    'safe_shrink_lambda': safe_shrink_lambda, 
    'random_beta': random_beta
}
## Note: Many more optional tunable parameters are available; see documentation

# Fitting the SLANTS model on the data 
model.fit(data, predict, maximum_lag, spline_info, forget_factor,  
          lambda_init, tau2_init, sparse_lambda_tolerance,		 				  
          delta_multiplier, shrink_step_size, **optional_params) # unpacking optional args dictionary 

Either check the Complete_User_Guide.IPYNB notebook or type the following to get additional documentation regarding the Model.fit() method:

model.help('fit')
3. View diagnostic plots
model.plot('coef') # show trend of beta coefficients with time
model.plot('lambda') # show trend of LASSO penalty term with time
model.plot('tau') # show trend of EM decomposition parameter with time
model.plot('trace') # show trace of nonlinear functions
4. Return learned model parameters
learned_model_params = model.model_params() # dictionary consisting of all learned parameters

Either check Complete_User_Guide.IPYNB notebook or type the following to get additional documentation regarding the Model.model_params() method:

model.help('model_params')
5. Reset the model in rare cases of unexpected behaviour
model.reset_model()
6. View man-style documentation of the Model class/methods
model.help(ls=True) # show list of methods in Model class 
model.help('fit') # show info about function name, for eg. fit()
model.help('all') # show info about entire class

Software Guide

Interactive hands-on guides pertaining to the package may be accessed [online] on Google Colab or is available for download in the docs/ folder of this project. Developers can avail all software-design charts of this project in the docs/ folder.

Relevant Papers

Q .Han, J. Ding, E. Airoldi, V. Tarokh, "SLANTS: Sequential adaptive nonlinear modeling of time series," IEEE Transactions on Signal Processing 65 (19), 4994-5005. [PDF]

X. Xian, J. Ding, "Physics-assisted online learning," preprint.

Acknowledgement

This research is funded by the Defense Advanced Research Projects Agency (DARPA) under grant number HR00111890040.

License

The software is subjected to the GNU GPLv3 licensing terms and agreements.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slants-1.0.0.tar.gz (340.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slants-1.0.0-py3-none-any.whl (359.3 kB view details)

Uploaded Python 3

File details

Details for the file slants-1.0.0.tar.gz.

File metadata

  • Download URL: slants-1.0.0.tar.gz
  • Upload date:
  • Size: 340.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for slants-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c194a62d57a328d599549f44723e0a7a3cee9e2085f861ad20e0098e33bf5175
MD5 e258bd5ffeed899361753f1501e15f4c
BLAKE2b-256 61780f7f1a1b1abf46b1935b38c18c85645ef707c105660ae326389888a679a7

See more details on using hashes here.

File details

Details for the file slants-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: slants-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 359.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for slants-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d94562d25fdabee8e38a22d9474fa4fac9ea235e4dde97d395d1a8e1b6e666a3
MD5 8e5e0ee48a383ac28daa9b4d0ca7be0c
BLAKE2b-256 8d9fa1d81c36d72b4f050ef1740ee580cff4f9da68857b0304dab04ddef52a5b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page