You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 line
1.0KB

  1. \documentclass{standalone}
  2. \usepackage{pgfplots, tikz}
  3. \pgfmathdeclarefunction{poiss}{1}{%
  4. \pgfmathparse{(#1^x)*exp(-#1)/(x!)}%
  5. }
  6. \begin{document}
  7. \begin{tikzpicture}
  8. \begin{axis}[
  9. declare function={
  10. C=4;
  11. risk(\t,\a) = exp(\a*\t)-0.5;
  12. cost(\t,\a) = \a*\t^2;
  13. },
  14. axis x line=center,
  15. axis y line=center,
  16. xtick={0,2,...,19},
  17. ytick={0.1,0.2,...,0.6},
  18. domain = 0:18,
  19. samples = 19,
  20. xlabel={$t$},
  21. ylabel={$ $},
  22. xlabel style={right},
  23. ylabel style={above left},
  24. ymax=0.5,
  25. xmax=20,
  26. x post scale=1.4
  27. ]
  28. \addplot+[smooth,blue] {risk(x,-0.03)};
  29. \addlegendentry{$\lambda = 1$}
  30. \addplot+[smooth,orange] {cost(x,0.001)};
  31. \addlegendentry{$\lambda = 1$}
  32. \end{axis}
  33. \end{tikzpicture}
  34. \end{document}