matipl2d: Matrix of L^2 inner products of probability densities

View source: R/matipl2d.R

matipl2dR Documentation

Matrix of L^2 inner products of probability densities

Description

Computes the matrix of the L^2 inner products between several multivariate (p > 1) or univariate (p = 1) probability densities, estimated from samples, using l2d.

Usage

matipl2d(x, method = "gaussiand", varwL = NULL)

Arguments

x

object of class "folder" containing the data. Its elements have only numeric variables (observations of the probability densities). If there are non numeric variables, there is an error.

method

string. It can be:

  • "gaussiand" if the densities are considered to be Gaussian.

  • "kern" if they are estimated using the Gaussian kernel method.

varwL

list of matrices. The smoothing bandwidths for the estimation of each probability density. If they are omitted, the smoothing bandwidths are computed using the normal reference rule matrix bandwidth (see details of the l2d function).

Value

Positive symmetric matrix whose order is equal to the number of densities, consisting of the pairwise inner products between the probability densities.

Author(s)

Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Gilles Hunault, Sabine Demotes-Mainard

See Also

l2d.

matipl2dpar when the probability densities are Gaussian, given the parameters (means and variances).

Examples

    data(roses)
    
    # Multivariate:
    X <- as.folder(roses[,c("Sha","Den","Sym","rose")], groups = "rose")
    summary(X)
    mean.X <- mean(X)
    var.X <- var.folder(X)
    
    # Parametrically estimated Gaussian densities:
    matipl2d(X)
    
    # Estimated densities using the Gaussian kernel method (normal reference rule bandwidth):
    matipl2d(X, method  = "kern")
    
    # Estimated densities using the Gaussian kernel method (bandwidth provided):
    matipl2d(X, method  = "kern", varwL = var.X)
    
    # Univariate :
    X1 <- as.folder(roses[,c("Sha","rose")], groups = "rose")
    summary(X1)
    mean.X1 <- mean(X1)
    var.X1 <- var.folder(X1)
    
    # Parametrically estimated Gaussian densities:
    matipl2d(X1)
    
    # Estimated densities using the Gaussian kernel method (normal reference rule bandwidth):
    matipl2d(X1, method = "kern")
    
    # Estimated densities using the Gaussian kernel method (bandwidth provided):
    matipl2d(X1, method = "kern", varwL = var.X1)

dad documentation built on Aug. 30, 2023, 5:06 p.m.