| nmfkc.ident | R Documentation |
nmfkc.ident examines whether the factorization Y \approx X C A
of a fitted nmfkc model is unique, and what can be said about
C (\Theta) when it is not. For the model
Y = X C A + \varepsilon with X \ge 0 (columns summing to 1),
C \ge 0 and A known, any T with columns summing to 1,
XT \ge 0 and T^{-1}C \ge 0 gives the same fit, so the bases and
the coefficients are determined only up to such a remixing. The function
tests the anchor condition that makes the factorization unique
(every basis has an anchor row of X with membership probability at
least pi and size at least rho, and an anchor column of
C), from the least-squares estimate of \Xi = XC only, and
reports the largest pi and rho not rejected;
computes the identification region: the range of every entry of
C and X over all exact factorizations of the maximum
\hat\Xi;
re-optimizes the fit from a point of that region (fit), which
repairs a fit that stopped short of the optimum;
optionally (ci = TRUE) computes profile-likelihood intervals
for C that contain the identification region (approximate; see
Intervals below).
Steps 2–4 need as many covariates as bases (nrow(A) == rank), e.g.
group indicators or rank continuous covariates; for
nrow(A) > rank (or region = FALSE) only the test is computed.
In every case, with or without covariates, the function also runs an
algebraic check on the fitted X and C themselves
(component algebraic): whether any remixing moves them, and how far.
It needs neither Y nor A, so nmfkc.ident(fit) works
for a fit without covariates (Y \approx XB, where the test is not
available) and for one with covariates alike.
nmfkc.ident(object, Y = NULL, A = NULL, ...)
object |
An object of class |
Y |
Observation matrix (P x N) used in the fit. Needed, with |
A |
Covariate matrix (R x N) used in the fit, of full row rank with
|
... |
Additional arguments:
|
Test. \hat\Xi = Y A^\top (AA^\top)^{-1} with HC1 standard
errors. A candidate is an ordered set of Q columns L of
\Xi (the anchor columns of C) and Q distinct rows J
(the anchor rows of X). The null hypothesis H(\rho) (at
pi = 1) says that some candidate has zero off-diagonal entries
\Xi_{j_q l_{q'}} (q \ne q') and sizes
\Xi_{j_q l_q} \ge \rho \sum_p \Xi_{p l_q}. Each of these Q^2
conditions is tested on the entries of \hat\Xi directly by a one-sided
t test at \alpha/Q^2 (t_{N-R} critical value; no ratios of
estimates enter the standard errors); a candidate survives if none of them
rejects, and H(\rho) is rejected if no candidate survives
(intersection–union test). rho.max is the largest rho not
rejected, an upper confidence bound of the size of the anchors.
The membership probability of a row (its share in the representative where
the columns L are pure, X = \Xi_L S_L^{-1}) is reported, not
used for the decision at pi = 1: pi.max is 1 when
H(\rho) is not rejected, and otherwise the largest pi for which
some candidate passes the 2Q one-sided tests of the membership
contrasts (1-\pi) u_{j l_q} - \pi \sum_{q' \ne q} u_{j l_{q'}} \ge 0
and the sizes, at \alpha/(2Q), with u = \Xi / s and the column
sums s held fixed in the standard errors (letting them vary, with the
estimate plugged into the gradient, made the test liberal when P is
small). A decision at pi < 1 uses the same contrasts. Non-rejection
is not evidence of identification, as in a goodness-of-fit test. For
nrow(A) > rank the condition that C is non-negative outside the
anchor columns is not tested.
Identification region (R = Q). With as many covariates as bases,
every non-negative \Xi factorizes exactly, so the maximum of the
likelihood over the model is the row-wise non-negative least squares
\hat\Xi in the metric AA^\top (for one-hot A, the group
means). All exact factorizations are X = \tilde X T,
C = T^{-1} S with \tilde X the column-normalized \hat\Xi,
S its column sums and T the remixing above (columns summing to
1, \tilde X T \ge 0, T^{-1} \ge 0); T = I is the
representative in which every covariate has its own basis. The bases are
labelled by matching the columns of X to those of \tilde X (so
that relabellings are excluded). The region is explored from T = I
by region.n random proposals, each a small move of a factorization
already found that is kept only if it satisfies these conditions; each end
of the range of an entry of C is then refined by Nelder–Mead (with a
penalty for negative entries) from the region.nstart most extreme
factorizations. The ranges of X come from the factorizations found.
Both are inner approximations: when the region is thin (for example, when
only some columns of T can move), the ends can be found noticeably
inside, and a larger region.nstart helps.
identified is TRUE when every range of C is shorter than
1e-6 times the largest column sum.
Intervals. Gaussian errors with one variance common to all entries
of Y (the working model whose maximum is nmfkc's least squares),
profiled over X, the other entries of C and the variance. The
profile is flat over the identification region, so the interval contains
it. The \chi^2_1 cut is meant to cover each point of the region with
probability about ci.level, as for a point of an identified set
(Imbens and Manski, 2004; Chernozhukov, Hong and Tamer, 2007); the true
coefficient is one such point. The probability of covering the whole
region at once can be lower: the ends of the region are where an entry of
X or C reaches 0, so they are minima and maxima rather than
smooth functions of \Xi and need not be asymptotically normal, in
particular when the width of the region is comparable to its standard
error or when an exact zero in \hat\Xi pins a column. The coverage
has not yet been studied by simulation in this setting, so read the
intervals as approximate. The profile is computed by continuation from the
ends of the region with local re-fits, so the intervals may be slightly
too short.
An object of class "nmfkc.ident":
algebraic |
List: |
test |
|
Xi.hat |
The maximum over the model (P x R); |
C.region.lower, C.region.upper |
Identification region of |
X.region.lower, X.region.upper |
Identification region of |
identified |
Logical: the region of |
X, C |
The repaired basis and coefficients (bases in |
fit |
The repaired |
repair |
List: |
C.ci.lower, C.ci.upper |
Profile-likelihood interval of |
ci.level, rank, call |
As named; |
Every T with columns summing to 1, XT \ge 0 and
T^{-1}C \ge 0 gives the same fit; with A of full row rank the
non-negativity is that of C itself (of B = C without
covariates), so the check needs only X and C. Write
T = I + tD with D of zero column sums (Q(Q-1) free
entries). Entries at most zero.tol times their column (row) maximum
are set to 0 first, since the multiplicative updates leave small positive
values where the fit is at the boundary.
Sufficient condition: two-sided anchors, or the peeling of
summary.nmfkc(), with its own rule for zeros (not
zero.tol); when it holds the fit is identified.
Local cone: the directions D that keep both
inequalities to first order, (XD)_{ij} \ge 0 where
X_{ij} = 0 and (DC)_{kj} \le 0 where C_{kj} = 0. Whether
it contains a direction with a positive (negative) value of each
off-diagonal entry is decided exactly by a non-negative least-squares
problem (Farkas' lemma), whose residual is such a direction. If none
does, no remixing moves the fit: it is locally identified.
Extent: along the pairwise remixings
x_q \to (1-a)x_q + a x_r, the cone directions and ident.n
random directions, the largest step that keeps XT \ge 0 (exact,
linear in t) and T^{-1}C \ge 0 (grid, then bisection) is
found. The ranges of X and C over these factorizations are
inner bounds of the identification region, and pairs gives the
exact interval of a for each pair of bases.
Random directions alone miss narrow sets of remixings (a single possible
direction is hit with probability 0), which is why the pairwise and cone
directions are always included. The check concerns the fitted matrices: a
zero in \hat X or \hat C that pins the fit is an estimate and
may not survive sampling variation (use the test with Y and A
for that), and it examines only remixings connected to the fit, not
factorizations far away.
Imbens, G. W. and Manski, C. F. (2004). Confidence intervals for partially identified parameters. Econometrica, 72(6), 1845–1857. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.1468-0262.2004.00555.x")}
Chernozhukov, V., Hong, H. and Tamer, E. (2007). Estimation and confidence regions for parameter sets in econometric models. Econometrica, 75(5), 1243–1284. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.1468-0262.2007.00794.x")}
nmfkc, nmfkc.inference,
summary.nmfkc.ident, plot.nmfkc.ident
## two groups, two bases; variables 1 and 5 are anchors (multiplicative noise keeps their zeros)
set.seed(1)
X <- cbind(c(0.4, 0.3, 0.2, 0.1, 0), c(0, 0.1, 0.2, 0.3, 0.4))
A <- rbind(g1 = rep(c(1, 0), each = 20), g2 = rep(c(0, 1), each = 20))
Y <- (X %*% diag(c(10, 8)) %*% A) * exp(matrix(rnorm(200, sd = 0.1), 5, 40))
fit <- nmfkc(Y, A, rank = 2, epsilon = 1e-8, verbose = FALSE)
id <- nmfkc.ident(fit, Y, A, region.n = 5000)
id
## without covariates: the algebraic check only
fit0 <- nmfkc(t(as.matrix(iris[, 1:4])), rank = 2, epsilon = 1e-8, verbose = FALSE)
nmfkc.ident(fit0)
id2 <- nmfkc.ident(fit, Y, A, region.n = 5000, ci = TRUE) # profile intervals
summary(id2)
plot(id2)
plot(id2, type = "X")
plot(id2, col = c(estimate = "blue", shade = NA)) # colours; NA leaves a part out
plot(id2, type = "X", cex = c(estimate = 0.5), lwd = c(range = 2)) # sizes, widths
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.