coef.iva {ivaBSS}R Documentation

Coefficient of the Object of Class iva

Description

coef method for class "iva".

Usage

## S3 method for class 'iva'
coef(object, which.dataset = NA, ...)

Arguments

object

an object of class "iva", usually the result of a call to NewtonIVA or fastIVA.

which.dataset

positive integer. Provides the index in case the unmixing matrix only for a specific data set is desired. Default is to return all unmixing matrices.

...

further arguments are not used.

Details

Returns the unmixing matrices for all datasets or only for the requested dataset.

Value

Unmixing matrix or all unmixing matrices of the object of class "iva". If a single unmixing matrix is requested, it is an array with dimension [P, P] and if all unmixing matrices are requested, it is an array with dimension [P, P, D].

Author(s)

Mika Sipilä

See Also

NewtonIVA, fastIVA

Examples

if (require("LaplacesDemon")) {
  # Generate sources from multivariate Laplace distribution
  P <- 4; N <- 1000; D <- 4;
  S <- array(NA, c(P, N, D))

  for (i in 1:P) {
    U <- array(rnorm(D * D), c(D, D))
    Sigma <- crossprod(U)
    S[i, , ] <- rmvl(N, rep(0, D), Sigma)
  }

  # Generate mixing matrices from standard normal distribution
  A <- array(rnorm(P * P * D), c(P, P, D))

  # Generate mixtures
  X <- array(NaN, c(P, N, D))
  for (d in 1:D) {
    X[, , d] <- A[, , d] %*% S[, , d]
  }

  # Estimate sources and unmixing matrices
  res_G <- NewtonIVA(X, source_density = "gaussian")


  # All D unmixing matrices
  coef(res_G)

  # The unmixing matrix for the second dataset
  coef(res_G, 2)
}

[Package ivaBSS version 1.0.0 Index]