% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rTensor_Decomp.R
\name{dedicom}
\alias{dedicom}
\title{DEDICOM Decomposition}
\usage{
dedicom(tnsr, num_components = NULL, max_iter = 25, tol = 1e-05)
}
\arguments{
\item{tnsr}{3-Tensor with square frontal slices}

\item{num_components}{the number of components for the decomposition}

\item{max_iter}{maximum number of iterations if error stays above \code{tol}}

\item{tol}{relative Frobenius norm error tolerance}
}
\value{
a list containing the following:\describe{
\item{\code{A}}{the shared factor matrix with \code{num_components} columns}
\item{\code{R}}{the asymmetric relation matrix of size \code{num_components} by \code{num_components}}
\item{\code{D}}{a list of diagonal weight matrices, one for each frontal slice}
\item{\code{conv}}{whether or not \code{resid} < \code{tol} by the last iteration}
\item{\code{est}}{estimate of \code{tnsr} after decomposition}
\item{\code{norm_percent}}{the percent of Frobenius norm explained by the approximation}
\item{\code{fnorm_resid}}{the Frobenius norm of the error \code{fnorm(est-tnsr)}}
\item{\code{all_resids}}{vector containing the Frobenius norm of error for all the iterations}
}
}
\description{
Decomposition into Directional Components (DEDICOM) of a 3-Tensor. Decomposes a 3-Tensor into a shared factor matrix \code{A}, a shared asymmetric relation matrix \code{R}, and slice-specific diagonal weight matrices \code{D_k} such that each frontal slice \code{X_k = A \%*\% D_k \%*\% R \%*\% D_k \%*\% t(A)}. Uses the Alternating Least Squares (ALS) estimation procedure. For more details on DEDICOM, consult Bader et al. (2007).
}
\details{
A progress bar is included to help monitor operations on large tensors. The input tensor must be 3-dimensional with square frontal slices (i.e. the first two modes must be equal).
}
\note{
The first two modes of \code{tnsr} must be equal (square frontal slices).
}
\examples{
tnsr <- rand_tensor(c(5,5,3))
dedicomD <- dedicom(tnsr, num_components=2)
dedicomD$conv
dedicomD$norm_percent
plot(dedicomD$all_resids)
}
\references{
B. Bader, R. Harshman, T. Kolda, "Temporal analysis of semantic graphs using ASALSAN". Proceedings of the 7th IEEE International Conference on Data Mining 2007.
}
\seealso{
\code{\link{rescal}}, \code{\link{indscal}}
}
