# Mlpca

### Purpose

Maximum likelihood principal components analysis (user contributed).

### Synopsis

- [U,S,V,SOBJ,ErrFlag] = mlpca(x,stdx,p)

### Description

MLPCA performs maximum likelihood principal components analysis assuming uncorrelated measurement errors. This is a method that attempts to provide an optimal estimation of the *p*-dimensional subspace containing the data by taking into account uncertainties in the measurements, thereby dealing with those cases that cannot be treated by simple scaling.

Inputs are x (*m* by *n*) the data matrix to be decomposed, stdx (*m* by *n*) matrix of standard deviations corresponding to the observations in x, and the number of factors into which the data is decomposed p.

The outputs are U (*m* by *p*) orthonormal, S (*p* by *p*) diagonal, and V (*n* by *p*) orthonormal. The ML scores are given by U\*S. Additional output SOBJ is the value of the objective function for the best model. For exact uncertainty estimates, this should follow a chi-squared distribution with (m-p)\*(n-p) degrees of freedom. Additional output ErrFlag indicates the termination conditions of the function;

ErrFlag = 0: normal termination (convergence), or

ErrFlag = 1: maximum number of iterations exceeded.

**Further Reference:**

P.D. Wentzell and M.T. Lohnes, "Maximum Likelihood Principal Component Analysis with Correlated Measurement Errors Theoretical and Practical Considerations", Chemom. Intell. Lab. Syst., **45**, 65-85 (1999).

P.D. Wentzell, D.T. Andrews, D.C. Hamilton, K. Faber, and B.R. Kowalski, "Maximum likelihood principal component analysis", J. Chemometrics **11**(4), 339-366 (1997).

P.D. Wentzell, D.T. Andrews, and B.R. Kowalski, "Maximum likelihood multivariate calibration", Anal. Chem., **69**, 2299-2311 (1997).

D.T. Andrews and P.D. Wentzell, "Applications of maximum likelihood principal components analysis: Incomplete data and calibration transfer", Anal. Chim. Acta, **350**, 341-352 (1997).