Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

## Probability Definitions Below you will find: - `P_init`: The initial probabilities of the weather state, whether sunny (0), rainy (1) or foggy (2) -

## Probability Definitions Below you will find: - `P_init`: The initial probabilities of the weather state, whether sunny (0), rainy (1) or foggy (2) - `P_transition`: The transition probabilities or the probability that one weather state one day transitions to another weather state - `P_emission`: The 'emission' probabilities or the probabilities that an observation is made, conditioned on the underlying state.

====================================================================

### DO NOT CHANGE ###

import numpy as np

# prior probability on weather states # P(sunny) = 0.5 P(rainy) = 0.25 P(foggy) = 0.25

P_init = np.array([0.5, 0.25, 0.25])

# states (0=sunny, 1=rainy, 2=foggy)

S = [0, 1, 2]

# transition probabilities # tomorrrow # today sunny rainy foggy # sunny 0.8 0.05 0.15 # rainy 0.2 0.6 0.2 # foggy 0.2 0.3 0.5

P_transition = np.array([ [0.8, 0.05, 0.15], [0.2, 0.6, 0.2], [0.2, 0.3, 0.5] ])

# conditional probabilities of evidence (observations) given weather # sunny rainy foggy # P(weather | umbrella=no) 0.9 0.2 0.7 # P(weather | umbrella=yes) 0.1 0.8 0.3

P_emission = np.array([ [0.9, 0.2, 0.7], [0.1, 0.8, 0.3] ])

====================================================================

### [Question - State Transitions] If today is sunny what is the most likely forecast for the next two days if you have no umbrella observations to work with?

### [Question - Emission probabilities ] If on the first day you see no umbrella, what is the probability that it is rainy, foggy or sunny (Hint: remember the importance of overall probability of each state)? What is the most likely weather (hidden state)?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is cultural tourism and why is it growing?

Answered: 1 week ago