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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
|
{
"cells": [
{
"cell_type": "markdown",
"id": "3387e989",
"metadata": {},
"source": [
"# Linear Regression with JAX\n",
"Source: https://danielrothenberg.com/blog/2020/Sep/jax-first-steps-pt1/"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "36893279",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
]
}
],
"source": [
"%load_ext autoreload\n",
"%autoreload 2\n",
"\n",
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"\n",
"import numpy as np\n",
"import jax.numpy as jnp"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "565bff63",
"metadata": {},
"outputs": [],
"source": [
"from jax import random\n",
"\n",
"def make_key():\n",
" \"\"\" Helper function to generate a key for jax's parallel PRNG \n",
" using standard numpy random functions. \n",
"\n",
" \"\"\"\n",
" seed = np.random.randint(2**16 - 1)\n",
" return random.PRNGKey(seed)\n",
"\n",
"n = 100\n",
"rands = random.uniform(make_key(), shape=(n, ), minval=-1, maxval=1)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "11fa0b53",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]\n",
" [1. 1.]]\n",
"[[-0.49573565 1. ]\n",
" [-0.75743556 1. ]\n",
" [-0.10826278 1. ]\n",
" [-0.06045723 1. ]\n",
" [-0.6449168 1. ]\n",
" [-0.73400044 1. ]\n",
" [-0.37836146 1. ]\n",
" [-0.01198149 1. ]\n",
" [ 0.61107445 1. ]\n",
" [ 0.29680896 1. ]\n",
" [ 0.9514713 1. ]\n",
" [-0.94317484 1. ]\n",
" [ 0.5943241 1. ]\n",
" [-0.00902605 1. ]\n",
" [ 0.28311515 1. ]\n",
" [-0.1576097 1. ]\n",
" [ 0.50905204 1. ]\n",
" [ 0.40418315 1. ]\n",
" [-0.13876987 1. ]\n",
" [-0.10519576 1. ]\n",
" [ 0.4820497 1. ]\n",
" [ 0.16001129 1. ]\n",
" [-0.78287053 1. ]\n",
" [-0.83056164 1. ]\n",
" [-0.45683146 1. ]\n",
" [ 0.65588903 1. ]\n",
" [-0.30958128 1. ]\n",
" [-0.57034206 1. ]\n",
" [ 0.11413717 1. ]\n",
" [ 0.30006003 1. ]\n",
" [ 0.3948493 1. ]\n",
" [ 0.93246984 1. ]\n",
" [ 0.08236265 1. ]\n",
" [ 0.5821161 1. ]\n",
" [ 0.01212478 1. ]\n",
" [ 0.9328327 1. ]\n",
" [ 0.09593153 1. ]\n",
" [ 0.71609616 1. ]\n",
" [ 0.5419252 1. ]\n",
" [-0.78604007 1. ]\n",
" [ 0.9995785 1. ]\n",
" [-0.48301148 1. ]\n",
" [ 0.93194747 1. ]\n",
" [ 0.6257863 1. ]\n",
" [-0.42878604 1. ]\n",
" [-0.11879826 1. ]\n",
" [-0.60145855 1. ]\n",
" [ 0.25006437 1. ]\n",
" [ 0.4595716 1. ]\n",
" [ 0.48950648 1. ]\n",
" [ 0.77740407 1. ]\n",
" [ 0.17917514 1. ]\n",
" [ 0.52525926 1. ]\n",
" [ 0.7628691 1. ]\n",
" [-0.6807344 1. ]\n",
" [ 0.14769888 1. ]\n",
" [ 0.8373101 1. ]\n",
" [-0.90767694 1. ]\n",
" [ 0.90058756 1. ]\n",
" [-0.4039154 1. ]\n",
" [-0.9033947 1. ]\n",
" [ 0.8437958 1. ]\n",
" [-0.75383854 1. ]\n",
" [-0.7118697 1. ]\n",
" [ 0.2737422 1. ]\n",
" [-0.9684801 1. ]\n",
" [ 0.20652676 1. ]\n",
" [ 0.01346517 1. ]\n",
" [-0.9524138 1. ]\n",
" [-0.08028603 1. ]\n",
" [-0.71781445 1. ]\n",
" [ 0.08346677 1. ]\n",
" [ 0.6743789 1. ]\n",
" [ 0.01168156 1. ]\n",
" [ 0.0992105 1. ]\n",
" [-0.10572052 1. ]\n",
" [-0.07284904 1. ]\n",
" [-0.66415024 1. ]\n",
" [ 0.37942672 1. ]\n",
" [ 0.16580987 1. ]\n",
" [ 0.15668988 1. ]\n",
" [-0.4482379 1. ]\n",
" [-0.9518373 1. ]\n",
" [-0.22508144 1. ]\n",
" [-0.87991786 1. ]\n",
" [ 0.02797484 1. ]\n",
" [ 0.5076406 1. ]\n",
" [-0.40049028 1. ]\n",
" [ 0.55776215 1. ]\n",
" [-0.44021344 1. ]\n",
" [ 0.17129445 1. ]\n",
" [-0.4132347 1. ]\n",
" [ 0.4849968 1. ]\n",
" [ 0.7109468 1. ]\n",
" [ 0.66096044 1. ]\n",
" [-0.56528807 1. ]\n",
" [-0.55501866 1. ]\n",
" [-0.38958454 1. ]\n",
" [-0.17273688 1. ]\n",
" [-0.00741458 1. ]]\n"
]
}
],
"source": [
"# We have to use functions to update an array unlike numpy as JAX does not mutate arrays in-place\n",
"\n",
"x = jnp.ones((n, 2))\n",
"print(x)\n",
"x = x.at[:, 0].set(rands)\n",
"print(x)"
]
},
{
"cell_type": "markdown",
"id": "a9a1e2fb",
"metadata": {},
"source": [
"# Simple first model\n",
"\n",
"$$\n",
" y = X\\beta + \\epsilon\n",
"$$\n",
"\n",
"where $\\beta = [\\beta_0, \\beta_1]$ where $\\beta_0$ a slope relating x and y abd $\\beta_1$ is an offset bias, and $\\epsilon$ is an uncorrelated noise modeled as a normal distribution, $\\mathcal{N}(0, 1)$."
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "7bf67529",
"metadata": {},
"outputs": [],
"source": [
"# Fix our true slope and bias\n",
"slope, bias = 3.0, 2.0\n",
"beta_true = jnp.array((slope, bias))\n",
"eps = random.normal(make_key(), shape=(n,))"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "5a6d3ce8",
"metadata": {},
"outputs": [],
"source": [
"y = (x @ beta_true) + eps"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "462c84ec",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.collections.PathCollection at 0x7f8b306678b0>"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD4CAYAAADxeG0DAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAc/klEQVR4nO3dfZAlVXkG8OdhGGBQ46yyURhYd4mKsSTZ1Sk/somG9WOJWrAiBkiR+JXaaBJLygQdgn+YlBabbFU0qVjRLUWTSJAEZCRBXcFdigrlIjNZZPlaXVGEK8r4MUZkxGF588ftCz13uvt23z7dfU7f51e1tTN97+0+0z3z9ulz3nMOzQwiIhKuI5ougIiIlKNALiISOAVyEZHAKZCLiAROgVxEJHBHNnHQ4447ztavX9/EoUVEgjU/P/9DM1vbv72RQL5+/XrMzc01cWgRkWCRvDdpu5pWREQCp0AuIhI4BXIRkcApkIuIBE6BXEQkcI1krYiItM3s/g527j6I7y0u4YTJCVy49RRs2zRVy7EVyEVESprd38FFnzuApeXDAIDO4hIu+twBAKglmDtpWiE5SfJKkneTvIvky1zsV0QkBDt3H3w8iPcsLR/Gzt0Hazm+qxr5PwD4kpmdTfIoAMc62q+IiPe+t7hUaLtrpWvkJJ8K4OUAPgkAZvZLM1ssu18RkVCcMDlRaLtrLppWNgBYAPApkvtJfoLkkxzsV0QkCBduPQUT42Mrtk2Mj+HCrafUcnwXgfxIAC8E8M9mtgnAzwHM9L+J5HaScyTnFhYWHBxWRMQP2zZN4ZKzTsXU5AQIYGpyApecdWptWSssu2YnyWcC2Gdm66PvfwfAjJm9Lu0z09PTpkmzRESKITlvZtP920vXyM3s+wDuI9l7hnglgDvL7ldERPJxlbXyLgCXRRkr9wB4q6P9iojIAE4CuZndCmBVdV9ERKqnuVZERAKnQC4iEjjNtSIirdXkRFZ1UiAXkVYqMpFV6AFfTSsi0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VlquqGzPQ7fT8KuxbVWfszyuAfBHUfbKSwH8NKq4lD9nVfbi5vkH4A3otgk9AuAHAHZH208A8IXY+14L4Bvo3kEvjm0/Gd0/rkMA/hPA0Q7L9nQAXwHwTQDXA3hatH0awCdi71uP7l31iL7P7wFwAN1g9BkAT66rXAB+Kzr216P/3+7LOQNwPoBlALfG/m2s6pwl/e6g21xzRvT1MdF5OBSdl5Njn704+txBAL/n+Hd/ULmuj/4meufomkHXtsayXQLgjqgMewE8L/bZt0Xn8hCAt9ZZruj7DwDY0fe5Os7Z5ehmYC2jG9PeDuAdAN4RvU4AH43KfgCxLL2y50xD9EVEAhdK04qIiKRQIBcRCZwCuYhI4BTIRUQCp0AuIhI4BXIRkcApkIuIBO7/AbD57RrvT+FXAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.scatter(x[:,0], y)"
]
},
{
"cell_type": "markdown",
"id": "547a51fd",
"metadata": {},
"source": [
"# Analytical Model Fitting\n",
"\n",
"\n",
"If the problem is simple enough, we can find a closed form analytical solution to the problem. We seek to find the $\\beta$ that predicts the relationship between x and y. If we use $\\mathcal{L}(\\beta)=||\\mathbf{X}\\beta-\\mathbf{Y}||$, the analytical solution is:\n",
"\n",
"$$\n",
" \\frac{\\partial \\mathcal{L}(\\beta)}{\\partial \\beta} = -2 \\mathbf{Y}^T\\mathbf{X}+2\\beta^T\\mathbf{X}^T\\mathbf{X}\n",
"$$\n",
"\n",
"And solving for 0 gives:\n",
"\n",
"$$\n",
"\\beta = (\\mathbf{X}^T\\mathbf{X})^{-1}\\mathbf{X}^T\\mathbf{Y}\n",
"$$"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "61ad3658",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[2.9267178 1.855265 ]\n"
]
}
],
"source": [
"beta_ols = jnp.linalg.inv(x.T @ x) @ (x.T @ y)\n",
"print(beta_ols)"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "2430ba06",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD4CAYAAADxeG0DAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAA7jElEQVR4nO3dd3gUVdv48e9JgYQSOghBSJAaQEBpioIKgiACIj7CY0NRFJVXEaQl78/yEhIEQVAsYEGsCAIqFpD2PIogAqFICYSe0EsCgSSknN8fuwmbsJvsZie7s8n9uS4uktnZmTOzcO+ZM/e5R2mtEUII4bv8vN0AIYQQ7pFALoQQPk4CuRBC+DgJ5EII4eMkkAshhI8L8MZOa9asqcPCwryxayGE8FmbN28+o7WuVXC5VwJ5WFgYmzZt8sauhRDCZymlDttbLkMrQgjh4ySQCyGEj5NALoQQPs4rY+T2ZGZmkpiYSHp6urebYgpBQUHUr1+fwMBAbzdFCGFypgnkiYmJVK5cmbCwMJRS3m6OV2mtOXv2LImJiYSHh3u7OUIIkzNNIE9PT5cgbqWUokaNGpw+fdrbTRFCOGlpXBJTl8dzLDmNelWDeaVXMwa0C/XIvk0TyAEJ4jbkXAjhO5bGJTFh8Q7SMrMBSEpOY8LiHQAeCeaG3OxUSlVVSi1SSu1RSu1WSt1ixHaFEMIXTF0enxfEc6VlZjN1ebxH9m9Uj3wm8KvWepBSqhxQwaDteszZs2fp3r07ACdOnMDf359atSwTqDZu3Ei5cuW82TwhhIkdS05zabnR3A7kSqkqQFdgKIDW+gpwxd3telqNGjXYunUrAK+99hqVKlVizJgxea9nZWUREGCqkSghhEnUqxpMkp2gXa9qsEf2b0RkCgdOA58qpdoAm4EXtdaXDNi2Vw0dOpSgoCDi4uLo0qULISEh+QJ8q1atWLZsGWFhYXzxxRfMmjWLK1eu0KlTJ9577z38/f29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90s1l8zWeqtd5vfwuG+xH4WmudoZR6BsvVzF0e2rczBgOLtNbZNsu8eb5KjNcCuS7ioc5OSAKut/m9vnXZWSyXLAHWXlXucrfbpZQ6qZSqq7U+bg08pwrZ1L+AJVrrTJtt5/ZOM5RSnwJjPNkurXWS9e8DSqm1QDvgO7x8vpRSIcBPWL7EN9hsu9jnyw5H/17srZOolAoAqmD59+TMe0uyXSilemD5cuymtc7IXe7gMzUiMBXZLq31WZtfP8JyTyT3vXcUeO9aA9rkVLtsDAaet11QgufLGY7a7vb58uWhlb+BJsqScVEOy4f2g7bcPViDZXwa4HHAqB7+D9btObPda8bmrMEsd1x6AGD37nZJtEspVS13aEIpVRPoAuzy9vmyfnZLsIwdLirwmpHny+6/l0LaOwhYbT0/PwCDlSWrJRxoAmx0oy0utUsp1Q74EOintT5ls9zuZ+rBdtW1+bUfsNv683Kgp7V91YCe5L8yLdF2WdvWHMuNw/U2y0ryfDnjB+Axa/ZKZyDF2llx/3yV1B1cd/4A92MZJ8oATgLLrcvrAT/brNcH2IvlGzXSZnkjLP/REoCFQHmD2lUDWAXsA1YC1a3L2wMf2awXhuVb1q/A+1cDO7AEpC+ASp5qF3Crdd/brH8PM8P5Ah4BMoGtNn/alsT5svfvBctQTT/rz0HW40+wno9GNu+NtL4vHuht8L/3otq10vr/IPf8/FDUZ+qhdsUAO637XwM0t3nvk9bzmAA84cl2WX9/DYgt8L6SPl9fY8m6ysQSv4YBzwLPWl9XwGxru3dgk5Hn7vmSKfpCCOHjfHloRQghBBLIhRDC50kgF0IIHyeBXAghfJwEciGE8HESyIUQwsdJIBdCCB/3/wHk2UcKoifSOQAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.scatter(x[:, 0], y)\n",
"\n",
"xs = np.linspace(-1, 1)\n",
"xs = np.stack([xs, np.ones_like(xs)], axis=1)\n",
"ys_true = xs@beta_true\n",
"ys_fit = xs@beta_ols\n",
"plt.plot(xs[:, 0], ys_true, color='k', lw=2, label=\"True\")\n",
"plt.plot(xs[:, 0], ys_fit, color='orange', lw=1, label='OLS fit')\n",
"plt.legend();"
]
},
{
"cell_type": "markdown",
"id": "380ba33a",
"metadata": {},
"source": [
"# TBC..."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cbd1bd0d",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|