factor_scores: Computes Factor Scores

Description Usage Arguments Details Value Author(s) References Examples

Description

This function computes factor scores for observations. Using factor scores, we can represent the original data point y_j in a q-dimensional reduced space. This is only meaningful in the case of mcfa or mctfa models, as the factor cores for mfa and mtfa are white noise.

The (estimated conditional expectation of) unobservable factors U_{ij} given y_j and the component membership can be expressed by,

\hat{u}_{ij} = E_{\hat{Ψ}}\{U_{ij} \mid y_j, z_{ij} = 1\}.

The estimated mean U_{ij} (over the component membership of y_j) is give as

\hat{u}_{j} = ∑_{i=1}^g τ_i(y_j; \hat{Ψ}) \hat{u}_{ij},

where τ_i(y_j; \hat{Ψ}) estimated posterior probability of y_j belonging to the ith component.

An alternative estimate of u_j, the posterior expectation of the factor corresponding to the jth observation y_j, is defined by replacing τ_i(y_j;\,\hat{Ψ}) by \hat{z}_{ij}, where \hat{z}_{ij} = 1, if \hat{τ}_i(y_j; \hat{Ψ}) >= \hat{τ_h}(y_j; \hat{Ψ}) (h=1,\,…,\,g; h \neq i), else \hat{z}_{ij} = 0.

\hat{u}_{j}^C = ∑_{i=1}^g \hat{z}_{ij} \hat{u}_{ij}.

For MFA, we have

\hat{u}_{ij} = \hat{β}_i^T (y_j - \hat{μ}_i),

and

\hat{u}_{j} = ∑_{i=1}^g τ_i(y_j; \hat{Ψ}) \hat{β}_i^T (y_j - \hat{μ}_i)

for j = 1, …, n where \hat{β}_i = (B_iB_i^T + D_i)^{-1} B_i.

For MCFA,

\hat{u}_{ij} = \hat{ξ}_i + \hat{γ}_i^T (y_j -\hat{A}\hat{ξ}_i),

\hat{u}_{j} = ∑_{i=1}^gτ_i(y_j; \hat{Ψ}) \{\hat{ξ}_i + \hat{γ}_i^T(y_j -\hat{A}\hat{ξ}_i)\},

where γ_i = (A Ω_i A + D)^{-1} A Ω_i.

With MtFA and MCtFA, the distribution of \hat{u}_{ij} and of \hat{u}_{j} have the same form as those of MFA and MCFA, respectively.

Usage

1
2
3
4
5
6
7
factor_scores(model, Y, ...)
## S3 method for class 'mcfa'
factor_scores(model, Y, tau = NULL, clust= NULL, ...)
## S3 method for class 'mctfa'
factor_scores(model, Y, tau = NULL, clust= NULL, ...)
## S3 method for class 'emmix'
plot(x, ...)

Arguments

model

An object of class mfa, mcfa, mtfa or mctfa.

x

An object of class mfa, mcfa, mtfa or mctfa.

Y

Data matrix with variables in columns in the same order as used in model estimation.

tau

Optional. Posterior probabilities of belonging to the components in the mixture model. If not provided, they will be computed based on the model parameters.

clust

Optional. Indicators of belonging to the components. If not provided, will be estimated using tau.

...

Not used.

Details

Factor scores can be used in visualization of the data in the factor space.

Value

Uscores

Estimated conditional expected component scores of the unobservable factors given the data and the component membership (\hat{u}_{ij}). Size is n \times q \times g, where n is the number of sample, q is the number of factors and g is the number components.

Umean

Means of the estimated conditional expected factors scores over estimated posterior distributions (\hat{u}_{j}). Size n \times q.

Uclust

Alternative estimate of Umean where the posterior probabilities for each sample are replaced by component indicator vectors which contain one in the element corresponding to the highest posterior probability while others zero (\hat{u}_{j}^C). Size n \times q.

Author(s)

Geoff McLachlan, Suren Rathnayake, Jungsun Baek

References

McLachlan GJ, Baek J, and Rathnayake SI (2011). Mixtures of factor analyzers for the analysis of high-dimensional data. In Mixture Estimation and Applications, KL Mengersen, CP Robert, and DM Titterington (Eds). Hoboken, New Jersey: Wiley, pp. 171–191.

McLachlan GJ, and Peel D (2000). Finite Mixture Models. New York: Wiley.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Fit a MCFA model to a subset
set.seed(1)
samp_size <- dim(iris)[1]
sel_subset <- sample(1 : samp_size, 50)
model <- mcfa(iris[sel_subset, -5], g = 3, q = 2, 
                          nkmeans = 1, nrandom = 0, itmax = 100)

# plot the data points in the factor space
plot(model)

# Allocating new samples to the clusters
Y <- iris[-c(sel_subset), -5]
Y <- as.matrix(Y)
clust <- predict(model, Y)

fa_scores <- factor_scores(model, Y)
# Visualizing new data in factor space
plot_factors(fa_scores, type = "Umean", clust = clust)

suren-rathnayake/EMMIXmfa documentation built on May 17, 2019, 8:45 p.m.