-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.xml
251 lines (242 loc) · 23.5 KB
/
index.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
version="2.0">
<channel>
<title><</title>
<link>https://assuncaolfi.github.io/site/</link>
<atom:link href="https://assuncaolfi.github.io/site/index.xml" rel="self" type="application/rss+xml"/>
<description></description>
<generator>quarto-1.6.32</generator>
<lastBuildDate>Mon, 17 Jun 2024 00:00:00 GMT</lastBuildDate>
<item>
<title>savvi</title>
<link>https://assuncaolfi.github.io/site/</link>
<description>{{< bi github >}} Python package for Safe Anytime Valid Inference</description>
<guid>https://assuncaolfi.github.io/site/</guid>
<pubDate>Mon, 17 Jun 2024 00:00:00 GMT</pubDate>
</item>
<item>
<title>Picking a fantasy football team</title>
<link>https://assuncaolfi.github.io/site/blog/fantasy-football/</link>
<description><![CDATA[
<p><em>This post is a work in progress.</em></p>
<p><a href="https://cartola.globo.com">Cartola</a> is a fantasy football league following the Brazilian Série A, where players assume the role of team managers. For the past couple of seasons, I’ve been collecting <a href="https://github.com/assuncaolfi/tophat/tree/main">historical data</a> to attempt to answer the question: what’s the optimal run in a given season?</p>
<section id="the-problem" class="level2 page-columns page-full">
<h2 class="anchored" data-anchor-id="the-problem">The problem</h2>
<p>Before each round <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20t%20%3D%201%2C%20%5Cdots%2C%2038" alt="t = 1, \dots, 38" title="t = 1, \dots, 38" class="math inline">, managers are presented with <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20N_t" alt="N_t" title="N_t" class="math inline"> candidate players. Candidates have costs <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmathbf%7Bc%7D_%7Bt%7D%20%5Cin%20%5Cmathbb%7BR%7D_%2B%5E%7BN_t%7D" alt="\mathbf{c}_{t} \in \mathbb{R}_+^{N_t}" title="\mathbf{c}_{t} \in \mathbb{R}_+^{N_t}" class="math inline"> and positions <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmathbf%7Bp%7D_%7Bt%7D%20%5Cin%20%5C%7B1%2C%20%5Cdots%2C%206%5C%7D%5E%7BN_t%7D" alt="\mathbf{p}_{t} \in \{1, \dots, 6\}^{N_t}" title="\mathbf{p}_{t} \in \{1, \dots, 6\}^{N_t}" class="math inline">. For convenience, positions can be encoded as dummies <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20P_t%20%5Cin%20%5C%7B0%2C%201%5C%7D%5E%7BN_t%20%5Ctimes%206%7D" alt="P_t \in \{0, 1\}^{N_t \times 6}" title="P_t \in \{0, 1\}^{N_t \times 6}" class="math inline">. There are <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20i%20%3D%201%2C%20%5Cdots%2C%207" alt="i = 1, \dots, 7" title="i = 1, \dots, 7" class="math inline"> valid formations <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20F%20%5Cin%20%5Cmathbb%7BN%7D%5E%7B7%20%5Ctimes%206%7D" alt="F \in \mathbb{N}^{7 \times 6}" title="F \in \mathbb{N}^{7 \times 6}" class="math inline">, where <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20F_%7Bij%7D" alt="F_{ij}" title="F_{ij}" class="math inline"> indicates exactly how many players of position <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20j" alt="j" title="j" class="math inline"> are allowed in formation <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20i" alt="i" title="i" class="math inline">. All formations include <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%2011" alt="11" title="11" class="math inline"> players and <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%201" alt="1" title="1" class="math inline"> coach, or <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Csum_%7Bj%3D1%7D%5E6%20F_%7Bij%7D%20%3D%2012" alt="\sum_{j=1}^6 F_{ij} = 12" title="\sum_{j=1}^6 F_{ij} = 12" class="math inline"> for all <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20i" alt="i" title="i" class="math inline">. The manager begins each round with a budget <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20b_t%20%5Cin%20%5Cmathbb%7BR%7D_%2B" alt="b_t \in \mathbb{R}_+" title="b_t \in \mathbb{R}_+" class="math inline"> and they must pick a team <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmathbf%7Bx%7D_%7Bt%7D%20%5Cin%20%5C%7B0%2C%201%5C%7D%5E%7BN_t%7D" alt="\mathbf{x}_{t} \in \{0, 1\}^{N_t}" title="\mathbf{x}_{t} \in \{0, 1\}^{N_t}" class="math inline"> following a formation <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmathbf%7By%7D_%7Bt%7D%20%5Cin%20%5C%7B0%2C%201%5C%7D%5E%7B7%7D" alt="\mathbf{y}_{t} \in \{0, 1\}^{7}" title="\mathbf{y}_{t} \in \{0, 1\}^{7}" class="math inline">. At the end of the round, players receive scores <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmathbf%7Bs%7D_t%20%5Cin%20%5Cmathbb%7BR%7D%5E%7BN_t%7D" alt="\mathbf{s}_t \in \mathbb{R}^{N_t}" title="\mathbf{s}_t \in \mathbb{R}^{N_t}" class="math inline"> according to their in-game performance. The manager’s goal is to maximize the team score <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmathbf%7Bs%7D_t%5ET%20%5Cmathbf%7Bx%7D_t" alt="\mathbf{s}_t^T \mathbf{x}_t" title="\mathbf{s}_t^T \mathbf{x}_t" class="math inline">.</p>
<p>Since the manager doesn’t know the scores when picking their team, they must estimate score predictions <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Chat%7B%5Cmathbf%7Bs%7D%7D_t%20%5Cin%20%5Cmathbb%7BR%7D%5E%7BN_t%7D" alt="\hat{\mathbf{s}}_t \in \mathbb{R}^{N_t}" title="\hat{\mathbf{s}}_t \in \mathbb{R}^{N_t}" class="math inline">. However, predictions aren’t always accurate. Also, scores of players from the same team are correlated. To minimize the risk of picking many players from a single team and having that team perform badly, the manager might want to include the covariance between players <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20S_t%20%5Cin%20%5Cmathbb%7BR%7D_%2B%5E%7BN_t%2C%20N_t%7D" alt="S_t \in \mathbb{R}_+^{N_t, N_t}" title="S_t \in \mathbb{R}_+^{N_t, N_t}" class="math inline"> in the problem. One way to do this is to set a risk aversion <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cgamma%20%5Cin%20%5Cmathbb%7BR%7D_%2B" alt="\gamma \in \mathbb{R}_+" title="\gamma \in \mathbb{R}_+" class="math inline"> and maximize</p>
<p><img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Cdisplaystyle%20%5Chat%7B%5Cmathbf%7Bs%7D%7D_t%5ET%20%5Cmathbf%7Bx%7D_t%20-%20%5Cgamma%20%5Cmathbf%7Bx%7D_t%5ET%20%5CSigma_t%20%5Cmathbf%7Bx%7D_t." alt="\hat{\mathbf{s}}_t^T \mathbf{x}_t - \gamma \mathbf{x}_t^T \Sigma_t \mathbf{x}_t." title="\hat{\mathbf{s}}_t^T \mathbf{x}_t - \gamma \mathbf{x}_t^T \Sigma_t \mathbf{x}_t." class="math display"></p>
<p>Finally, the team is subject to the constraints:</p>
<ol type="1">
<li>Cost less or equal to the budget <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmapsto%20%5Cmathbf%7Bc%7D_t%5ET%20%5Cmathbf%7Bx%7D_t%20%5Cleq%20b_t" alt="\mapsto \mathbf{c}_t^T \mathbf{x}_t \leq b_t" title="\mapsto \mathbf{c}_t^T \mathbf{x}_t \leq b_t" class="math inline"></li>
<li>Follow a single formation <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmapsto%20%5Cmathbf%7B1%7D%5ET%20%5Cmathbf%7By%7D_t%20%3D%201" alt="\mapsto \mathbf{1}^T \mathbf{y}_t = 1" title="\mapsto \mathbf{1}^T \mathbf{y}_t = 1" class="math inline"></li>
<li>Follow a valid formation <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmapsto%20P_t%5ET%20%5Cmathbf%7Bx%7D_t%20%3D%20F%5ET%20%5Cmathbf%7By%7D_t" alt="\mapsto P_t^T \mathbf{x}_t = F^T \mathbf{y}_t" title="\mapsto P_t^T \mathbf{x}_t = F^T \mathbf{y}_t" class="math inline">.</li>
</ol>
<p>This problem is similar to the problem of Modern Portfolio Theory <span class="citation" data-cites="e5a1bb8f-41b7-35c6-95cd-8b366d3e99bc">(Markowitz 1952)</span>.</p>
<div class="no-row-height column-margin column-container"><div id="ref-e5a1bb8f-41b7-35c6-95cd-8b366d3e99bc" class="csl-entry">
Markowitz, Harry. 1952. <span>“Portfolio Selection.”</span> <em>The Journal of Finance</em> 7 (1): 77–91. <a href="http://www.jstor.org/stable/2975974">http://www.jstor.org/stable/2975974</a>.
</div></div><div id="problem" class="cell" data-execution_count="3">
<div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> cvxpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> cp</span>
<span id="cb1-2"></span>
<span id="cb1-3"></span>
<span id="cb1-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> problem(predictions, covariance, costs, positions, budget, risk_aversion):</span>
<span id="cb1-5"> picks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cp.Variable(scores.size, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"picks"</span>, boolean<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb1-6"> formation <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cp.Variable(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"formation"</span>, boolean<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb1-7"> objective <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cp.Maximize(</span>
<span id="cb1-8"> predictions.T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> picks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> risk_aversion <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> cp.quad_form(picks, covariance)</span>
<span id="cb1-9"> )</span>
<span id="cb1-10"> constraints <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb1-11"> prices.T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> picks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"><=</span> budget,</span>
<span id="cb1-12"> cp.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(formation) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb1-13"> positions.T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> picks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> formations.T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> formation,</span>
<span id="cb1-14"> ]</span>
<span id="cb1-15"> problem <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cp.Problem(objective, constraints)</span>
<span id="cb1-16"> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> problem</span></code></pre></div>
</div>
</section>
<section id="backtesting" class="level2">
<h2 class="anchored" data-anchor-id="backtesting">Backtesting</h2>
<p>So far, I’ve simplified the manager’s goal to maximize <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmathbf%7Bs%7D_t%5ET%20%5Cmathbf%7Bx%7D_t" alt="\mathbf{s}_t^T \mathbf{x}_t" title="\mathbf{s}_t^T \mathbf{x}_t" class="math inline"> for each round. The manager’s true final goal is to maximize their total score at the end of the season <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Csum_t%20%5Cmathbf%7Bs%7D_t%5ET%20%5Cmathbf%7Bx%7D_t" alt="\sum_t \mathbf{s}_t^T \mathbf{x}_t" title="\sum_t \mathbf{s}_t^T \mathbf{x}_t" class="math inline">. These two objectives aren’t necessarily the same, because players increase or decrease in valuation according to scores. Since <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmathbf%7Bs%7D_t%5ET%20%5Cmathbf%7Bx%7D_t" alt="\mathbf{s}_t^T \mathbf{x}_t" title="\mathbf{s}_t^T \mathbf{x}_t" class="math inline"> depends on the budget <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20b_t" alt="b_t" title="b_t" class="math inline">, which depends on the scores <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmathbf%7Bs%7D_%7Bt%20-%201%7D%5ET%20%5Cmathbf%7Bx%7D_%7Bt%20-%201%7D" alt="\mathbf{s}_{t - 1}^T \mathbf{x}_{t - 1}" title="\mathbf{s}_{t - 1}^T \mathbf{x}_{t - 1}" class="math inline">, one could argue that it might be a good idea to maximize a balance between scoring and valuation. In the next section, I’ll show that maximizing the score for each round is sufficient for maximizing the total score, given good enough predictions.</p>
<p>For now, I’ll define a function to simulate the manager’s performance across an entire season. At the start of the season, the manager has a budget of <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20b_1%20%3D%20100" alt="b_1 = 100" title="b_1 = 100" class="math inline">. Then, for each round <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20t" alt="t" title="t" class="math inline">:</p>
<ol type="1">
<li>Solve the team picking problem <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmapsto%20%5Cmathbf%7Bx%7D_t" alt="\mapsto \mathbf{x}_t" title="\mapsto \mathbf{x}_t" class="math inline"></li>
<li>Calculate the round score <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmapsto%20r_t%20%3D%20%5Cmathbf%7Bs%7D_t%5ET%20%5Cmathbf%7Bx%7D_t" alt="\mapsto r_t = \mathbf{s}_t^T \mathbf{x}_t" title="\mapsto r_t = \mathbf{s}_t^T \mathbf{x}_t" class="math inline"></li>
<li>If <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20t%20%3C%2038" alt="t < 38" title="t < 38" class="math inline">, update the budget <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmapsto%20b_%7Bt%20%2B%201%7D%20%3D%20b_t%20%2B%20%28%5Cmathbf%7Bc%7D_%7Bt%20%2B%201%7D%20-%20%5Cmathbf%7Bc%7D_t%29%5ET%20%5Cmathbf%7Bx%7D_t" alt="\mapsto b_{t + 1} = b_t + (\mathbf{c}_{t + 1} - \mathbf{c}_t)^T \mathbf{x}_t" title="\mapsto b_{t + 1} = b_t + (\mathbf{c}_{t + 1} - \mathbf{c}_t)^T \mathbf{x}_t" class="math inline"></li>
</ol>
<div id="backtest" class="cell" data-execution_count="4">
<div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-2"></span>
<span id="cb2-3"></span>
<span id="cb2-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> backtest(</span>
<span id="cb2-5"> initial_budget,</span>
<span id="cb2-6"> scores,</span>
<span id="cb2-7"> predictions,</span>
<span id="cb2-8"> covariance,</span>
<span id="cb2-9"> costs,</span>
<span id="cb2-10"> appreciations,</span>
<span id="cb2-11"> positions,</span>
<span id="cb2-12"> risk_aversion,</span>
<span id="cb2-13">):</span>
<span id="cb2-14"> budget <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> initial_budget</span>
<span id="cb2-15"> rounds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(predictions)</span>
<span id="cb2-16"> run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.empty(rounds)</span>
<span id="cb2-17"> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(rounds):</span>
<span id="cb2-18"> prob <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> problem(</span>
<span id="cb2-19"> predictions[t], covariance[t], costs[t], positions[t], budget, risk_aversion</span>
<span id="cb2-20"> )</span>
<span id="cb2-21"> prob.solve()</span>
<span id="cb2-22"> picks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> problem.var_dict[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"picks"</span>].value</span>
<span id="cb2-23"> run[t] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> scores[t].T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> picks[t]</span>
<span id="cb2-24"> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"><</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">38</span>:</span>
<span id="cb2-25"> budget <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> appreciations[t].T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> picks</span>
<span id="cb2-26"> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> scores</span></code></pre></div>
</div>
</section>
<section id="scenarios" class="level2 page-columns page-full">
<h2 class="anchored" data-anchor-id="scenarios">Scenarios</h2>
<ol type="1">
<li>Perfect predictions <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmapsto%20%5Chat%7B%5Cmathbf%7Bs%7D%7D_t%20%3D%20%5Cmathbf%7Bs%7D_t%2C%20%5Cgamma%20%3D%200" alt="\mapsto \hat{\mathbf{s}}_t = \mathbf{s}_t, \gamma = 0" title="\mapsto \hat{\mathbf{s}}_t = \mathbf{s}_t, \gamma = 0" class="math inline"></li>
<li>Perfect predictions and infinite budget <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmapsto%20%5Chat%7B%5Cmathbf%7Bs%7D%7D_t%20%3D%20%5Cmathbf%7Bs%7D_t%2C%20%5Cgamma%20%3D%200%2C%20%5Cmathbf%7Bb%7D_1%20%5Cgg%20100" alt="\mapsto \hat{\mathbf{s}}_t = \mathbf{s}_t, \gamma = 0, \mathbf{b}_1 \gg 100" title="\mapsto \hat{\mathbf{s}}_t = \mathbf{s}_t, \gamma = 0, \mathbf{b}_1 \gg 100" class="math inline"></li>
<li>Simple predictions and varying levels of risk aversion <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmapsto%20%5Chat%7B%5Cmathbf%7Bs%7D%7D_t%20%3D%20%5Cbar%7B%5Cmathbf%7Bs%7D%7D_%7B1%3A%28t%20-%201%29%7D" alt="\mapsto \hat{\mathbf{s}}_t = \bar{\mathbf{s}}_{1:(t - 1)}" title="\mapsto \hat{\mathbf{s}}_t = \bar{\mathbf{s}}_{1:(t - 1)}" class="math inline"><sup>1</sup><img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%2C%20%5Cgamma%20%5Cin%20%5C%7B0%2C%200.5%2C%201%5C%7D" alt=", \gamma \in \{0, 0.5, 1\}" title=", \gamma \in \{0, 0.5, 1\}" class="math inline"></li>
<li>Random predictions <img style="vertical-align:middle" src="https://latex.codecogs.com/svg.latex?%5Ctextstyle%20%5Cmapsto%20%5Chat%7B%5Cmathbf%7Bs%7D%7D_t%20%5Csim%20N%28%5Cmathbf%7B0%7D%2C%20I_%7BN_t%7D%29%2C%20%5Cgamma%20%3D%200" alt="\mapsto \hat{\mathbf{s}}_t \sim N(\mathbf{0}, I_{N_t}), \gamma = 0" title="\mapsto \hat{\mathbf{s}}_t \sim N(\mathbf{0}, I_{N_t}), \gamma = 0" class="math inline"></li>
</ol>
<div class="no-row-height column-margin column-container"><div id="fn1"><p><sup>1</sup> Explain that this is player-level…</p></div><div id="fn2"><p><sup>2</sup> Unfortunately, data for the 38th round is missing…</p></div></div><p>I’l plot… <sup>2</sup></p>
</section>
<section id="other-ideas" class="level2">
<h2 class="anchored" data-anchor-id="other-ideas">Other ideas</h2>
<p>Consider valuation, improve predictions, team leader…</p>
<p>Readings:</p>
<ul>
<li>https://peterellisjones.com/posts/fantasy-machine-learning/</li>
<li>https://www.alexmolas.com/2024/07/15/fantasy-knapsack.html</li>
</ul>
</section>
<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-citation"><h2 class="anchored quarto-appendix-heading">Citation</h2><div><div class="quarto-appendix-secondary-label">BibTeX citation:</div><pre class="sourceCode code-with-copy quarto-appendix-bibtex"><code class="sourceCode bibtex">@online{assunção2023,
author = {Assunção, Luís},
title = {Picking a Fantasy Football Team},
date = {2023-09-21},
url = {https://assuncaolfi.github.io/site/blog/fantasy-football/},
langid = {en}
}
</code></pre><div class="quarto-appendix-secondary-label">For attribution, please cite this work as:</div><div id="ref-assunção2023" class="csl-entry quarto-appendix-citeas">
Assunção, Luís. 2023. <span>“Picking a Fantasy Football Team.”</span>
September 21, 2023. <a href="https://assuncaolfi.github.io/site/blog/fantasy-football/">https://assuncaolfi.github.io/site/blog/fantasy-football/</a>.
</div></div></section></div> ]]></description>
<guid>https://assuncaolfi.github.io/site/blog/fantasy-football/</guid>
<pubDate>Thu, 21 Sep 2023 00:00:00 GMT</pubDate>
</item>
<item>
<title>tophat</title>
<link>https://assuncaolfi.github.io/site/</link>
<description>{{< bi github >}} Historical database of Cartola, a fantasy football league</description>
<guid>https://assuncaolfi.github.io/site/</guid>
<pubDate>Sun, 15 May 2022 00:00:00 GMT</pubDate>
</item>
</channel>
</rss>