大家好,
我正在制作这个比较协方差矩阵的表格,但我无法完成我想要的两件事。首先,我希望矩阵的大小完全相同(上面的矩阵现在似乎更大)。其次,我也想看到其他两个矩阵上方的 Sigma+箭头。
我的代码:
\begin{table}[H]
\caption{Covariance matrices using IME and sandwich form}\label{tab:2}
\vspace{-0.3cm}
\begin{adjustbox}{width=1\columnwidth, center}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} c c}
\toprule
\textbf{Normally distributed errors} & \textbf{Student-t distributed errors} \\
\midrule
$\Sigma_{IME}(\theta)$: \Longrightarrow \\ \[\left[ \begin{array}{ccc} \num{-2.05e-4} & \num{-7.16e-10} & \num{-2.42e-08} \\ \num{-7.16e-10} & \num{2.05e-04} & \num{2.71e-05} \\ \num{-2.42e-08} & \num{2.71e-05} & \num{2.64e-03} \end{array}\right]\] & \[\left[ \begin{array}{ccc} \num{2.04e-08} & \num{-3.82e-12} & \num{-8.77e-12} \\ \num{-3.82e-12} & \num{4.11e-08} & \num{5.43e-09} \\ \num{-8.77e-12} & \num{5.43e-09} & \num{5.28e-07} \end{array}\right]\] \\
$\Sigma_{Sandwich}(\theta)$: \Longrightarrow \\ \[\left[ \begin{array}{ccc} \num{6.58e-01} & \num{-1.64e-05} & \num{1.31e-04} \\ \num{-1.64e-05} & \num{2.04e-04} & \num{2.72e-05} \\ \num{1.31e-04} & \num{2.72e-05} & \num{2.64e-03} \end{array}\right]\] & \[\left[ \begin{array}{ccc} \num{2.06e-08} & \num{3.85e-12} & \num{8.82e-12} \\ \num{3.85e-12} & \num{4.11e-08} & \num{5.44e-09} \\ \num{8.82e-12} & \num{5.44e-09} & \num{5.29e-07} \end{array}\right]\] \\
\midrule[\heavyrulewidth]
\end{tabular*}
\end{adjustbox}
\centering
\end{table
答案1
如果有人可以使这个表格适合放在一个页面上,并且 Sigmas 作为左侧的单独列,那么我会更高兴!
希望让你开心:-)
\documentclass{article}
\usepackage[letterpaper,margin=1in]{geometry}
\usepackage{amsmath,siunitx,booktabs,amssymb}
\newcolumntype{R}{>{$}r<{$}}
\newcolumntype{C}{>{$}c<{$}}
\begin{document}
\begin{table}[ht!]
\sisetup{table-format=-1.2e-2,tight-spacing}
\setlength\arraycolsep{2pt} % default: 5pt
\setlength\tabcolsep{0pt}
\caption{Covariance matrices using IME and sandwich form\strut}\label{tab:2}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} RCC}
\toprule
& \text{Normally distributed errors}
& \text{Student-$t$ distributed errors} \\
\midrule
\Sigma_{\textrm{IME}}(\theta): \Longrightarrow &
\left[ \begin{array}{@{}SSS@{}}
-2.05e-4 & -7.16e-10 & -2.42e-08 \\
-7.16e-10 & 2.05e-04 & 2.71e-05 \\
-2.42e-08 & 2.71e-05 & 2.64e-03
\end{array}\right]
&
\left[ \begin{array}{@{}SSS@{}}
2.04e-08 & -3.82e-12 & -8.77e-12 \\
-3.82e-12 & 4.11e-08 & 5.43e-09 \\
-8.77e-12 & 5.43e-09 & 5.28e-07
\end{array}\right]
\\ \addlinespace
\Sigma_{\textrm{Sandwich}}(\theta): \Longrightarrow &
\left[ \begin{array}{@{}SSS@{}}
6.58e-01 & -1.64e-05 & 1.31e-04 \\
-1.64e-05 & 2.04e-04 & 2.72e-05 \\
1.31e-04 & 2.72e-05 & 2.64e-03
\end{array}\right]
&
\left[ \begin{array}{@{}SSS@{}}
2.06e-08 & 3.85e-12 & 8.82e-12 \\
3.85e-12 & 4.11e-08 & 5.44e-09 \\
8.82e-12 & 5.44e-09 & 5.29e-07
\end{array}\right]
\\
\bottomrule
\end{tabular*}
\end{table}
\end{document}
答案2
使用该siunitx
包:
\documentclass{article}
\usepackage{geometry}
\usepackage{siunitx}
\usepackage{booktabs, tabularx}
\begin{document}
\begin{table}[ht]
\sisetup{table-number-alignment = center,
table-figures-integer = 2,
table-figures-decimal = 2,
table-figures-exponent = 2,
}
\renewcommand\arraystretch{1.2}
\caption{Covariance matrices using IME and sandwich form}
\label{tab:2}
\begin{tabularx}{\textwidth}{ *{2}{>{$}X<{$}} }
\toprule
\addlinespace
\textbf{Normally distributed errors}
& \textbf{Student-t distributed errors} \\
\midrule
\Sigma_{\text{IME}}(\theta):\quad \Longrightarrow
& \\
\left[\begin{tabular}{SSS}
-2.05e-4 & -7.16e-10 & -2.42e-08 \\
-7.16e-10 & 2.05e-04 & 2.71e-05 \\
-2.42e-08 & 2.71e-05 & 2.64e-03
\end{tabular}\right]
& \left[\begin{tabular}{SSS}
2.04e-08 & -3.82e-12 & -8.77e-12 \\
-3.82e-12 & 4.11e-08 & 5.43e-09 \\
-8.77e-12 & 5.43e-09 & 5.28e-07
\end{tabular}\right] \\
% second row
\addlinespace
\Sigma_{\text{Sandwich}}(\theta):\quad \Longrightarrow
& \\
\left[\begin{tabular}{SSS}
6.58e-01 & -1.64e-05 & 1.31e-04 \\
-1.64e-05 & 2.04e-04 & 2.72e-05 \\
1.31e-04 & 2.72e-05 & 2.64e-03
\end{tabular}\right]
& \left[\begin{tabular}{SSS}
2.06e-08 & 3.85e-12 & 8.82e-12 \\
3.85e-12 & 4.11e-08 & 5.44e-09 \\
8.82e-12 & 5.44e-09 & 5.29e-07
\end{tabular}\right] \\
\addlinespace
\bottomrule
\end{tabularx}
\end{table}
\end{document}