# Basis Generators

`DataDrivenDiffEq.monomial_basis`

— Functionmonomial_basis(x, c)

Constructs an array containing monomial basis in the variables `x`

up to degree `c`

of the form `[x₁, x₁^2, ... , x₁^c, x₂, x₂^2, ...]`

.

`DataDrivenDiffEq.polynomial_basis`

— Functionpolynomial_basis(x, c)

Constructs an array containing a polynomial basis in the variables `x`

up to degree `c`

of the form `[x₁, x₂, x₃, ..., x₁^1 * x₂^(c-1)]`

. Mixed terms are included.

`DataDrivenDiffEq.chebyshev_basis`

— Functionchebyshev_basis(x, c)

Constructs an array containing a Chebyshev basis in the variables `x`

with coefficients `c`

. If `c`

is an `Int`

returns all coefficients from 1 to `c`

.

`DataDrivenDiffEq.sin_basis`

— Functionsin_basis(x, c)

Constructs an array containing a Sine basis in the variables `x`

with coefficients `c`

. If `c`

is an `Int`

returns all coefficients from 1 to `c`

.

`DataDrivenDiffEq.cos_basis`

— Functioncos_basis(x, c)

Constructs an array containing a Cosine basis in the variables `x`

with coefficients `c`

. If `c`

is an `Int`

returns all coefficients from 1 to `c`

.

`DataDrivenDiffEq.fourier_basis`

— Functionfourier_basis(x, c)

Constructs an array containing a Fourier basis in the variables `x`

with (integer) coefficients `c`

. If `c`

is an `Int`

returns all coefficients from 1 to `c`

.

# Utility Functions

`DataDrivenDiffEq.AIC`

— Function`AIC(k, X, Y; likelihood = (X, Y) = sum(abs2, X-Y))`

Computes the Akaike Information Criterion (AIC) given the free parameters `k`

for the data `X`

and its estimate `Y`

of the model. `likelihood`

can be any function of `X`

and `Y`

.

`DataDrivenDiffEq.AICC`

— Function`AICC(k, X, Y; likelihood = (X, Y) = sum(abs2, X-Y))`

Computes the Akaike Information Criterion compensated for finite samples (AICC) given the free parameters `k`

for the data `X`

and its estimate `Y`

of the model. `likelihood`

can be any function of `X`

and `Y`

.

`DataDrivenDiffEq.BIC`

— Function`BIC(k, X, Y; likelihood = (X, Y) = sum(abs2, X-Y))`

Computes Bayes Information Criterion (BIC) given the free parameters `k`

for the data `X`

and its estimate `Y`

of the model. `likelihood`

can be any function of `X`

and `Y`

.

`DataDrivenDiffEq.optimal_shrinkage`

— Function```
optimal_shrinkage(X)
optimal_shrinkage!(X)
```

Compute a feature reduced version of the data array `X`

via thresholding the singular values by computing the optimal threshold for singular values.

`DataDrivenDiffEq.savitzky_golay`

— Function`savitzky_golay(X, windowSize, polyOrder; deriv, dt, crop)`

Estimate the time derivative via the savitzky_golay filter. `X`

is the data matrix containing the trajectories, which is interpolated via polynomials of order `polyOrder`

over `windowSize`

points repeatedly. `deriv`

defines the order of the derivative, `dt`

the time step size. `crop`

indicates if the original data should be returned cropped along the derivative approximation.

`DataDrivenDiffEq.burst_sampling`

— Function`burst_sampling(X, samplesize, n)`

Randomly selects `n`

bursts of data with size `samplesize`

from the data `X`

.

`burst_sampling(X, Y, samplesize, n)`

Randomly selects `n`

bursts of data with size `samplesize`

from the data `X`

and `Y`

.

`burst_sampling(X, t, period, n)`

Randomly selects `n`

bursts of data within a time window `period`

from the data `X`

. The time information has to be provided in `t`

.

`DataDrivenDiffEq.subsample`

— Function`subsample(X, n)`

Returns the subsampled `X`

with only every `n`

-th entry.

`subsample(X, t, dt)`

Returns the subsampled `X`

with a a minimum period of `dt`

between two data points. `t`

provides the time information.