romcomma.user.regression.gls§

gls(X, y, cov_y, is_through_origin=False)[source]§

Generalized Least Squares linear regression.

Parameters:
  • X (ndarray) – An (N,M) matrix of regression variables

  • y (ndarray) – An (N,1) vector of observations.

  • cov_y (ndarray) – The (N,N) covariance matrix of observations y.

  • is_through_origin (bool) – True to constrain to y(0)=0

Return type:

Tuple[Tensor, Tensor]

Returns: A pair consisting of the (M+1,1) – or (M,1) if is_through_origin – regression coefficients and their covariance matrix,

where the intercept is the first regression coefficient – or absent if is_through_origin.