LCMKernel<T>

Models & Types · AiDotNet.Kernels

Linear Coregionalization Model (LCM) kernel for multi-output Gaussian Processes.

Implements: IKernelFunction<T>

For Beginners

The Linear Coregionalization Model (LCM) is a powerful method for multi-output Gaussian Processes. It models the correlations between multiple outputs using a sum of products of input kernels and output covariance matrices.

The model assumes each output is a linear combination of latent functions: y_d(x) = Σᵢ aᵢ_d × uᵢ(x)

Where:

  • y_d(x) is output d at input x
  • uᵢ(x) are independent latent functions, each with their own kernel kᵢ(x, x’)
  • aᵢ_d are mixing coefficients

The resulting multi-output kernel is: k((x, d), (x’, d’)) = Σᵢ Bᵢ[d, d’] × kᵢ(x, x’)

Where Bᵢ = aᵢ × aᵢᵀ is the coregionalization matrix for component i.

Why use LCM?

  1. Flexible correlation structure: Different components can capture different relationships
  2. Interpretability: Each component models a specific pattern shared across outputs
  3. Efficiency: Exploits Kronecker structure for faster computation

How It Works

Applications:

  • Multi-task learning (related prediction tasks)
  • Sensor networks (multiple sensors measuring related quantities)
  • Financial modeling (correlated asset returns)
  • Geostatistics (co-kriging for multiple spatial variables)

Constructors

Constructor Summary
LCMKernel(IKernelFunction<T>[] inputKernels, Matrix<T>[] coregMatrices) Initializes a new LCM kernel with specified kernels and coregionalization matrices.
LCMKernel(IKernelFunction<T>[] inputKernels, int numOutputs, int? rank, int? seed) Initializes a new LCM kernel with random coregionalization matrices.

Properties

Property Summary
int NumComponents { get; } Gets the number of components (latent functions).
int NumOutputs { get; } Gets the number of outputs.

Methods

Method Summary
IKernelFunction<T> GetInputKernel(int componentIndex) Gets the input kernel for a specific component.
LCMKernel<T> SingleComponent(IKernelFunction<T> inputKernel, int numOutputs, double outputCorrelation) Creates a simple LCM kernel with one component.
Matrix<T> GetCoregMatrix(int componentIndex) Gets a copy of the coregionalization matrix for a specific component.
Matrix<T> GetTotalCorrelation() Gets the total correlation matrix across all components.
T Calculate(Vector<T> x1, Vector<T> x2) Calculates the LCM kernel value between two output-input pairs.
T CalculateForOutputs(Vector<T> input1, Vector<T> input2, int output1, int output2) Calculates the kernel value for explicit output indices.
Vector<T> CreateExtendedVector(Vector<T> input, int outputIndex) Creates an extended vector for a specific output.