Uses the stepwise procedure described in Section 13.1.4 to find a pattern for a set of observed eigenvalues with good BIC value.

pcbic.stepwise(eigenvals, n)

Arguments

eigenvals

The \(Q\)-vector of eigenvalues of the covariance matrix, in order from largest to smallest.

n

The degrees of freedom in the covariance matrix.

Value

A list with the following components:

Patterns

A list of patterns, one for each value of length \(K\).

BICs

A vector of the BIC's for the above patterns.

BestBIC

The best (smallest) value among the BIC's in BICs.

BestPattern

The pattern with the best BIC.

lambdaHat

A \(Q\)-vector containing the MLE's for the eigenvalues for the pattern with the best BIC.

Examples

# Build cars1
require("mclust")
mcars <- Mclust(cars)
cars1 <- cars[mcars$classification == 1, ]
xcars <- scale(cars1)
eg <- eigen(var(xcars))
pcbic.stepwise(eg$values, 95)
#> $Patterns
#> $Patterns[[1]]
#>  [1] 1 1 1 1 1 1 1 1 1 1 1
#> 
#> $Patterns[[2]]
#>  [1] 1 1 1 1 1 2 1 1 1 1
#> 
#> $Patterns[[3]]
#> [1] 1 1 1 2 2 1 1 1 1
#> 
#> $Patterns[[4]]
#> [1] 1 1 3 2 1 1 1 1
#> 
#> $Patterns[[5]]
#> [1] 1 1 3 2 1 2 1
#> 
#> $Patterns[[6]]
#> [1] 1 1 3 3 2 1
#> 
#> $Patterns[[7]]
#> [1] 1 1 3 3 3
#> 
#> $Patterns[[8]]
#> [1] 1 4 3 3
#> 
#> $Patterns[[9]]
#> [1] 1 4 6
#> 
#> $Patterns[[10]]
#> [1] 5 6
#> 
#> $Patterns[[11]]
#> p1 
#> 11 
#> 
#> 
#> $BICs
#>  [1] -861.196176 -869.009931 -876.649946 -885.088665 -892.222896 -895.488524
#>  [7] -888.501861 -870.823946 -801.384858 -657.561496    4.553877
#> 
#> $BestBIC
#> [1] -895.4885
#> 
#> $BestPattern
#> [1] 1 1 3 3 2 1
#> 
#> $LambdaHat
#>  [1] 6.20990339 1.83332778 0.71561848 0.71561848 0.71561848 0.21276067
#>  [7] 0.21276067 0.21276067 0.07077652 0.07077652 0.03007833
#>