detkit.FitLogdet#

class detkit.FitLogdet(m=2, n=0, alpha=0.0, scale_x=1.0, scale_y=1.0)#

Fit and extrapolate log-determinant of large matrices.

Parameters:
mint, default=2

Number of terms in the Laurent series with logarithm

nint, default=0

Number of terms in the Laurent series without logarithm

alphafloat, default=0.0

The exponent \(\alpha\) for the weight function \(w_{\alpha}(x) = x^{-\alpha}\). During the regression, both targets and covariates will be multiplied by this weight function.

scale_xfloat, default=1.0

Scales x input data by a factor.

scale_yfloat, default=1.0

Scales y input data by a factor.

Notes

The fitting model is based on FLODANCE algorithm [1], given as

\[y(x) w_{\alpha}(x) = \left( a_0 + a_{1} x + \left( \sum_{i=1}^m b_{i} x^{-i} \right) \ln(x!) + \sum_{i=1}^n c_{i} x^{-i} \right) w_{\alpha}(x)\]

where \(w(x) = x^{-\alpha}\).

References

[1]

Ameli, S., van der Heide, C., Hodgkinson, L., Roosta, F., and Mahoney, M. W. (2025). Determinant Estimation under Memory Constraints and Neural Scaling Laws.

Examples

>>> from detkit import FitLogdet

>>> # Create an interpolator object using m=6 truncated Laurent series.
>>> flodet = FitLogdet(m=6)

>>> # Fit model to data
>>> flodet.fit(x_fit, y_fit)

>>> # Evaluate fitted curve
>>> y_eval = flodet.eval(x_eval)
Attributes:
param

Parameters of curve fitting.

res

Result of curve fitting optimization.

Methods

fit(x, y[, lam, smooth_interval, verbose])

Fit model to data.

eval(x)

Evaluate fitted curve at a given x.