Advertisement
nm9505

Distribución Exponencial

Jan 31st, 2025
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 5.19 KB | Science | 0 0
  1. \documentclass{article}[14pt,a4paper]
  2. % Comment the following line to NOT allow the usage of umlauts
  3. \usepackage[utf8]{inputenc}
  4. %\usepackage[english]{babel}
  5. \usepackage[legalpaper, lmargin=1.8cm, rmargin=1.8cm, bottom=1.8cm]{geometry}
  6. \usepackage{color}
  7. % Uncomment the following line to allow the usage of graphics (.png, .jpg)
  8. \usepackage{verbatim}
  9. \usepackage{graphicx}
  10. \usepackage{amsmath}
  11. \usepackage[all]{xy}
  12. \usepackage{pst-all}
  13. \usepackage{tikz}
  14. \usepackage{lscape}
  15. \usepackage{tikzpeople}
  16. \usepackage{fancybox}
  17. \usepackage{cancel}
  18. %\usepackage{gnuplottex}
  19. %\usepackage{chronology}
  20. \usepackage{pst-pdf}
  21. %\usepackage{pstricks}
  22.  
  23. \usepackage{pst-solides3d}
  24. \pagestyle{empty}
  25. \usetikzlibrary{datavisualization.formats.functions} \usetikzlibrary{matrix.skeleton} \usetikzlibrary[shapes,arrows,positioning,fit,backgrounds,intersections,shadows,calc] \usetikzlibrary{positioning} \usetikzlibrary{decorations.text} \usetikzlibrary{decorations.pathmorphing}
  26. \usepackage{pgfplots} \pgfplotsset{width=10cm,compat=1.9}  \tikzset{flippedeventlabel/.append style={align=center}}
  27. \usetikzlibrary{matrix.skeleton}
  28. \usetikzlibrary[patterns,shapes,arrows,positioning,fit,backgrounds,intersections,shadows,calc]
  29. \usetikzlibrary[datavisualization]
  30. \usepackage{pgfplots}
  31. \pgfplotsset{width=10cm,compat=1.9}
  32. % Start the document
  33.  
  34. \begin{document}
  35. %\pagecolor{black}
  36.  
  37. \tikz \datavisualization
  38. [scientific axes=clean,
  39. x axis={length=2.5cm, ticks={major at={
  40. 5,
  41. 6 as [style=red],
  42. 7 as [{style=blue, low=-1em}],
  43. 8 as [style=orange] $2^3$,
  44. 10 as [style=magenta]ten
  45. }}},
  46. visualize as line]
  47. data [format=function] {
  48. var x : interval [5:10];
  49. func y = \value x * \value x;
  50. };\\
  51.  
  52. \tikz \datavisualization
  53. [scientific axes,
  54. all axes={
  55. length=3cm,
  56. grid,
  57. grid={minor steps between steps}
  58. }, every major grid/.style = {style={blue, thin}},
  59. visualize as line]
  60. data [format=function] {
  61. var x : interval [5:10];
  62. func y = \value x * \value x;
  63. };\\
  64. %Definiendo Paquete de Funciones
  65. \tikz \datavisualization data group {function classes} = {
  66. data [set=log, format=function] {
  67. var x : interval [0.2:2.5];
  68. func y = ln(\value x);
  69. }
  70. data [set=lin, format=function] {
  71. var x : interval [-2:2.5];
  72. func y = \value x;
  73. }
  74. data [set=squared, format=function] {
  75. var x : interval [-1.5:1.5];
  76. func y = \value x*\value x;
  77. }
  78. data [set=exp, format=function] {
  79. var x : interval [-2.5:1];
  80. func y = exp(\value x);
  81. }
  82. data [set=cub, format=function] {
  83. var x : interval [-1.5:1.5];
  84. func y = \value x*\value x*\value x);
  85. }
  86. };
  87. \tikz \datavisualization data group {Dist Exponencial} = {
  88. data [set=Exp1, format=function] {
  89. var x : interval [0:5];
  90. func y = 0.5* exp(-0.5*\value x);
  91. }
  92. data [set=Exp2, format=function] {
  93. var x : interval [0:5];
  94. func y =exp(-\value x);
  95. }
  96. data [set=Exp3, format=function] {
  97. var x : interval [0:5];
  98. func y =1.5*exp(-1.5*\value x);
  99. }
  100. data [set=linev1, format=function] {
  101. var y : interval [0:0.18394];
  102. func x = 2;
  103. }
  104. data [set=linev2, format=function] {
  105. var y : interval [0:0.36788];
  106. func x = 1;
  107. }
  108. data [set=linev3, format=function] {
  109. var y : interval [0:0.55182];
  110. func x = 0.66666;
  111. }
  112. };
  113. \tikz \datavisualization data group {Acum Exponencial} = {
  114. data [set=AExp1, format=function] {
  115. var x : interval [0:5];
  116. func y = 1- exp(-0.5*\value x);
  117. }
  118. data [set=AExp2, format=function] {
  119. var x : interval [0:5];
  120. func y =1-exp(-\value x);
  121. }
  122. data [set=AExp3, format=function] {
  123. var x : interval [0:5];
  124. func y =1-exp(-1.5*\value x);
  125. }
  126. };
  127. \begin{center}
  128. \tikz \datavisualization [scientific axes,
  129. visualize as smooth line/.list=
  130. {log, lin, squared, exp,cub},
  131. legend=south outside,
  132. log= {label in legend={text=$\log x$}},
  133. lin= {label in legend={text=$x/2$}},
  134. squared={label in legend={text=$x^2$}},
  135. exp= {label in legend={text=$e^x$}},
  136. cub= {label in legend={text=$x^3$}},
  137. style sheet=strong colors]
  138. data group {function classes};\\
  139. \vspace{0.5cm}
  140. \begin{tikzpicture}
  141. \draw node[blue]at (15,15) {Distribución Exponencial: $\mathsf{f(x) = \lambda e^{-\lambda x}}$,  \textcolor{red}{$\mathsf{x > 0}$}};
  142.  
  143. \end{tikzpicture}\\
  144.  
  145. \tikz \datavisualization
  146. [scientific axes=clean,x axis={ticks={major at={
  147. 0 as [style=orange], 0.666 as [{style=blue, low=-1em}]$\frac{2}{3}$, 1 as [{style=red, low=-1em}], 2 as [{style=black, low=-1em}],
  148. 3 as [style=orange], 4 as [style=orange], 5 as [style=orange],}}},
  149. visualize as smooth line/.list=
  150. {Exp1, Exp2, Exp3, linev1, linev2, linev3},
  151. legend = {south outside, label style = text colored,},
  152. Exp1= {label in legend={text=$\lambda\to 0.5 $}},
  153. Exp2= {label in legend={text=$\lambda \to 1$}},
  154. Exp3={label in legend={text=$\lambda \to 1.5$}},
  155. style sheet = strong colors]
  156. data group {Dist Exponencial};\\
  157.  
  158. \begin{tikzpicture}
  159.  
  160. \draw node[blue]at (15,15) {Acumulada: $\mathsf{F(x) = 1\ -\  e^{-\lambda x}}$,  \textcolor{red}{$\mathsf{x > 0}$}};
  161. \end{tikzpicture}\\
  162.  
  163. \tikz \datavisualization
  164.  
  165. [scientific axes,
  166. visualize as smooth line/.list=
  167. {AExp1, AExp2, AExp3},
  168. legend = {south outside, label style = text colored,},
  169. AExp1= {label in legend={text=$\lambda\to 0.5 $}},
  170. AExp2= {label in legend={text=$\lambda \to 1$}},
  171. AExp3={label in legend={text=$\lambda \to 1.5$}}, style sheet = strong colors]
  172. data group {Acum Exponencial};
  173. \end{center}
  174. \end{document}
  175.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement