Nicht nur eine Matrix sondern viele Nicht nur eine Matrix, sondern viele
Matrizen
0,5 0, 2 0,3
0, 2 0, 7 0,1 0 15 0 75 0 1
A
0,15 0, 75 0,1
aber keine Matrize und auch keine Matratzen
aber keine Matrize und auch keine Matratzen
Not only one Matrix but many
Not only one Matrix, but many Matrices
0,5 0, 2 0,3
0, 2 0, 7 0,1 0 15 0 75 0 1
A
0,15 0, 75 0,1
but no matrize and also no mattress
Transition matrix for the weather in Bad Markstein States: sun, fog, rain
but no matrize and also no mattress
Wie beschreibt man Prozesse?
Wie beschreibt man Prozesse?
Makov-Modell Makov Modell Markov-
P
Prozess
Markov-Kette
Markov Kette
How to Describe Processes?
How to Describe Processes?
Makov-modell Makov modell Markov-process Markov chain
The following slides will explain the text above.
Wie beschreibt man Prozesse?
Wie beschreibt man Prozesse?
How to Describe Processes?
How to Describe Processes?
Here are the states and the transition probabilities which probabilities which
are referred to in the text.
Stratus-
Wolken
rain
Stratus
clouds
Cumulus- W lk
Wolken
Cumulus l d
clouds
from rain to rain
Darstellung mit Übergangs-Graph, auch Zustands-Graph genannt.
Die schwarzen Zahlen sind original vom g Wetteramt Hamburg.
Die blauen Zahlen sind ausgedacht, so etwa
sind sie bei der Math. Gesellschaft Hamburg g
im Nov. 2005 vorgestellt worden.
figure with transition graph
l d t t h
also named state graph.
The black numbers are official of weather office Hamburg.
The blue numbers are invented according to
the numbers given by the Mathematical Society g y y
Hamburg in Nov. 2005.
Wie beschreibt man Prozesse?
Wie beschreibt man Prozesse?
Darstellung mit Zustands-Graphen.
Bedingungen für einen g g
richtigen Zustandsgraphen:
• Alle möglichen Zustände Alle möglichen Zustände sind Knoten des Graphen.
• Die Übergangspfeile sind
• Die Übergangspfeile sind mit Wahrscheinlichkeiten beschriftet.
• Die von einem Knoten
abgehenden Pfeile haben
abgehenden Pfeile haben
Gesamtwahrscheinlichkeit 1.
How to Describe Processes?
How to Describe Processes?
figure with state graph
Conditions for an acceptable p state graph:
• All possible states are knots of All possible states are knots of the graph.
• The transition arrows are
• The transition arrows are marked with probabilities.
The arrows leaving a knot have
• The arrows leaving a knot have as the sum of their probabilties the total probability 1.
the total probability 1.
Wie beschreibt man Prozesse?
Wie beschreibt man Prozesse?
Darstellung mit Zustands-Graphen.
D t ll it i Üb t i
Darstellung mit einer Übergangsmatrix
R St C Re St Cu Re
St Cu
Zeilensummen müssen 1 sein
How to Describe Processes?
How to Describe Processes?
figure with state graph
figure with the transition matrix
R St C Re St Cu Re
St Cu
Sums of the rows must be 1.
Darstellung mit Zustands-Graphen.
D t ll it i Üb t i
Darstellung mit einer Übergangsmatrix
Zeilensummen müssen 1 sein
figure with state graph
figure with the transition matrix figure with the transition matrix
Sums of the rows must be 1.
Wie sagt man Entwicklungen vorher?
Wie sagt man Entwicklungen vorher?
Übergangsmatrix Heute ist Regen.
Mit welcher Wahrscheinlichkeit Mit welcher Wahrscheinlichkeit ist übermorgen auch Regen?
Baumdiagramm, Werkzeug der g , g Wahrscheinlichkeitsrechnung
Der Takt soll nun 1 Tag sein und nicht 6 h,
damit wir einfacher
reden können.
How to Forecast Developments?
How to Forecast Developments?
transition matrix Today we have rain.
Which is the probability for to have Which is the probability for to have rain the day after tomorrow?
tree diagram, an important tool g , p of stochastics.
Now the pulse shall be 1 p
day and not 6 h as in
the text above. That‘s
why it easier to talk
about it.
Wie sagt man Entwicklungen vorher?
Wie sagt man Entwicklungen vorher?
Der Takt soll nun 1 Tag sein und nicht 6 h, damit wir einfacher reden können
Übergangsmatrix Heute ist Regen.
Mit welcher Wahrscheinlichkeit
einfacher reden können.
Mit welcher Wahrscheinlichkeit ist übermorgen auch Regen?
Baumdiagramm, Werkzeug der g , g Wahrscheinlichkeitsrechnung
1. Pfadregel: längs des Pfades mal; 2. Pfadregel: mehrere Pfad-Wahrscheinl. plus
How to Forecast Developments?
How to Forecast Developments?
Now the pulse shall be 1 day and not 6 h as in the text above That‘s why we can speak easier
transition matrix
text above. That s why we can speak easier.
Today we have rain.
Which is the probability to have Which is the probability to have rain the day after tomorrow?
tree diagram, an important tool g , p of stochastics.
1. Pfadregel: längs des Pfades mal; 2. Pfadregel: mehrere Pfad-Wahrscheinl. plus
Wie rechnet man Vorhersagen aus?
Wie rechnet man Vorhersagen aus?
Die Übergangsmatrix muss man mit sich selbst multiplizieren.
How to Calculate the Forecasts?
How to Calculate the Forecasts?
The transition matrix has to be multiplied by itself.
Wie rechnet man Vorhersagen aus?
Wie rechnet man Vorhersagen aus?
Die Übergangsmatrix muss man mit sich selbst multiplizieren.
E t Z il d S lt ! M k
0,5 0,3 0, 2 0,5 0,3 0, 2 0, 2 0, 7 0,1 0, 2 0, 7 0,1 A A
Erst Zeile, dann Spalte! Merke:
Erst zielen dann schießen!
0, 2 0, 7 0,1 0, 2 0, 7 0,1 0,1 0,3 0, 6 0,1 0,3 0, 6 A A
0,33 0, 42 0, 25 0, 25 0,58 0,17 A A
, , ,
0,17 0, 42 0, 41
Übergangsmatrizen haben immer Zeilensumme 1. g g
Stochastische Matrizen haben immer Zeilensumme 1.
How to Calculate the Forecasts?
How to Calculate the Forecasts?
You must square the transition matrix.
First row than column
2
0,5 0, 3 0, 2 0,5 0, 3 0, 2 0, 2 0, 7 0,1 0, 2 0, 7 0,1 A A A
r c
0, 2 0, 7 0,1 0, 2 0, 7 0,1 0,1 0, 3 0, 6 0,1 0, 3 0, 6 A A A
0,33 0, 42 0, 25 0, 25 0,58 0,17 A A
, , ,
0,17 0, 42 0, 41
In transition matrices the rows have the sum 1.
In all stochastic matrices the rows have the sum 1.
Wie rechnet man Vorhersagen aus?
Wie rechnet man Vorhersagen aus?
Die Übergangsmatrix muss man mit sich selbst multiplizieren.
E t Z il d S lt ! M k
0,5 0,3 0, 2 0,5 0,3 0, 2 0, 2 0, 7 0,1 0, 2 0, 7 0,1 A A
Erst Zeile, dann Spalte! Merke:
Erst zielen dann schießen!
0, 2 0, 7 0,1 0, 2 0, 7 0,1 0,1 0,3 0, 6 0,1 0,3 0, 6 A A
0,33 0, 42 0, 25 0, 25 0,58 0,17 A A
, , ,
0,17 0, 42 0, 41
Übergangsmatrizen haben immer Zeilensumme 1. g g
Stochastische Matrizen haben immer Zeilensumme 1.
How to Calculate the Forecasts?
How to Calculate the Forecasts?
You must square the transition matrix.
First row than column
2
0,5 0, 3 0, 2 0,5 0, 3 0, 2 0, 2 0, 7 0,1 0, 2 0, 7 0,1 A A A
r c
0, 2 0, 7 0,1 0, 2 0, 7 0,1 0,1 0, 3 0, 6 0,1 0, 3 0, 6 A A A
0,33 0, 42 0, 25 0, 25 0,58 0,17 A A
, , ,
0,17 0, 42 0, 41
In transition matrices the rows have the sum 1.
In all stochastic matrices the rows have the sum 1.
Das Wetter in Bad Markstein
• Drei Zustände: Sonne, Nebel, Regen
• Wenn heute Sonne ist, dann ist mit 50%-
W h h i li hk it h S it
Wahrscheinlichkeit auch morgen Sonne, mit 20 % W. ist Nebel, mit 30 % W. ist Regen.
• Wenn heute Nebel ist, dann ist mit 20% W. , morgen Sonne, mit 70% W. wieder Nebel, mit 10% W. Regen,
• Wenn heute Regen ist dann ist mit 15% W
• Wenn heute Regen ist, dann ist mit 15% W.
morgen Sonne, mit 75% W. Nebel, mit 10% W. wieder Regen.
Übung:
Beschriften Sie den Zustandsgraphen.
Stellen Sie die Übergangsmatrix auf Stellen Sie die Übergangsmatrix auf.
Denken Sie sich eine „übermorgen-Frage“
aus und beantworten Sie sie.
aus und beantworten Sie sie.
The Weather in Bad Markstein
• Three states: sun, fog, rain
• If it is sun today, the the probabilty for sun
t i 50% f f t it i 20%
tomorrow is 50%, for fog tomorrow it is 20%, for rain it is 30%.
• If it is fog today, the the probabilty for sun g y, p y tomorrow is 20%, for fog tomorrow it is 70%, for rain it is 10%.
• If it is rain today the the probabilty for sun
• If it is rain today, the the probabilty for sun tomorrow is 15%, for fog tomorrow it is 75%, for rain it is 10%.
practice:
Label the state graph with the probabilties.
Configure the transition matrix Configure the transition matrix.
Invent a question for the day after tomorrow and calculate the result.
tomorrow and calculate the result.
Das Wetter in Bad Markstein
• Drei Zustände: Sonne, Nebel, Regen
• Wenn heute Sonne ist, dann ist mit 50%-
W h h i li hk it h S it
Wahrscheinlichkeit auch morgen Sonne, mit 20 % W. ist Nebel, mit 30 % W. ist Regen.
• Wenn heute Nebel ist, dann ist mit 20% W. , morgen Sonne, mit 70% W. wieder Nebel, mit 10% W. Regen,
• Wenn heute Regen ist dann ist mit 15% W
• Wenn heute Regen ist, dann ist mit 15% W.
morgen Sonne, mit 75% W. Nebel, mit 10% W. wieder Regen.
Übung:
Beschriften Sie den Zustandsgraphen.
Stellen Sie die Übergangsmatrix auf Stellen Sie die Übergangsmatrix auf.
Denken Sie sich eine „übermorgen-Frage“
aus und beantworten Sie sie.
aus und beantworten Sie sie.
The Weather in Bad Markstein
• Three states: sun, fog, rain
• If it is sun today, the the probabilty for sun
t i 50% f f t it i 20%
tomorrow is 50%, for fog tomorrow it is 20%, for rain it is 30%.
• If it is fog today, the the probabilty for sun g y, p y tomorrow is 20%, for fog tomorrow it is 70%, for rain it is 10%.
• If it is rain today the the probabilty for sun
• If it is rain today, the the probabilty for sun tomorrow is 15%, for fog tomorrow it is 75%, for rain it is 10%.
practice:
Label the state graph with the probabilties.
Configure the transition matrix Configure the transition matrix.
Invent a question for the day after tomorrow and calculate the result.
tomorrow and calculate the result.
Das Wetter in Bad Markstein Das Wetter in Bad Markstein
0 5 0 2 0 3
0,5 0, 2 0,3 0, 2 0, 7 0,1 0 15 0 75 0 1 A
0,15 0, 75 0,1
The Weather in Bad Markstein The Weather in Bad Markstein
0 5 0 2 0 3
0,5 0, 2 0,3 0, 2 0, 7 0,1 0 15 0 75 0 1 A
0,15 0, 75 0,1
probabilties for the day after tomorrow
A=transition matrix, sun,fog, rain
Das Wetter in Bad Markstein Das Wetter in Bad Markstein
• Sonne etwa 27,5% aller Tage N b l t 57 % ll T
• Nebel etwa 57 % aller Tage
• Regen etwa 15,5% aller Tage
The Weather in Bad Markstein The Weather in Bad Markstein
• Sonne etwa 27,5% aller Tage N b l t 57 % ll T
• Nebel etwa 57 % aller Tage
• Regen etwa 15,5% aller Tage
Das Wetter in Bad Markstein Das Wetter in Bad Markstein
0 5 0 2 0 3
0,5 0, 2 0,3 0, 2 0, 7 0,1 0 15 0 75 0 1 A
0,15 0, 75 0,1
The Weather in Bad Markstein The Weather in Bad Markstein
0 5 0 2 0 3
0,5 0, 2 0,3 0, 2 0, 7 0,1 0 15 0 75 0 1 A
0,15 0, 75 0,1
Das Wetter in Bad Markstein Das Wetter in Bad Markstein
Durch hohe Durch hohe Potenzen der
Übergangsmatrix g g erhält man
die stabile
Wetterverteilung in Bad Markstein.
• Sonne etwa 27,5% aller Tage
• Nebel etwa 57 % aller Tage
• Regen etwa 15,5% aller Tage
ist „Eigenvektor zum Eigenwert 1“
Regen etwa 15,5% aller Tage
The Weather in Bad Markstein The Weather in Bad Markstein
With high powers With high powers of the transition
matrix you calculate y the stable weather distribution in Bad Markstein.
• sun approximately in 27.5% of all days is „eigenvector
• fog approximately in 57% of all days
• rain approximately in 15.5% of all days
with
eigenvalue 1“
rain approximately in 15.5% of all days
Das Wetter in Hamburg Das Wetter in Hamburg
Durch hohe Potenzen der Durch hohe Potenzen der Übergangsmatrix erhält man eine Matrix mit lauter gleichen g
Zeilen. So eine Zeile ist der stabile Vektor dieser Markov-Kette, also die stabile Wetterverteilung in Hamburg.
Achtung: Nur die erste
• Regen: 25% aller Tage
g
Spalte in HH ist amtlich.
• Stratuswolken: 50% aller Tage
• Cumulus oder keine W : 25% aller Tage
• Cumulus oder keine W.: 25% aller Tage
The Weather in Hamburg The Weather in Hamburg
With high powers With high powers of the transition
matrix you get a matrix with identic y g rows. Such a row is the stable vector of the Markov chain, that is the
stable weather distribution Hamburg.
Attention: Only the first
• rain: 25% of all days
y column ist official.
• stratus clouds: 50% of all days
• cumulus or no clouds: 25% of all days
• cumulus or no clouds: 25% of all days
Das Wetter in Hamburg Das Wetter in Hamburg
• Regen: 25% aller Tage
• Stratuswolken: 50% aller Tage
• Cumulus oder keine W.:
25% aller Tage 25% aller Tage
45
The Weather in Hamburg The Weather in Hamburg
• rain: 25% of all days
• stratus clouds: 50% of all days
• cumulus or no clouds: 25% of all days
46
Zum Merken:
Ein stochastischer Prozess mit Zustandsübergängen heißt
Markov Kette (oder Markov Prozess) Markov-Kette (oder Markov-Prozess),
wenn die Übergangswahrscheinlichkeiten nicht von der
Vorgeschichte, sondern nur vom letzten Zustand abhängen.
Sind sie außerdem noch zeitlich konstant,
spricht man von einer homogenen Markov Kette spricht man von einer homogenen Markov-Kette.
Die Übergangsmatrizen A sind stochastische Matrizen .
(d h it Z il 1)
(d.h. mit Zeilensumme 1)
Eine Zustandsverteilung schreibt man als Zeilenvektor.
Mit ergibt sich die nächste Zustandsverteilung.
Eine stabile Zustandsverteilung erhält man durch hohe g
Potenzen von A oder als Eigenvektoren von A zum EW 1.
To Bear in Mind:
A stochastic process with transitions of states in named
markov chain (or markov process), ( )
with the condition that the probabilties for the transitions do not depend from the history of the states but only from the l t t t
last state.
If the probabilties are further constant in time the process is named homogenous markov chain
named homogenous markov chain.
The transition matrices A are stochastic matrices . (that is: the sum of the rows is 1)
A state distribution is decribed as a row vector.
With you calculate the next state distribution.
A stable state distribution can be calculated by high powers of A
A stable state distribution can be calculated by high powers of A
or as eigenvectors of A for the eigenvalue 1.
Warteschlangen
sind auch Markow Prozesse sind auch Markow-Prozesse
Abschnitt 10.8 meines Buches
Buches
Waiting Queues
are Markov prozesses too are Markov-prozesses too
That is chapter
10.8 of my book
Definition einer Matrix, rechnen mit Matrizen:
Eine m x n-Matrix ist ein rechteckiges Schema mit m Zeilen und n Spalten. p
11 12 13 14
a a a a
A a a a a
Kurz A a ij
21 22 23 24
a a a a
A a ij
Erst Zeile, dann Spalte! Merke:
Erst zielen dann schießen!
Definition of a Matrix, Calculating with Matrices:
A m x n-Matrix is a rectangular schema with m rows and n columns.
11 12 13 14
a a a a
A a a a a
short A a ij
21 22 23 24
a a a a
A a ij
The sum of the matrices A and B is defined by
To add two matrices of the same order you must add elementwise.
First row than column
r c
To multiply a matrix with a real scalar you must multipy each element with the scalar.