sindy: Sparse Identification of Nonlinear Dynamics (SINDy)

View source: R/sindy.R

sindyR Documentation

Sparse Identification of Nonlinear Dynamics (SINDy)

Description

Sparsification function based on sequential thresholded least-squares as shown in the SINDy algorithm in "Discovering governing equations from data: Sparse identification of nonlinear dynamical systems" (Brunton, Proctor, & Kutz, 2016).

Usage

sindy(
  x,
  dt,
  lambda,
  polyOrder = 5,
  useSine = FALSE,
  normalize = FALSE,
  nVars = ncol(as.matrix(x))
)

Arguments

x

A vector or matrix of measurements over time.

dt

A numeric value indicating the time-lag between two subsequent time series measures.

lambda

A numeric value; sparsification threshold.

polyOrder

An integer from 0 to 5 indicating the highest degree of polynomials included in the matrix of candidate functions.

useSine

A logical value indicating whether sine and cosine functions of variables should be added to the library of potential candidate functions. If TRUE, candidate function matrix is augmented with sine and cosine functions of integer multiples 1 through 10 of all the variables in yIn.

normalize

Logical; Should the columns of the matrix of candidate functions be normalized?

nVars

An integer that indicates the number of variables.

Value

A matrix of candidate functions and a matrix of sparse coefficients.

References

Brunton, S. L., Proctor, J. L., & Kutz, J. N. (2016). Discovering governing equations from data by sparse identification of nonlinear dynamical systems. Proceedings of the National Academy of Sciences, 113(15), 3932-3937.

Examples

## Not run: 
sparsify_dynamics(Theta, dXdt, lambda, n)
sparsify_dynamics(Theta, dXdt, 0.1, 10)
sparsify_dynamics(pool_data(yIn, 15, 5, TRUE), dXdt, 0, 15)

## End(Not run)

RobertGM111/havok documentation built on July 8, 2023, 8:23 p.m.