-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBookmakers-Ranking.Rmd
294 lines (218 loc) · 13 KB
/
Bookmakers-Ranking.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
---
title: "<img src='www/odds-comparison.jpg' width='240'>"
subtitle: "スポーツ.賭け屋(ブックメーカー)の評価レーダー妖怪図"
author: "[®γσ, Lian Hu](https://englianhu.github.io/) <img src='www/RYO.jpg' width='24'> <img src='www/RYU.jpg' width='24'> <img src='www/ENG.jpg' width='24'>®"
date: "`r lubridate::today('Asia/Tokyo')`"
output:
html_document:
number_sections: yes
toc: yes
toc_depth: 4
toc_float:
collapsed: yes
smooth_scroll: yes
---
```{r setup, message=FALSE, warning=FALSE}
suppressPackageStartupMessages(library('BBmisc'))
#'@ suppressPackageStartupMessages(library('rmsfuns'))
pkgs <- c('knitr', 'kableExtra', 'devtools', 'lubridate', 'data.table', 'qrmtools', 'tidyquant', 'plyr', 'stringr', 'magrittr', 'dplyr', 'tidyverse', 'tidyr', 'highcharter', 'formattable', 'DT', 'recharts', 'fmsb', 'radarchart', 'rvest', 'XML', 'RCurl')
suppressAll(lib(pkgs))
#'@ load_pkg(pkgs)
#'@ funs <- c('')
#'@ l_ply(funs, function(x) source(paste0('./function/', x)))
#'@ install_github('mwang27/recharts')
source('https://raw.githubusercontent.com/mwang27/recharts/master/R/echartR.R')
options(warn = -1)
rm(pkgs)
```
# 始めに
小さいから、三国志が大好きい。ある日は[说英雄谁是英雄之光荣三国](http://xccds1977.blogspot.com/2013/08/blog-post_26.html)のみて、今日は賭け屋(ブックメーカー)の評価レーダー妖怪図を描きます。
# データ
*Bookmakers ranking*^[[参考文献]に読みます。]から、賭け屋の情報を采集しました。あのうウェブはサッカ.リーグ.ランキングみたいです。
```{r, message=FALSE, warning=FALSE}
lnk <- 'http://www.bookmakersranking.com/bookmakers_ranking'
dfm <- lnk %>%
getURL %>%
htmlParse %>%
readHTMLTable %>%
.[[1]]
names(dfm) <- paste0(c('', 'Bookmaker', 'logo', 'Betting offer', 'Bookmakers margin', 'Alexa Popularity', 'User rating', 'rewards', 'Our Assassment', 'Change points according to the last settlement', 'Final assassment', 'reviews'), '_', as.character(unlist(head(dfm, 1))))
dfm %<>% .[-1, -c(1, 3, 12)] %>%
as_data_frame
dfm[,-c(1, 8:9)] %<>% mutate_if(is.factor, as.character) %>%
mutate_if(is.character, as.numeric)
dfm[,8:9] %<>% mutate(
`Change points according to the last settlement_1 month` =
str_replace_all(`Change points according to the last settlement_1 month`, ' pts.', ''),
`Final assassment_max 100` =
str_replace_all(`Final assassment_max 100`, ' pts.', '')) %>%
mutate_if(is.character, as.numeric)
names(dfm)[1] <- 'Bookmaker'
dfm %<>% mutate(Bookmaker = str_replace_all(Bookmaker, 'Bonus .{0,}', ''))
dfm %>% datatable(filter = 'top',
caption = htmltools::tags$caption(
style = 'caption-side: bottom; text-align: center;',
'Table 2.1: ', htmltools::em('Bookmakers rating.')),
extensions = list('Scroller', 'FixedColumns'), options = list(
deferRender = TRUE, scrollY = 200, scroller = TRUE,
dom = 't', scrollX = TRUE, fixedColumns = TRUE))
```
# データ可視化
## 賭け屋一覧
*Radar Chart Example*からの`recharts::echartR()`採用する。
```{r, message=FALSE, warning=FALSE}
dfm2 <- dfm %>% gather(cat, value, -Bookmaker)
dfm2 %<>% mutate_if(is.character, as.factor)
## need to convert to data.frame class, otherwise will be error.
dfm2 %>% data.frame %>%
recharts::echartR(x= ~cat, y= ~value, series= ~Bookmaker, type='radarfill',
symbolList='none', #palette=c('firebrick1','dodgerblue'),
title='Bookmaker Rating', subtitle= '(by @englianhu)')
```
## 評価一覧
*radarchart*からの`radarchart::chartJSRadar()`採用する。
```{r, message=FALSE, warning=FALSE}
chartJSRadar(dfm, main = 'Bookmakers Rating', maxScale = 10, showToolTipLabel=TRUE)
```
# 賭け屋
## サッカ.リーグ一覧
![](www/caspo.jpg)
かスポはうちの元賭け屋、[GVC Holdings PLC](https://gvc-plc.com/)にみたいで、色々な賭け屋ウェブサイトがあります。
- bwin-party
- sportingbet
- Ladbrokes-Coral
- Gamebookers
- Betboo
![](www/singbet.jpg)
上の絵の中に、あるウェブサイトは「皇冠(スメラギ.カンムリ)」やシングベットを呼ばれます。下の絵は外国人は色々有名なアジアン賭け屋に研究した。
- [SBOBet](https://www.sbobet.com/)
- [MaxBet](http://www.maxbet.com/) [(元名前はIBCBet)](http://www.betwing.com/)
- [SingBet1](http://hg8899.cm/)
- [SingBet2](http://hg8899.cm/)
- [AS3388](http://www.as3388.com/)(スタ.リザットのクライアントの中に一賭け屋です)
もっと情報は[量化分析与投资基金](https://englianhu.wordpress.com/2018/08/23/%E9%87%8F%E5%8C%96%E5%88%86%E6%9E%90%E4%B8%8E%E6%8A%95%E8%B5%84%E5%9F%BA%E9%87%91/)に読んでください。
![](www/Screenshot_20180731-230538.png)
何年前、色々な外国人の量化交易ファンドが1888Betに潰した。
```{r, message=FALSE, warning=FALSE}
scdt <- readRDS('data/report.rds')
```
残念です、サッカ.リーグの報告が僕カンボジアから帰ったん後消えた。
```{r, message=FALSE, warning=FALSE, eval=FALSE}
#-------- eval=FALSE --------
scdt[[1]] %>% tryCatch({
ddply(.(Month, League), summarise,
Turnover = sum(Turnover, na.rm = TRUE),
Ticket = sum(Ticket, na.rm = TRUE),
Comp_Turn = sum(Comp_Turn, na.rm = TRUE),
PL = sum(PL, na.rm = TRUE)) %>% tbl_df},
error = function(e) NULL)
scdt[[2]] %>% tryCatch({
ddply(.(Month, League), summarise,
Turnover = sum(Turnover, na.rm = TRUE),
Ticket = sum(Ticket, na.rm = TRUE),
Comp_Turn = sum(Comp_Turn, na.rm = TRUE),
PL = sum(PL, na.rm = TRUE)) %>% tbl_df},
error = function(e) NULL)
```
## 賭け産品一覧
9ヶ月の賭け産品リスト。これからの`PL`は。
```{r, message=FALSE, warning=FALSE}
scdt[[1]] %>% ddply(.(Bet_Type), summarise,
#scdt[[1]] %>% ddply(.(Month, Bet_Type), summarise,
Turnover = sum(Turnover, na.rm = TRUE),
Ticket = sum(Ticket, na.rm = TRUE),
Comp_Turn = sum(Comp_Turn, na.rm = TRUE),
PL = sum(PL, na.rm = TRUE)) %>% tbl_df %>%
kable(caption = 'SB1') %>%
kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive'))
scdt[[2]] %>% ddply(.(Bet_Type), summarise,
#scdt[[2]] %>% ddply(.(Month, Bet_Type), summarise,
Turnover = sum(Turnover, na.rm = TRUE),
Ticket = sum(Ticket, na.rm = TRUE),
Comp_Turn = sum(Comp_Turn, na.rm = TRUE),
PL = sum(PL, na.rm = TRUE)) %>% tbl_df %>%
kable(caption = 'SB2') %>%
kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive'))
```
カンボジアから帰ったん、ある日数学と量化交易の文献が探して参考したいんですが、全ての文献とデータが壊れた。以下は僕のもと会社のレポット(あのサッカ.リーグと月も、陰陽師が潰した。)。
```{r, echo=FALSE, message=FALSE, warning=FALSE}
scdt[[1]][,-c(1:3)] %>%
colSums(na.rm=TRUE) %>% t %>%
as_data_frame %>%
mutate(Rate = formattable::percent(PL/Comp_Turn)) %>%
kable(caption = 'SB1 9 months Report (from Sep 2006 to Jun 2007)') %>%
kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive'))
scdt[[2]][,-c(1:3)] %>%
colSums(na.rm=TRUE) %>% t %>%
as_data_frame %>%
mutate(Rate = formattable::percent(PL/Comp_Turn)) %>%
kable(caption = 'SB2 9 months Report (from Sep 2006 to Jun 2007)') %>%
kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive'))
```
# 量化交易のスポーツ.ヘッジファンド
あの英国やアメリカや色々な外国人、量化交易のスポーツ.ヘッジファンド[Betting Strategy and Model Validation](https://github.com/scibrokes/betting-strategy-and-model-validation)数学で賭ける、いつまでも利益を得る。
- [ATASS Sports](https://atass-sports.co.uk/)
- [Star Lizard](https://www.starlizard.com/)
- [Smart Odds](https://www.smartodds.co.uk/)
![](www/Screenshot_20180130-145534.png)
![](www/Screenshot_20180131-095908.png)
![](www/Screenshot_20180203-140550.png)
何年前から、僕は量化交易の研究[Rmodel](https://github.com/englianhu/Rmodel)が終わった、あの研究文献先日ある試合[Bookdown contest submission: Odds Modelling and Testing Inefficiency of Sports Bookmakers](https://community.rstudio.com/t/bookdown-contest-submission-odds-modelling-and-testing-inefficiency-of-sports-bookmakers/13889)を参加すた。
Rプログラミングを支える、毎日<img src='www/R_logo.png' width='20'>のTシャツを着て、もし量化交易も気に入るなら、[RProgramming.net Store](https://www.cafepress.com/rprogrammingnet)に連絡する。
![](www/R-tshirt.png)
# 終わりに
あの頃、僕はかスポで仕事してた、[®γσ, ENG LIAN HU](https://beta.rstudioconnect.com/content/3091/ryo-eng.html)に読みます。でも、全てのベット.スリプのデータがないし、統計学もわからないし。だから、OHLCのデータさえもないで、今統計学も使えるられないんです。高頻度取引の事が外国人の量化交易にまなんで、APIがいります。例え話、[4lowin](http://4lowin.com/)がAPIで賭け屋に接続します。
<iframe width="560" height="315" src="https://www.youtube.com/embed/E9_eAm2tTns" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
**Smart Odds**の賭け儲ける報告、もっと情報を知りたいなら、[Betting Strategy and Model Validation](https://github.com/scibrokes/betting-strategy-and-model-validation)に読んでください。
- 賭け屋:全てのデータが有ったら、統計学が使えなら、利益率が是非増える。
- 量化交易のスポーツ.ヘッジファンド:全てのデータが有ったら、統計学が使えなら、是非お金を儲ける。
もっと情報を知りたいなら、[Boffins -vs- Bookies (The Man Who Broke the World Leading Bookmakers)](https://englianhu.wordpress.com/sportsbook/boffins-vs-bookies-the-man-who-broke-the-world-leading-bookmakers/)と[富传奇色彩的博彩狙击公司EM2 (Expectation–Maximization)](https://englianhu.wordpress.com/sportsbook/%E5%AF%8C%E4%BC%A0%E5%A5%87%E8%89%B2%E5%BD%A9%E7%9A%84%E5%8D%9A%E5%BD%A9%E7%8B%99%E5%87%BB%E5%85%AC%E5%8F%B8em2-expectation-maximization/)に読んでください。
[Analyse the Finance and Stocks Price of Bookmakers](https://github.com/scibrokes/analyse-the-finance-and-stocks-price-of-bookmakers)で色々な賭け屋を分析します。
```{r option, echo = FALSE}
## Set options back to original options
options(warn = 0)
```
# 付録
## 文献情報
うちの文献情報、ご覧でください。
- 文献作成日: 2018-09-11
- 文献最終更新日: `r today('Asia/Tokyo')`
- `r R.version.string`
- R 版本 (省略): `r getRversion()`
- [**rmarkdown** 包み](https://github.com/rstudio/rmarkdown) version: `r packageVersion('rmarkdown')`
- 文献版本: 1.0.1
- 作者: [®γσ, Eng Lian Hu](https://beta.rstudioconnect.com/content/3091/ryo-eng.html)
- ギットハブ: [Source Code](https://github.com/scibrokes/analyse-the-finance-and-stocks-price-of-bookmakers)
- ほかの情報:
```{r info, echo=FALSE, warning=FALSE, results='asis'}
suppressMessages(require('dplyr', quietly = TRUE))
suppressMessages(require('formattable', quietly = TRUE))
suppressMessages(require('knitr', quietly = TRUE))
suppressMessages(require('kableExtra', quietly = TRUE))
sys1 <- devtools::session_info()$platform %>%
unlist %>% data.frame(Category = names(.), session_info = .)
rownames(sys1) <- NULL
sys1 %<>% rbind(., data.frame(
Category = 'Current time',
session_info = paste(as.character(lubridate::now('Asia/Tokyo')), 'JST'))) %>%
dplyr::filter(Category != 'os')
sys2 <- data.frame(Sys.info()) %>% mutate(Category = rownames(.)) %>% .[2:1]
names(sys2)[2] <- c('Sys.info')
rownames(sys2) <- NULL
cbind(sys1, sys2) %>%
kable(caption = 'Additional session information:') %>%
kable_styling(bootstrap_options = c('striped', 'hover', 'condensed', 'responsive'))
rm(sys1, sys2)
```
## 参考文献
01. [Radar Charts in R](https://plot.ly/r/radar-chart)
02. [Radar Chart Example](https://rpubs.com/omicsdata/radarchart)
03. [radarchart {fmsb}](http://minato.sip21c.org/msb/man/radarchart.html)
04. [<img src='www/hclogo.jpg' width='24'>Holdings Channel](https://www.holdingschannel.com/all/)
05. [The Optimal Size of Hedge Funds](https://corpgov.law.harvard.edu/2016/06/14/the-optimal-size-of-hedge-funds/)
06. [World's Top 10 Hedge Fund Firms](https://www.investopedia.com/articles/personal-finance/011515/worlds-top-10-hedge-fund-firms.asp)
07. [Institutional Investor](https://www.institutionalinvestor.com/)
08. [radarchart](https://rdrr.io/cran/radarchart/f/README.md)
09. [Bookmakers ranking](http://www.bookmakersranking.com/bookmakers_ranking)
---
**<img src='www/oda-army2.jpg' width='24'> [Scibrokes®](http://www.scibrokes.com)個人経営企業の知的財産権**