estimation.demean
=1e-08, maxiter=100000) estimation.demean(x, flist, weights, tol
Demean an array.
Workhorse for demeaning an input array x
based on the specified fixed effects and weights via the alternating projections algorithm.
Parameters
Name | Type | Description | Default |
---|---|---|---|
x | numpy.ndarray | Input array of shape (n_samples, n_features). Needs to be of type float. | required |
flist | numpy.ndarray | Array of shape (n_samples, n_factors) specifying the fixed effects. Needs to already be converted to integers. | required |
weights | numpy.ndarray | Array of shape (n_samples,) specifying the weights. | required |
tol | float | Tolerance criterion for convergence. Defaults to 1e-08. | 1e-08 |
maxiter | int | Maximum number of iterations. Defaults to 100_000. | 100000 |
Returns
Name | Type | Description |
---|---|---|
tuple[numpy.ndarray, bool] | A tuple containing the demeaned array of shape (n_samples, n_features) and a boolean indicating whether the algorithm converged successfully. |