공동 및 한계 PDF에 필요한 PGFPLOT 도움말

공동 및 한계 PDF에 필요한 PGFPLOT 도움말

결합 PDF 두 개의 독립 정규 확률 변수저는 Matlab에서 두 개의 독립 정규 확률 변수에 대한 처음 두 수치를 만들었습니다. 누군가 내가 라텍스 pgfplots로 만들 수 있도록 도와줄 수 있다면. 나는 pdfplots의 초보자입니다.

나는 플롯에 이 방정식을 사용했습니다.

(1/sqrt(2*pi))*exp(-(x-1).^2/2)

(1/(2*pi)).*(exp(-((X-1).^2/2)-((Y-1).^2/2)))

세 번째 그림은 누군가가 pgfplots에서 다시 생성할 수 있는 경우 인터넷에서 가져온 손으로 쓴 스케치입니다.

평균과 분산이 1인 두 개의 독립 정규 확률 변수의 결합 PDF평균과 분산이 1[![인터넷에서 가져온 대략적인 스케치를 갖는 두 독립 정규 확률 변수의 한계 pdf]]

답변1

이것은 당신에게 시작을 제공하기 위한 것입니다.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{3d}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[declare function={%
    f(\x,\y)=(1/(2*pi))*exp(-pow(\x-1,2)/2-pow(\y-1,2)/2);}]
 \begin{axis}[zmax=1/pi,zmin=-1/pi,colormap/viridis]
  \begin{scope}[canvas is xy plane at z=-1/pi]
   \draw[color of colormap=900] (1,1) circle[radius=0.5];
   \draw[color of colormap=700] (1,1) circle[radius=1];
   \draw[color of colormap=500] (1,1) circle[radius=1.5];
   \draw[color of colormap=300] (1,1) circle[radius=2];
   \draw[color of colormap=100] (1,1) circle[radius=2.5];
  \end{scope}
  \addplot3[color=red,thick,samples y=0,domain=-2:4] (x,4,{f(x,1)}); 
  \addplot3[color=blue,thick,samples y=0,domain=-2:4] (-2,x,{f(1,x)}); 
  \addplot3[mesh,domain=-2:4,domain y=-2:4] {f(x,y)}; 
  \addplot3[color=red,thick,samples y=0,domain=4:-2] (x,1,{f(x,1)})
   -- (-2,1,{f(1,1)}); ; 
  \addplot3[color=blue,thick,samples y=0,domain=-2:4] (1,x,{f(1,x)}) --
  (1,4,{f(1,1)}); 
 \end{axis}
\end{tikzpicture}
\end{document}

여기에 이미지 설명을 입력하세요

답변2

우선 코더 시작을 도와준 Schrondinger 고양이에게 정말 감사드립니다. pgfplot을 생성했습니다.

공동 PDF [![][1]]2

관련 정보