nmfkc.ident: Identifiability of an nmfkc fit: test, identification region,...

View source: R/nmfkc.ident.R

nmfkc.identR Documentation

Identifiability of an nmfkc fit: test, identification region, repair and intervals

Description

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

  1. 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;

  2. computes the identification region: the range of every entry of C and X over all exact factorizations of the maximum \hat\Xi;

  3. re-optimizes the fit from a point of that region (fit), which repairs a fit that stopped short of the optimum;

  4. 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.

Usage

nmfkc.ident(object, Y = NULL, A = NULL, ...)

Arguments

object

An object of class "nmfkc" (X.restriction = "colSums", the default), with or without covariates.

Y

Observation matrix (P x N) used in the fit. Needed, with A, for the test, the region, the repair and the intervals; not needed for the algebraic check.

A

Covariate matrix (R x N) used in the fit, of full row rank with R < N. NULL (default): only the algebraic check is computed (for a fit without covariates, or when only the fitted matrices are at hand).

...

Additional arguments:

pi

Membership-probability threshold of the anchor rows at which the test decision is reported. Default 1 (exact anchors).

rho

Size threshold of the anchor rows (value within a column of X). Default 0.5 / P, half the value of a uniform basis.

alpha

Level of the test. Default 0.05.

start

Starting point of the repair: "nearest" (default; the point of the region closest to object's C) or "center" (the point closest to the midpoints of the ranges of C).

region

Logical. Compute the identification region and the repaired fit (steps 2 and 3). Default TRUE; FALSE returns the test only, in a second or so.

ci

Logical. Compute profile-likelihood intervals for C. Default FALSE (it takes minutes for moderate P; see cores).

ci.level

Confidence level of the intervals. Default 0.95.

ci.step

Grid step of the profile, as a fraction of the column sum of \hat\Xi. Default 0.02. The interval ends are refined by bisection between grid points.

region.n

Number of random factorizations drawn to explore the region. Default 50000. Drawing them is cheap (about 2 seconds for 50000 at P = 67); fewer than a few thousand leave the region visibly too narrow.

region.nstart

Number of the most extreme random factorizations from which each end of the region is refined by Nelder–Mead. Default 3. This is where the time goes (about 20 seconds at 3, a minute at 10, for P = 67 and rank 3).

epsilon, maxit

Tolerance and iteration cap of the repair re-fit. Defaults 1e-8 and 1e5.

seed

Seed. Default 123. The caller's random stream is restored on exit.

cores

Number of cores for the profile intervals. Default getOption("mc.cores", 1L); results do not depend on it.

zero.tol

Algebraic check: an entry of X (C) at most zero.tol times its column (row) maximum counts as 0. Default 1e-3. The threshold is relative; the sufficient condition does not use it but keeps the rule of summary.nmfkc() (an entry at most 1e-3 in absolute terms, or at most 1% of the entry it is compared with, counts as 0).

move.tol

Algebraic check: a remixing counts as moving the fit when it changes an entry of X or an entry of C relative to its column sum by more than this. Default 1e-3.

ident.n

Algebraic check: number of random directions added to the pairwise and cone directions. Default 2000.

Details

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.

Value

An object of class "nmfkc.ident":

algebraic

List: verdict (text), sufficient (two-sided anchors / peeling), A.full.rank, cone.trivial (no remixing moves the fit to first order), pairs (data frame basis, from, a.min, a.max: column basis of X can become (1-a)x_{basis} + a x_{from}), X.lower, X.upper, C.lower, C.upper (inner bounds of the identification region, containing the fit), width.X, width.C (largest width; for C relative to its column sums, which do not change), moved (number of directions that moved the fit, by kind), zero.tol, move.tol, n.dir.

test

NULL without A; otherwise a list: pi, rho, alpha, reject (decision at pi, rho), pi.max, rho.max, pi.point (point estimate of the attainable membership probability), crit (critical value), candidate (rows and columns of a surviving candidate, or NULL).

Xi.hat

The maximum over the model (P x R); NULL if R > rank.

C.region.lower, C.region.upper

Identification region of C (Q x R), bases in object's order.

X.region.lower, X.region.upper

Identification region of X (P x Q).

identified

Logical: the region of C is a single point.

X, C

The repaired basis and coefficients (bases in object's order).

fit

The repaired "nmfkc" object (bases in object's order), usable with nmfkc.inference and the other methods.

repair

List: start, iter, change (largest change of C during the re-fit), gap (largest |XC - \hat\Xi|, relative to the largest entry of \hat\Xi).

C.ci.lower, C.ci.upper

Profile-likelihood interval of C, which contains the identification region (NULL unless ci = TRUE).

ci.level, rank, call

As named; dims holds P, N, R.

Algebraic check

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.

  1. 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.

  2. 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.

  3. 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.

References

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")}

See Also

nmfkc, nmfkc.inference, summary.nmfkc.ident, plot.nmfkc.ident

Examples

## 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


nmfkc documentation built on Nov. 30, 2026, 1:06 a.m.