forked from Tushavin/Optimize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
game2.Rmd
121 lines (80 loc) · 4.65 KB
/
game2.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
title: "Игры с природой"
author: "Тушавин В. А."
date: "3 декабря 2015 г."
output:
html_document:
keep_md: yes
word_document: default
---
В игре с природой участвуют два игрока: один из них, обозначим его через *А*, - лицо, принимающее решение; другой, обозначим его через *П*, - природа. Игрок *А* действует осознанно, стремясь принять наиболее выгодное для себя решение, а природа *П*, в отличие от него , принимает то или иное свое состояние неопределенным образом, не противодействуя злонамеренно игроку А, не преследуя конкретной цели и абсолютно безразлично к результату игры, т.е. природа П, являясь игроком в игре, не является ни противником, ни союзником игрока А.
Пустьигрок *А* обладает m возможнымистратегиями *А~1~,…,А~m~*, а природа *П* может находиться в одном из *n* своих состояний *П~1~,…,П~n~*. Предполагается обычно, что игрок *А* в состоянии оценить результаты выбора им каждой из своих стратегий *А~i~*, *i=1,…,m*, при каждом состоянии природы *П~j~*, *j=1,…,n*, количественно выражающиеся действительными числами *а~ij~*.
Эти числа, называемые выигрышами игрока А, можно записать в виде матрицы:
```{r echo=FALSE,results='asis'}
library(knitr)
mtx<-matrix(c(2,1,2,
3,5,6,
1,4,2,
4,3,1.5),ncol=4)
rownames(mtx)<-paste0("A~",1:nrow(mtx),"~")
colnames(mtx)<-paste0("П~",1:ncol(mtx),"~")
kable(mtx)
```
### Чистые стратегии
#### Критерий Байеса
Имеется вектор весов W, описывающий состояния природы.
```{r}
(w<-c(0.5,0.1,0.2,0.2))
sum(w)
```
Тогда произведение B=A*W дает
```{r}
B<-mtx %*% w
colnames(B)<-"П~B~"
kable(B)
```
Оптимальная стратегия есть максимум
```{r}
max(B)
```
Таким образом, выигрывает стратегия A~2~.
#### Критерий Байеса-Лапласа
О состоянии природы ничего не известно, вероятности предполагаем равными.
```{r}
(w<-c(0.25,0.25,0.25,0.25))
BL<-mtx %*% w
colnames(BL)<-"П~B~"
kable(BL)
```
Оптимальная стратегия есть максимум
```{r}
max(BL)
```
Таким образом, выигрывает стратегия A~2~.
#### Критерий Вальда
Оптимальной среди чистых стратегий покритерию Вальда считается та чистая стратегия, прикоторой минимальный выигрыш является максимальным среди минимальных выигрышей всех чистых стратегий. Таким образом, оптимальная стратегия по критерию Вальда гарантирует при любых состояниях природы выигрыш, не меньший максимина.
```{r}
W<-as.matrix(apply(mtx,1,min))
colnames(W)<-"П~W~"
kable(W)
max(W)
```
Таким образом, по критерию Вальда лучшей является третья стратегия.
#### Критерий Ходжа-Лемана
Имеется матрица, состоящая из оценки стратегий по критериям Байеса и Вальда
```{r}
kable(HL<-cbind(B,W))
```
И имеется коэффициент *l*,описывающий степень доверия к состоянию природы. Обратный коэффициент, равен 1-*l* описывает степень пессимизма.
```{r}
(w<-c(0.75,0.25))
kable(HLM<-HL %*% w,col.names = "КХЛ")
```
Оптимальной стратегией по критерию Ходжа-Лемана является стратегия А~3~ с наибольшим показателем эффективности:
```{r}
max(HLM)
```
#### Информация о параметрах R
```{r}
sessionInfo()
```