pymare.stats
.weighted_least_squares
- weighted_least_squares(y, v, X, tau2=0.0, return_cov=False)[source]
Perform 2-D weighted least squares.
- Parameters:
y (
numpy.ndarray
) – 2-d array of estimates (studies x parallel datasets)v (
numpy.ndarray
) – 2-d array of sampling variancesX (
numpy.ndarray
) – Fixed effect design matrixtau2 (
float
, optional) – tau^2 estimate to use for weights. Default = 0.return_cov (
bool
, optional) – Whether or not to return the inverse cov matrix. Default = False.
- Returns:
If return_cov is True, returns both fixed parameter estimates and the inverse covariance matrix; if False, only the parameter estimates.
- Return type:
params[, cov]