0% found this document useful (0 votes)
20 views21 pages

Chapter15 2

This document discusses probabilistic smoothing and the Viterbi algorithm. It explains how to compute smoothed probabilities over past states using forward and backward probabilities. The Viterbi algorithm finds the most likely state sequence to explain a sequence of observations using dynamic programming. It computes the probability of the best state sequence ending at each time step rather than considering all state sequences.

Uploaded by

Reyazul Hasan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views21 pages

Chapter15 2

This document discusses probabilistic smoothing and the Viterbi algorithm. It explains how to compute smoothed probabilities over past states using forward and backward probabilities. The Viterbi algorithm finds the most likely state sequence to explain a sequence of observations using dynamic programming. It computes the probability of the best state sequence ending at each time step rather than considering all state sequences.

Uploaded by

Reyazul Hasan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Chapter 15 (AIAMA)

Probabilistic Reasoning
Over Time-02
Sukarna Barua
Assistant Professor, CSE, BUET
Smoothing
 Compute the probability distribution over past states.

 Compute where
Smoothing
 Compute where

 Remember bayes expansion:


 Here,
 is a fixed term [can be obtained later as probabilities sum to 1]
Smoothing
 Compute where

 Hence,
 Where denotes forward probabilities [filtering problem]
 Note that is a vector [ ]
Smoothing
 Now, how to compute

 and comes from the models [transition and sensor]


 can be obtained recursively or iteratively [using dynamic programming]
Smoothing
 Recurrence relation for

 Let [ is a vector/array of probabilities ]

 From our previous derivation:

)
[assume an specific output value at time step ]
Smoothing
 Recurrence relation for

- )

 What is the base condition?


- To find the base condition, put [for the last/current state]

- for all [Why? ]

- Probability of occurring an empty sequence is 1


Smoothing
 Recurrence relation for

 is known as backward probabilities

- The algorithm for computing starts from the -th state [and go backward up to [Fill
DP tables for
- The algorithm is known as backward algorithm [in contrast to forward algorithm]
Smoothing
 Finally

 In vector form:

[point-wise multiplication]

 Again is normalizing constant.


Smoothing: Example
 Compute [Probability of rain at time given umbrella observations at time and
 As per our previous formula:
 First term: [We already know from filtering example]
 Second term: needs recursive expansion [previous slide]
Smoothing: Example
 Second term needs recursive expansion [previous slides]

 Finally, compute:
Smoothing: Example
 Smoothed estimate:

 Filtered estimate:
Smoothing: Example
 Smoothed estimate:

 Filtered estimate:

 Observation: Smoothed estimate for rain on day 1 is higher than the filtered
estimate (0.818) [Why?]

- This is because the umbrella on day 2 makes it more likely to have rained
on day 2 which in turn, because rain tends to persist, that makes it more
likely to have rained on day 1.
Smoothing: Algorithm Pseudocode
 Forward and backward algorithm can be combined to compute posterior
probabilities in linear time
Most Likely Explanation
 Suppose that [true, true, false, true, true] is the umbrella sequence for the
security guard’s first five days on the job.

 What is the weather (state) sequence most likely to explain this?

 There are possible weather sequences. Is there a way to find the most likely
one?
Most Likely Explanation: Naïve
Approach
 Compute the probability distribution .
- [Bayes theorem]

- Assume for notational convenience


- ) is the probability distribution of states at time step

 After computing the probability distribution )


 We know the probability of each state sequence
 We select the most probably state sequence as
Most Likely Explanation: Naïve
Approach
 We select the most probably state sequence as:

 What is the problem with the naïve approach?


- Number of state sequence is exponential
- If number of states is , then number of state sequences is
- Computing ) for states requires exponential running time
- Not feasible in real time
- What can we do?
- A better approach can be derived using dynamic programming
Most Likely Explanation
 Note that ) = ) [Why?]
 Consider the probability:
- is the probability of the most likely state sequence that produce observation
sequences and ends at a specific state at time step

- We will show that instead of maximizing over all sequence of previous states, it is
enough to maximize over only previous state [we will derive a recurrence
relation over the previous state]
Most Likely Explanation
 Recurrence relation for computing : we can compute as follows:
- For all possible states at time step
- Compute the probability of most likely state sequence that produce observation
sequence and ends at (this probability is
- Move from state to [with transition probability ]
- Produce observation at state [with emission probability assuming ]

- As we don’t know the previous state leading to the most likely sequence, we just take the

maximum over all possible previous states :


=
Most Likely Explanation
 Derivation of recurrence relation for :
=

)
Most Likely Explanation
 Finally obtain the best possible state sequence:
 is the most likely state sequence ending at at time step
 We don’t know what is the end state for the most likely state sequence, hence we just
take the maximum over all

 This algorithm is known as Viterbi algorithm


 Can be implemented using recursion or dynamic programming approach

You might also like