The FMM Procedure

Looking for Multiple Modes: Are Galaxies Clustered?

(View the complete code for this example.)

Mixture modeling is essentially a generalized form of one-dimensional cluster analysis. The following example shows how you can use PROC FMM to explore the number and nature of Gaussian clusters in univariate data.

Roeder (1990) presents data from the Corona Borealis sky survey with the velocities of 82 galaxies in a narrow slice of the sky. Cosmological theory suggests that the observed velocity of each galaxy is proportional to its distance from the observer. Thus, the presence of multiple modes in the density of these velocities could indicate a clustering of the galaxies at different distances.

The following DATA step recreates the data set in Roeder (1990). The computed variable v represents the measured velocity in thousands of kilometers per second.

title "FMM Analysis of Galaxies Data";
data galaxies;
   input velocity @@;
   v = velocity / 1000;
   datalines;
9172  9350  9483  9558  9775  10227 10406 16084 16170 18419
18552 18600 18927 19052 19070 19330 19343 19349 19440 19473
19529 19541 19547 19663 19846 19856 19863 19914 19918 19973
19989 20166 20175 20179 20196 20215 20221 20415 20629 20795
20821 20846 20875 20986 21137 21492 21701 21814 21921 21960
22185 22209 22242 22249 22314 22374 22495 22746 22747 22888
22914 23206 23241 23263 23484 23538 23542 23666 23706 23711
24129 24285 24289 24366 24717 24990 25633 26960 26995 32065
32789 34279
;

Analysis of potentially multi-modal data is a natural application of finite mixture models. In this case, the modeling is complicated by the question of the variance for each of the components. Using identical variances for each component could obscure underlying structure, but the additional flexibility granted by component-specific variances might introduce spurious features.

You can use PROC FMM to prepare analyses for equal and unequal variances and use one of the available fit statistics to compare the resulting models. You can use the model selection facility to explore models that have varying numbers of mixture components—say, from three to seven as investigated in Roeder (1990). The following statements select the best unequal-variance model by using Akaike’s information criterion (AIC), which has a built-in penalty for model complexity:

title2 "Three to Seven Components, Unequal Variances";
ods graphics on;
proc fmm data=galaxies criterion=AIC;
   model v = / kmin=3 kmax=7;
run;

The KMIN= and KMAX= options indicate the smallest and largest number of components to consider. Figure 40.14, Figure 40.15, and Figure 40.16 show a selection of the output from this unequal variances model.

Figure 40.14: Model Selection for Galaxy Data Assuming Unequal Variances

FMM Analysis of Galaxies Data
Three to Seven Components, Unequal Variances

The FMM Procedure

Model Information
Data SetWORK.GALAXIES
Response Variablev
Type of ModelHomogeneous Mixture
DistributionNormal
Min Components3
Max Components7
Link FunctionIdentity
Estimation MethodMaximum Likelihood

Component Evaluation for Mixture Models
Model
ID
Number of -2 Log LAICAICCBICPearsonMax
Gradient
ComponentsParameters
TotalEff.TotalEff.
13388406.96422.96424.94442.2282.000.000024
2441111406.96428.96432.74455.4482.000.00012
3551414406.96434.96441.23468.6682.000.000050
4661717406.96440.96450.53481.8882.000.000057
5772020406.96446.96460.73495.1082.000.000039

The model with 3 components (ID=1) was selected as 'best' based on the AIC statistic.


Fit Statistics
-2 Log Likelihood407.0
AIC (Smaller is Better)423.0
AICC (Smaller is Better)424.9
BIC (Smaller is Better)442.2
Pearson Statistic82.0002
Effective Parameters8
Effective Components3

Parameter Estimates for Normal Model
ComponentParameterEstimateStandard
Error
z ValuePr > |z|
1Intercept9.71010.159760.80<.0001
2Intercept33.04440.532262.09<.0001
3Intercept21.40390.259782.41<.0001
1Variance0.17850.09542  
2Variance0.84960.6937  
3Variance4.85670.8098  

Parameter Estimates for Mixing Probabilities
Component
Mixing
Probability
Linked Scale
GLogit(Prob)Standard
Error
z ValuePr > |z|
10.0854-2.33080.3959-5.89<.0001
20.0366-3.17810.5893-5.39<.0001
30.87810   


Figure 40.15: Density Plot for Best (Three-Component) Model Assuming Unequal Variances

 Density Plot for Best (Three-Component) Model Assuming Unequal Variances


Figure 40.16: Criterion Panel Plot for Model Selection Assuming Unequal Variances

 Criterion Panel Plot for Model Selection Assuming Unequal Variances


This example uses the AIC for model selection. Figure 40.16 shows the AIC and other model fit criteria for each of the fitted models.

To require that the separate components have identical variances, add the EQUATE=SCALE option in the MODEL statement:

title2 "Three to Seven Components, Equal Variances";
proc fmm data=galaxies criterion=AIC gconv=0;
   model v = / kmin=3 kmax=7  equate=scale;
run;

The GCONV= convergence criterion is turned off in this PROC FMM run to avoid the early stoppage of the iterations when the relative gradient changes little between iterations. Turning the criterion off usually ensures that convergence is achieved with a small absolute gradient of the objective function.

The output for equal variances is shown in Figure 40.17 and Figure 40.18.

Figure 40.17: Model Selection for Galaxy Data Assuming Equal Variances

FMM Analysis of Galaxies Data
Three to Seven Components, Equal Variances

The FMM Procedure

Model Information
Data SetWORK.GALAXIES
Response Variablev
Type of ModelHomogeneous Mixture
DistributionNormal
Min Components3
Max Components7
Link FunctionIdentity
Estimation MethodMaximum Likelihood

Component Evaluation for Mixture Models
Model
ID
Number of -2 Log LAICAICCBICPearsonMax
Gradient
ComponentsParameters
TotalEff.TotalEff.
13366478.74490.74491.86505.1882.001.197E-6
24488416.49432.49434.47451.7582.006.161E-6
3551010416.49436.49439.59460.5682.004.316E-6
4661212416.49440.49445.02469.3782.006.294E-6
5771414416.49444.49450.76478.1982.004.884E-6

The model with 4 components (ID=2) was selected as 'best' based on the AIC statistic.


Fit Statistics
-2 Log Likelihood416.5
AIC (Smaller is Better)432.5
AICC (Smaller is Better)434.5
BIC (Smaller is Better)451.7
Pearson Statistic82.0000
Effective Parameters8
Effective Components4

Parameter Estimates for Normal Model
ComponentParameterEstimateStandard
Error
z ValuePr > |z|
1Intercept23.50580.346067.93<.0001
2Intercept33.04400.761043.42<.0001
3Intercept20.00860.302966.06<.0001
4Intercept9.71030.498119.50<.0001
1Variance1.73540.3905  
2Variance1.73540.3905  
3Variance1.73540.3905  
4Variance1.73540.3905  

Parameter Estimates for Mixing Probabilities
Component
Mixing
Probability
Linked Scale
GLogit(Prob)Standard
Error
z ValuePr > |z|
10.35031.41180.44973.140.0017
20.0366-0.84730.6901-1.230.2195
30.52771.82160.42054.33<.0001
40.08540   


Figure 40.18: Density Plot for Best (Four-Component) Model Assuming Equal Variances

 Density Plot for Best (Four-Component) Model Assuming Equal Variances


Not surprisingly, the two variance specifications produce different optimal models. The unequal variance specification favors a three-component model while the equal variance specification favors a four-component model. Comparison of the AIC fit statistics, 423.0 and 432.5, indicates that the three-component, unequal variance model provides the best overall fit.