0
我使用馬爾可夫鏈在Python中製作天氣預報程序。這些程序要求用戶輸入過去幾天的天氣並預測未來七天。Python馬爾可夫鏈,轉換矩陣的用戶輸入字符串
我想知道如何改變我的轉換矩陣,所以它使用了指定對發生的頻率的百分比,即'DD''DR''RR''RD'而不是默認概率,如下所示。
#Possible sequences of events
transitionName = [["DD","DR"],["RR","RD"]]
pastweather = input("Enter a string of D's and R's to represent dry/rainy days: ")
#transition matrix
transitionMatrix = [[0.8,0.2],[0.4,0.6]]