Im trying to draw a binomial tree with latex and the tikz package, I found an example and have tried to modify it to my needs, but haven't been successful. I have 2 problems;
- 1. I want the tree to be recombining, such that the arrow going up from B, and down from C, ends up in the same node, namely E.
2. I also want the arrows in the tree to have the same slope/angel.
Code: Select all
% Set the overall layout of the tree\tikzstyle{level 1}=[level distance=4cm, sibling distance=3.5cm,->]\tikzstyle{level 2}=[level distance=4cm, sibling distance=2cm,->]% Define styles for bags and leafs\tikzstyle{bag} = [text width=2em, text centered]\tikzstyle{end} = []% The sloped option gives rotated edge labels. Personally% I find sloped labels a bit difficult to read. Remove the sloped options% to get horizontal labels.\begin{tikzpicture}[grow=right, sloped]\node[bag] {$\$ A$}child {node[bag] {B}child {node[end, label=right:{D}] {}edge from parentnode[above] {}node[below] {$(1-p)^2$}}child {node[end, label=right:{E}] {}edge from parentnode[above] {}node[below] {$(1-p)p$}}edge from parentnode[above] {}node[below] {$(1-p)$}}child {node[bag] {C}child {node[end, label=right:{E}] {}edge from parentnode[above] {$(1-p)p$}node[below] {}