Description Usage Arguments Value Author(s) References See Also Examples

View source: R/alpha.crossvalid.R

Estimates alpha shrinkage intensity parameter by the method proposed in Pepler (2014), for improved estimation of population covariance matrices.

1 | ```
alpha.crossvalid(datamat, B, reps = 100)
``` |

`datamat ` |
Matrix containing sample data for the ith group. |

`B ` |
Matrix of estimated common (and possibly non-common) eigenvectors. Can be estimated using simultaneous diagonalisation algorithms such as the Flury-Gautschi (implemented in |

`reps ` |
Number of replications to use in cross-validation. |

Returns the estimated shrinkage intensity (scalar), a value between 0 and 1.

Theo Pepler

Pepler, P.T. (2014). The identification and application of common principal components. PhD dissertation in the Department of Statistics and Actuarial Science, Stellenbosch University.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
# Versicolor and virginica groups of the Iris data
data(iris)
versicolor <- iris[51:100, 1:4]
virginica <- iris[101:150, 1:4]
# Create array containing the two covariance matrices
S <- array(NA, c(4, 4, 2))
S[, , 1] <- cov(versicolor)
S[, , 2] <- cov(virginica)
nvec <- c(nrow(versicolor), nrow(virginica))
# Estimate the modal matrix using the FG algorithm
B <- FG(covmats = S, nvec = nvec)$B
# Estimate optimal shrinkage intensity for the versicolor covariance matrix
alpha.crossvalid(datamat = versicolor, B = B, reps = 1000)
``` |

tpepler/cpc documentation built on Nov. 19, 2017, 1:19 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.