# Computes the center vector, eigenvalues and loading matrix corresponding to a PCA model of a data matrix with respect to a subset of observations in a data set

### Description

This function is used in FastHCS to compute the parameter estimates of the PCA models used at different steps of the algorithm. It is an internal function not intended to be called by the user.

### Usage

1 | ```
compPcaParams(x,fitd,q=NULL,z0=NULL,seed=1)
``` |

### Arguments

`x` |
A data matrix x. |

`fitd` |
The (internal) result of a call to FastHCS. |

`q` |
Desired rank of the SVD decomposition. |

`z0` |
Optional. Result of a call to |

`seed` |
Seed used to initialize the RNG. Defaults to 1. |

### Value

A list with the following components:

`center` |
The multivariate mean of the observations with indexes in best. |

`loadings` |
The (rank q) loadings matrix of the observations with indexes in best. |

`eigenvalues` |
The eigenvalues of the observations with indexes in best multiplied by a consistency factor. |

`scores` |
The value of the projected on the space of the principal components data (the centred data multiplied by the loadings matrix) is returned. Hence, cov(scores) is the diagonal matrix diag(eigenvalues). |

### Author(s)

Kaveh Vakili, Eric Schmitt