Normalize a vector or matrix to zero mean and unit length columns

1 | ```
normalize(X)
``` |

`X` |
a matrix with the training data with observations down the rows and variables in the columns. |

The function can e.g. be used for the training data in sda or smda.

Returns a list with the following attributes:

`Xc` |
The normalized data. |

`mx` |
Mean of columns of X. |

`vx` |
Length of columns of X. |

`Id` |
Logical vector indicating which variables are included in X. If some of the columns have zero length they are omitted. |

Line Clemmensen

Clemmensen, L., Hastie, T. and Ersboell, K. (2008) "Sparse discriminant analysis", Technical report, IMM, Technical University of Denmark

1 2 3 4 5 6 7 8 9 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.