fit_bank#
- pypillometry.signal.gaussmarkov.fit_bank(bank, y, fs, segments=None, prior='medium', theta0=None, hessian=True, maxiter=400, n_jobs=1, progress=False, desc='fit')[source]#
Fit a timescale-bank model to a signal.
Maximises the restricted log-likelihood (Kalman filter) plus the log density of the prior over the parameter vector, within the bounds of the model (L-BFGS-B). The starting values come from the semivariogram of the signal (
TimescaleBank.start()).- Parameters:
bank (TimescaleBank)
y (array, (T,) or (T, channels)) – the signal, NaN where missing
fs (float) – sampling rate of y in Hz
segments (list of (start, stop), optional) – sample indices of independent segments with a mean each; default: one segment
prior (GaussianPrior, str or None) – prior of the parameter vector: a
GaussianPrior(e.g., from a group fit), the strength of the general prior ("weak","medium"(default) or"strong", seegeneral_prior()) or None for maximum likelihoodtheta0 (array, optional) – starting values (default: from the variogram)
hessian (bool) – compute the Hessian of the negative log-likelihood at the estimate (for standard errors and group fits); default True
maxiter (int) – maximum number of iterations of the optimiser
n_jobs (int or None) – number of threads that evaluate the likelihood at the points of the finite-difference gradient and of the Hessian (at most one per parameter); None: all cores but one; negative as in joblib (-1: all cores). Inside a parallel process, “all cores” is its share. Default 1 (e.g., inside parallel processes).
progress (bool) – show a progress bar (iterations and the negative log posterior, then the evaluations of the Hessian); default False
desc (str) – label of the progress bar
- Return type: