\documentclass[12pt]{article}  
\usepackage{epsfig}

\title{Some Intuitions behind PCA} 

\author{William W. Cohen}

\begin{document}

\maketitle

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}

\newcommand{\trm}[1]{{\it {#1}}}
\newcommand{\vek}[1]{\mbox{\bf #1}}
%\newcommand{\vek}[1]{{\vec{#1}}}
\newcommand{\vu}{\vek{u}}
\newcommand{\vv}{\vek{v}}
\newcommand{\vw}{\vek{w}}
\newcommand{\vx}{\vek{x}}
\newcommand{\vy}{\vek{y}}
\newcommand{\vz}{\vek{z}}
\newcommand{\sign}{{\rm sign}}
\newcommand{\norm}[1]{{|\!|{#1}|\!|}}
\newcommand{\normSq}[1]{{|\!|{#1}|\!|}^2}

\newcommand{\matWithRows}[1]{\left[\begin{array}{c}
                                    \vdots\\%
                                    -~ {#1} ~-\\%
                                    \vdots%
                                   \end{array}\right]}

\newcommand{\widematWithRows}[1]{\left[\begin{array}{c}
                                    \vdots\\%
                                    ~-  ~-~ {#1} ~-  ~-\\%
                                    \vdots%
                                   \end{array}\right]}


\newcommand{\matWithCols}[1]{\left[\begin{array}{ccc}
                                          &|&  \\%
                                    \ldots&{#1}&\ldots\\%
                                          &|& \\%
                                   \end{array}\right]}


\newcommand{\tallmatWithCols}[1]{\left[\begin{array}{ccc}
                                          &|&  \\%
                                          &|&  \\%
                                    \ldots&{#1}&\ldots\\%
                                          &|& \\%
                                          &|& \\%
                                   \end{array}\right]}



\section{PCA as optimization}

\[ \hat{\vx}^t = \sum_{i=1}^k z_{k}^t {\vu}_k 
\]

\[
J = \frac{1}{N} \sum_{t=1}^N |\!| \vx^t - \hat{\vx}^t |\!|^2
\]

\[ Z = \tallmatWithCols{\vz^t} \]

\[ U = \widematWithRows{\vu_k} \]


\[ \tallmatWithCols{\vz^t} \widematWithRows{\vu_k}  = \matWithRows{\hat{\vx}^t} = \hat{X}
\]

\end{document}

