Skip to content

Tessero\Stats\Covariance

← All classes

AI assistant

Build this with Claude Code, Cursor or Copilot

Copy a Tessero-tuned prompt for Tessero\Stats\Covariance, grounded in 10 real API signatures , into your IDE's AI. No chatbot, just exact context.

fromPrecision static
fromPrecision(mixed $precision, mixed $covariance = null): self

Representation of a covariance from its precision matrix (inverse covariance).

fromCholesky static
fromCholesky(mixed $cholesky): self

Representation of a covariance provided via the lower Cholesky factor L (L Lᵀ = A).

fromDiagonal static
fromDiagonal(mixed $diagonal): self

Representation of a covariance via its diagonal elements (diagonal covariance matrix). Supports singular matrices: non-positive entries are treated as zeros in whitening and ignored in the log pseudo-determinant.

fromEigendecomposition static
fromEigendecomposition(array $eigendecomposition): self

Representation of a covariance via its eigendecomposition [$eigenvalues, $eigenvectors], as returned by eigh: V W Vᵀ = A. Supports singular matrices (non-positive eigenvalues ignored / treated as zero), matching scipy.

covariance
covariance(): array

Explicit covariance matrix A as a nested PHP array. @return array<int,array<int,float>>

logPdet
logPdet(): float

Log of the pseudo-determinant of the covariance matrix.

rank
rank(): int

Rank of the covariance matrix.

shape
shape(): array

Shape [n, n] of the covariance array. @return array{0:int,1:int}

whiten
whiten(mixed $x): array

Whitening transform. $x is a 1-D vector or 2-D array of row points (last axis = space dim). Returns the same shape.

colorize
colorize(mixed $x): array

Colorizing transform (inverse of whiten). Same shape conventions as whiten().