tgreedy: Iteratively do T-FLASH on the residuals.

Description Usage Arguments Value Author(s) See Also

Description

This function will estimate a rank-1 tensor using independent unimodal priors on the components via a variational EM algorithm. It will subtract off the posterior mean from the data array, then repeat the estimation procedure on the residuals. It continues to do this until the maximum cp-rank k is reached or when all of the components are estimated to be 0.

Usage

1
2
3
4
tgreedy(Y, k = max(dim(Y)), tol = 10^-5, itermax = 100, alpha = 0,
  beta = 0, mixcompdist = "normal", var_type = c("homoscedastic",
  "kronecker"), nullweight = 1, print_update = FALSE,
  known_factors = NULL, known_modes = NULL, homo_modes = NULL)

Arguments

Y

An array of numerics. The data.

k

The maximum cp-rank of the mean tensor.

tol

A positive numeric. The stopping criterion for the VEM.

itermax

A positive integer. The maximum number of iterations to run the VEM

alpha

A non-negative numeric. The prior shape parameter for the variance. Defaults to zero.

beta

A non-negative numeric. The prior rate parameter for the variance. Defaults to zero.

mixcompdist

The mixing distribution to assume. Defaults to normal. Options are those available in the ashr package.

var_type

A string. What variance model should we assume? Options are homoscedastic noise ("homoscedastic") or Kronecker structured variance (kronecker).

nullweight

A numeric greater than or equal to 1. The penalty term on the probability of zero.

print_update

A logical. Should we print notifications on how far along the optimization is?

known_factors

A list of known factors for the modes indicated in known_modes. Defaults to NULL, where all factors are assumed to be unknown.

known_modes

A vector of integers. The modes that are known. Should be the same length as known_factors.

homo_modes

A vector of integers. If var_type = "kronecker" then homo_modes indicates which modes are assumed to be homoscedastic.

Value

factor_list: A list of matrices of numerics. factor_list[[i]][, j] contains the jth factor of the ith mode.

sigma_est: If var_type = "homoscedastic", then sigma_est is a vector of numerics. sigma_est[i] is the estimate of the precision during the i iteration of the greedy algorithm. Only the last one (if that) should actually be used for any sort of precision estimate.

If var_type = "kronecker", then sigma_est is a list of matices. sigma_est[[i]][, j] is the estimate of the variances for the jth mode during the ith run of the greedy algorithm. Only the final columns (if those) of these matrices should actually be used as any sort of precision estimate.

rank_final A non-negative integer. The final estimated cp-rank of the mean.

Author(s)

David Gerard

See Also

tflash for fitting the rank-1 mean tensor model.


kkdey/flashr documentation built on May 20, 2019, 10:36 a.m.