File: nmf_update_KL.Rd

package info (click to toggle)
r-cran-nmf 0.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,344 kB
  • sloc: cpp: 680; ansic: 7; makefile: 2
file content (89 lines) | stat: -rw-r--r-- 2,894 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
\name{nmf_update.KL.h}
\alias{nmf_update.KL}
\alias{nmf_update.KL.h}
\alias{nmf_update.KL.h_R}
\alias{nmf_update.KL.w}
\alias{nmf_update.KL.w_R}
\title{NMF Multiplicative Updates for Kullback-Leibler Divergence}
\usage{
  nmf_update.KL.h(v, w, h, nbterms = 0L, ncterms = 0L,
    copy = TRUE)

  nmf_update.KL.h_R(v, w, h, wh = NULL)

  nmf_update.KL.w(v, w, h, nbterms = 0L, ncterms = 0L,
    copy = TRUE)

  nmf_update.KL.w_R(v, w, h, wh = NULL)
}
\arguments{
  \item{v}{target matrix}

  \item{w}{current basis matrix}

  \item{h}{current coefficient matrix}

  \item{nbterms}{number of fixed basis terms}

  \item{ncterms}{number of fixed coefficient terms}

  \item{copy}{logical that indicates if the update should
  be made on the original matrix directly (\code{FALSE}) or
  on a copy (\code{TRUE} - default). With \code{copy=FALSE}
  the memory footprint is very small, and some speed-up may
  be achieved in the case of big matrices. However, greater
  care should be taken due the side effect. We recommend
  that only experienced users use \code{copy=TRUE}.}

  \item{wh}{already computed NMF estimate used to compute
  the denominator term.}
}
\value{
  a matrix of the same dimension as the input matrix to
  update (i.e. \code{w} or \code{h}). If \code{copy=FALSE},
  the returned matrix uses the same memory as the input
  object.
}
\description{
  Multiplicative updates from \cite{Lee et al. (2001)} for
  standard Nonnegative Matrix Factorization models \eqn{V
  \approx W H}, where the distance between the target
  matrix and its NMF estimate is measured by the
  Kullback-Leibler divergence.

  \code{nmf_update.KL.w} and \code{nmf_update.KL.h} compute
  the updated basis and coefficient matrices respectively.
  They use a \emph{C++} implementation which is optimised
  for speed and memory usage.

  \code{nmf_update.KL.w_R} and \code{nmf_update.KL.h_R}
  implement the same updates in \emph{plain R}.
}
\details{
  The coefficient matrix (\code{H}) is updated as follows:
  \deqn{ H_{kj} \leftarrow H_{kj} \frac{\left( sum_i
  \frac{W_{ik} V_{ij}}{(WH)_{ij}} \right)}{ sum_i W_{ik} }.
  }{ H_kj <- H_kj ( sum_i [ W_ik V_ij / (WH)_ij ] ) / (
  sum_i W_ik ) }

  These updates are used in built-in NMF algorithms
  \code{\link[=KL-nmf]{KL}} and
  \code{\link[=brunet-nmf]{brunet}}.

  The basis matrix (\code{W}) is updated as follows: \deqn{
  W_{ik} \leftarrow W_{ik} \frac{ sum_j [\frac{H_{kj}
  A_{ij}}{(WH)_{ij}} ] }{sum_j H_{kj} } }{ W_ik <- W_ik (
  sum_u [H_kl A_il / (WH)_il ] ) / ( sum_l H_kl ) }
}
\author{
  Update definitions by \cite{Lee2001}.

  C++ optimised implementation by Renaud Gaujoux.
}
\references{
  Lee DD and Seung H (2001). "Algorithms for non-negative
  matrix factorization." _Advances in neural information
  processing systems_. <URL:
  http://scholar.google.com/scholar?q=intitle:Algorithms+for+non-negative+matrix+factorization\#0>.
}