Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass[tikz,convert={outfile=\weibull_PMF.svg}]{standalone}
- \usepackage{tikz}
- \usepackage{pgfplots}
- \pgfplotsset{compat=1.7}
- \begin{document}
- \begin{tikzpicture}
- [
- declare function={weibullpmf(\x,\a,\b) = \a^(\x^\b)-\a^((\x+1)^\b);}
- ]
- \begin{axis}[
- axis lines=left,
- enlargelimits=upper,
- smooth,
- line width=1pt,
- samples at={-0.000000000000001,0.01,...,4},
- legend entries=
- {
- $q=0.5 \quad\, \beta = 0.75$,
- $q=0.5 \quad\, \beta = 1 $,
- $q=0.5 \quad\, \beta = 2 $,
- $q=0.75\quad \beta = 2 $
- },
- legend cell align=left,
- ylabel={$\Pr\left(\mathbf{X}=x\right)$},
- xlabel={$x$}
- ]
- \definecolor{color1}{RGB}{215,25,28 };
- \definecolor{color2}{RGB}{253,174,97 };
- \definecolor{color3}{RGB}{171,221,164};
- \definecolor{color4}{RGB}{43,131,186 };
- \addplot[draw=color1,dashed,forget plot]{weibullpmf(x, 0.5 , 0.75 )};
- \addplot[draw=color1,
- fill=color1,
- only marks,
- samples at = {0,1,...,4},
- samples = 5,mark=*] {weibullpmf(x, 0.5 , 0.75 )};
- \addplot[draw=color2,dashed,forget plot]{weibullpmf(x, 0.5 , 1 )};
- \addplot[draw=color2,
- fill=color2,
- only marks,
- samples at = {0,1,...,4},
- samples = 5,mark=*] {weibullpmf(x, 0.5 , 1 )};
- \addplot[draw=color3,dashed,forget plot]{weibullpmf(x, 0.5 , 2 )};
- \addplot[draw=color3,
- fill=color3,
- only marks,
- samples at = {0,1,...,4},
- samples = 5,mark=*] {weibullpmf(x, 0.5 , 2 )};
- \addplot[draw=color4,dashed,forget plot]{weibullpmf(x, 0.75, 2 )};
- \addplot[draw=color4,
- fill=color4,
- only marks,
- samples at = {0,1,...,4},
- samples = 5,mark=*] {weibullpmf(x, 0.75, 2 )};
- \end{axis}
- \end{tikzpicture}
- \begin{tikzpicture}
- [
- declare function={weibullcmf(\x,\a,\b) = 1-\a^((\x+1)^\b);}
- ]
- \begin{axis}[
- axis lines=left,
- enlargelimits=upper,
- smooth,
- line width=1pt,
- samples at={-0.000000000000001,0.01,...,4},
- legend entries=
- {
- $q=0.5 \quad\, \beta = 0.75$,
- $q=0.5 \quad\, \beta = 1 $,
- $q=0.5 \quad\, \beta = 2 $,
- $q=0.75\quad \beta = 2 $
- },
- legend cell align=left,
- legend style={at={(0.98,0.02)},anchor=south east},
- ylabel={$\Pr\left(\mathbf{X}\leq x\right)$},
- xlabel={$x$}
- ]
- \definecolor{color1}{RGB}{215,25,28 };
- \definecolor{color2}{RGB}{253,174,97 };
- \definecolor{color3}{RGB}{171,221,164};
- \definecolor{color4}{RGB}{43,131,186 };
- \addplot[draw=color1,dashed,forget plot]{weibullcmf(x, 0.5 , 0.75 )};
- \addplot[draw=color1,
- fill=color1,
- only marks,
- samples at = {0,1,...,4},
- samples = 5,mark=*] {weibullcmf(x, 0.5 , 0.75 )};
- \addplot[draw=color2,dashed,forget plot]{weibullcmf(x, 0.5 , 1 )};
- \addplot[draw=color2,
- fill=color2,
- only marks,
- samples at = {0,1,...,4},
- samples = 5,mark=*] {weibullcmf(x, 0.5 , 1 )};
- \addplot[draw=color3,dashed,forget plot]{weibullcmf(x, 0.5 , 2 )};
- \addplot[draw=color3,
- fill=color3,
- only marks,
- samples at = {0,1,...,4},
- samples = 5,mark=*] {weibullcmf(x, 0.5 , 2 )};
- \addplot[draw=color4,dashed,forget plot]{weibullcmf(x, 0.75, 2 )};
- \addplot[draw=color4,
- fill=color4,
- only marks,
- samples at = {0,1,...,4},
- samples = 5,mark=*] {weibullcmf(x, 0.75, 2 )};
- \end{axis}
- \end{tikzpicture}
- \end{document}
- % ragulpr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement