I wonder may I ask about why I received the error note from R-Markdown that
! LaTeX Error: \begin{array} on input line 569 ended by \end{equation*}.
#1,
Let X =
\[
\left(\begin{array}{cc}
1 & X1\\
\dots & \dots\\
1 & X_n
\end{array}\right)
%\left(\begin{array}{cc}
10 & 0\\
0 & 5
\end{array}\right)
\]
Then, \[X^T\] =
\[
\left(\begin{array}{cc}
1 & \dots & 1\\
X_1 & \dots & X_N
\end{array}\right)
\]
\[
X \times X^T =
\]
\[\left(\begin{array}{cc}
1 & X1\\
\dots & \dots\\
1 & X_n
\end{array}\right)\]
\[\left(\begin{array}{cc}
1 & \dots & 1\\
X_1 & \dots & X_N
\end{array}\right)
\]
=
\[
\left(\begin{array}{cc}
n & \sum_{i}^n X_i\\
\sum_{i}^n X_i & \sum_{i}^n X_i^2
\end{array}\right)
\]
#2,
\[(X^TX)^{-1}\]=
\[1/[n\sum_{i=1}^n X_i^2 - (\sum_{i=1}^n X_i)^2]
\left(\begin{array}{cc}
\sum_{i=1}^n X_i^2 & -\sum_{i=1}^n Xi\\
- \sum _{i=1}^n X_i & n
\end{array}\right) \]
=\[1/[n \sum _{i=1}^n X_i^2 - ( \sum X_i)^2] [n \sum_{i=1}^n X_i^2 - ( \sum _{i=1} ^n X_i)^2]\]
=1
The above are the code I only had about the command{array}, I am sorry I am new to R-Markdown and I cannot find the line 569 since my last line is line 373. Thank you very much for any suggestions! Appreciated!
X
is annx2
matrix, the dimension ofXX^T
must benxn
, not2x2
. Second, ifn>1
, the matrixXX^T
is not of full rank and its inverse does not exist -- let alone be equal to scalar1
. Are you maybe referring toX^T X
and its inverse? By the way, the inverse ofX^T X
should be a2x2
matrix, not the number1
. If the math isn't correct, it's not all that productive to try to fix up the LaTeX code, is it?