pyActigraphy.analysis.Cosinor.fit¶
- Cosinor.fit(ts, params=None, method='leastsq', nan_policy='raise', reduce_fcn=None, verbose=False)[source]¶
Fit the actigraphy data using a cosinor function.
- Parameters
ts (pandas.Series) – Input time series.
params (instance of Parameters [1], optional.) – Initial fit parameters. If None, use the default parameters. Default is None.
method (str, optional) – Name of the fitting method to use [1]. Default is ‘leastsq’.
nan_policy (str, optional) –
Specifies action if the objective function returns NaN values. One of:
’raise’: a ValueError is raised
’propagate’: the values returned from userfcn are un-altered
’omit’: non-finite values are filtered
Default is ‘raise’.
reduce_fcn (str, optional) –
Function to convert a residual array to a scalar value for the scalar minimizers. Optional values are:
’None’ : sum of squares of residual
’negentropy’ : neg entropy, using normal distribution
’neglogcauchy’: neg log likelihood, using Cauchy distribution
Default is None.
verbose (bool, optional) – If set to True, display fit informations. Default is False.
- Returns
fit_results – Fit results.
- Return type
MinimizerResult
References
- 1(1,2)
Non-Linear Least-Squares Minimization and Curve-Fitting for Python. https://lmfit.github.io/lmfit-py/index.html