2023-09-22 23:48:46 +02:00
|
|
|
% ref. https://tex.stackexchange.com/a/523362/235607
|
|
|
|
\documentclass[tikz]{standalone}
|
|
|
|
\usepackage{tikz-3dplot}
|
|
|
|
\usepackage{tkz-euclide}
|
|
|
|
\usepackage{mathtools}
|
|
|
|
\begin{document}
|
|
|
|
\tdplotsetmaincoords{50}{0}
|
|
|
|
\begin{tikzpicture}[tdplot_main_coords,bullet/.style={circle,inner
|
|
|
|
sep=1pt,fill=black,fill opacity=1}]
|
|
|
|
\begin{scope}[canvas is xy plane at z=0]
|
|
|
|
\tkzDefPoints{-2/-1/A,3/-1/B,4/2/C}
|
|
|
|
\tkzDefParallelogram(A,B,C)
|
|
|
|
\tkzGetPoint{D}
|
|
|
|
\tkzDrawPolygon[fill=gray!25!white](A,B,C,D)
|
2023-09-30 07:03:23 +02:00
|
|
|
|
2023-09-22 23:48:46 +02:00
|
|
|
\end{scope}
|
2023-09-30 07:03:23 +02:00
|
|
|
% Draw the rectangle triangle scheme
|
|
|
|
\begin{scope}[canvas is xz plane at y=1]
|
2023-09-22 23:48:46 +02:00
|
|
|
\draw[thick,fill=white,fill opacity=0.7,nodes={opacity=1}]
|
2023-09-30 07:03:23 +02:00
|
|
|
(2,0) node[bullet,label=right:{$\bar{\mathbf{Y}}$}] (Y_bar) {}
|
|
|
|
-- (0,-0.5) node (B) {}
|
|
|
|
-- (0,3) node[label=above:{$\mathbf{Y}$}] (Y) {} -- cycle;
|
|
|
|
% Right angle annotation
|
|
|
|
\tkzPicRightAngle[draw,
|
|
|
|
angle eccentricity=.5,angle radius=2mm](Y,B,Y_bar)
|
|
|
|
% epsilon: Y - X \hat{\beta} curly brackets annotations
|
|
|
|
\draw[decorate,decoration={brace,
|
|
|
|
amplitude=8pt},xshift=0pt,very thin,gray] (B) -- (Y) node [black,midway,xshift=-1.25em,yshift=0em] {\color{blue}$b$};
|
|
|
|
% X\hat{\beta} - \hat{Y}
|
|
|
|
\draw[decorate,decoration={brace,
|
|
|
|
amplitude=8pt},xshift=0pt,very thin,gray] (Y_bar) -- (B) node [black,midway,xshift=0.5em,yshift=-1em] {\color{blue}$a$};
|
|
|
|
%
|
2023-09-22 23:48:46 +02:00
|
|
|
\draw[decorate,decoration={brace,
|
2023-09-30 07:03:23 +02:00
|
|
|
amplitude=8pt},xshift=0pt,very thin,gray] (Y) -- (Y_bar) node [black,midway,xshift=1em,yshift=1em] {\color{blue}$c$};
|
2023-09-22 23:48:46 +02:00
|
|
|
\end{scope}
|
2023-09-30 07:03:23 +02:00
|
|
|
% Coordinate system
|
2023-09-22 23:48:46 +02:00
|
|
|
\begin{scope}[canvas is xy plane at z=0]
|
2023-09-30 07:03:23 +02:00
|
|
|
\draw[->] (2,1) -- node [above] {$\mathbf{1}$} ++(-1,0) ;
|
|
|
|
\draw[->] (2,1) -- ++(-0.45,-1) node [right] {$X_1$};
|
2023-09-22 23:48:46 +02:00
|
|
|
\end{scope}
|
|
|
|
\end{tikzpicture}
|
|
|
|
\end{document}
|