amsmath – Best Way to Create Complex Formulas in LaTeX

amsmathmatrices

I'm trying to create this formula (the one with the matrices) for my essay in latex but I'm having a hard time finding the best way of going about it.

matrix formula

Best Answer

The coding of this matrix product is quite straightforward, just take the time to write the four matrices that make up the formula with indexed variables.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\begin{equation*}
  \begin{pmatrix}
    y_1 \\
    \vdots \\
    y_n
  \end{pmatrix}=
  \begin{pmatrix}
    1 & x_{12} & \ldots & x_{1k} \\
    \vdots & \vdots & \ddots & \vdots \\
    1 & x_{N2} & \ldots & x_{Nk}
  \end{pmatrix}
  \begin{pmatrix}
    \beta_1 \\
    \vdots \\
    \beta_k
  \end{pmatrix}
  +
  \begin{pmatrix}
    u_1 \\
    \vdots \\
    u_k
  \end{pmatrix}
\end{equation*}
% <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
\end{document}
      

produit matriciel

Related Question