mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-25 06:18:05 +02:00
added hidden markov model
This commit is contained in:
parent
cc6cc383eb
commit
f6dd0c9104
4 changed files with 56 additions and 0 deletions
35
tikz/hidden-markov-model-abc/Makefile
Normal file
35
tikz/hidden-markov-model-abc/Makefile
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
SOURCE = hidden-markov-model-abc
|
||||||
|
DELAY = 80
|
||||||
|
DENSITY = 300
|
||||||
|
WIDTH = 512
|
||||||
|
|
||||||
|
make:
|
||||||
|
pdflatex $(SOURCE).tex -output-format=pdf
|
||||||
|
make clean
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
|
||||||
|
|
||||||
|
gif:
|
||||||
|
pdfcrop $(SOURCE).pdf
|
||||||
|
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
|
||||||
|
make clean
|
||||||
|
|
||||||
|
png:
|
||||||
|
make
|
||||||
|
make svg
|
||||||
|
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
|
||||||
|
|
||||||
|
transparentGif:
|
||||||
|
convert $(SOURCE).pdf -transparent white result.gif
|
||||||
|
make clean
|
||||||
|
|
||||||
|
svg:
|
||||||
|
make
|
||||||
|
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
||||||
|
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
||||||
|
# Necessary, as pdf2svg does not always create valid svgs:
|
||||||
|
inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg
|
||||||
|
rsvg-convert -a -w $(WIDTH) -f svg $(SOURCE).svg -o $(SOURCE)2.svg
|
||||||
|
inkscape $(SOURCE)2.svg --export-plain-svg=$(SOURCE).svg
|
||||||
|
rm $(SOURCE)2.svg
|
3
tikz/hidden-markov-model-abc/Readme.md
Normal file
3
tikz/hidden-markov-model-abc/Readme.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Compiled example
|
||||||
|
----------------
|
||||||
|

|
BIN
tikz/hidden-markov-model-abc/hidden-markov-model-abc.png
Normal file
BIN
tikz/hidden-markov-model-abc/hidden-markov-model-abc.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
18
tikz/hidden-markov-model-abc/hidden-markov-model-abc.tex
Normal file
18
tikz/hidden-markov-model-abc/hidden-markov-model-abc.tex
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
\documentclass[varwidth=true, border=2pt]{standalone}
|
||||||
|
\usepackage{units}
|
||||||
|
\usepackage{ifthen}
|
||||||
|
\usepackage{tikz}
|
||||||
|
\usetikzlibrary{calc}
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
\tikzstyle{vertex}=[draw,black,fill=blue,circle,minimum size=10pt,inner sep=0pt]
|
||||||
|
\tikzstyle{edge}=[very thick]
|
||||||
|
\begin{tikzpicture}[scale=2.5]
|
||||||
|
\node (a)[vertex,fill=gray!10,align=left] at (0,0) {$A~\nicefrac{1}{3}$\\$B~\nicefrac{1}{6}$\\$C~\nicefrac{1}{2}$};
|
||||||
|
\node (b)[vertex,fill=gray!10,align=left] at (1,0) {$A~\nicefrac{2}{5}$\\$B~\nicefrac{1}{5}$\\$C~\nicefrac{2}{5}$};
|
||||||
|
|
||||||
|
\path[thick,->] (a) edge node [anchor=center,above,sloped] {$\nicefrac{9}{10}$} (b);
|
||||||
|
\path[thick,->] (a) edge[loop above, looseness=5] node [anchor=center,above,sloped] {$\nicefrac{1}{10}$} (a);
|
||||||
|
\path[thick,->] (b) edge[loop above, looseness=5] node [anchor=center,above,sloped] {$1$} (b);
|
||||||
|
\end{tikzpicture}
|
||||||
|
\end{document}
|
Loading…
Add table
Add a link
Reference in a new issue