├── .gitignore ├── README.md ├── docs ├── .gitignore ├── BONE-SSM.png ├── bone-examples.png ├── bone-m1.png ├── bone-m2.png ├── bone-m3.png ├── day-ahead-dataset.png ├── day-ahead-forecast.png ├── day-ahead-results.png ├── index.css ├── index.css.map ├── index.html ├── index.jinja2 ├── index.scss ├── qr-code.png ├── rlpr-tnoise-rl-log-posterior.png └── rlpr-wolf-tnoise-rl-log-posterior.png ├── figures └── empty ├── notebooks ├── 01-day-ahead-forecast-nnet.ipynb ├── 02-concept-drift-clf.ipynb ├── 03-drift-and-jump-clf.ipynb ├── 04-bernoulli-bandits.ipynb ├── 05-piecewise-polynomial-regression.ipynb ├── 06-t-distributed-nonstat-linear-regression.ipynb ├── 07-segmentation-as-regression.ipynb ├── 08-sde.ipynb └── slides │ ├── 01-sequential-regression.ipynb │ └── moons_data.py └── outputs └── empty /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | 4 | # Additional ignore files 5 | *.xlsx 6 | *.mp4 7 | *.gif 8 | *.png 9 | 10 | # Byte-compiled / optimized / DLL files 11 | __pycache__/ 12 | *.py[cod] 13 | *$py.class 14 | 15 | # C extensions 16 | *.so 17 | 18 | # Distribution / packaging 19 | .Python 20 | build/ 21 | develop-eggs/ 22 | dist/ 23 | downloads/ 24 | eggs/ 25 | .eggs/ 26 | lib/ 27 | lib64/ 28 | parts/ 29 | sdist/ 30 | var/ 31 | wheels/ 32 | share/python-wheels/ 33 | *.egg-info/ 34 | .installed.cfg 35 | *.egg 36 | MANIFEST 37 | 38 | # PyInstaller 39 | # Usually these files are written by a python script from a template 40 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 41 | *.manifest 42 | *.spec 43 | 44 | # Installer logs 45 | pip-log.txt 46 | pip-delete-this-directory.txt 47 | 48 | # Unit test / coverage reports 49 | htmlcov/ 50 | .tox/ 51 | .nox/ 52 | .coverage 53 | .coverage.* 54 | .cache 55 | nosetests.xml 56 | coverage.xml 57 | *.cover 58 | *.py,cover 59 | .hypothesis/ 60 | .pytest_cache/ 61 | cover/ 62 | 63 | # Translations 64 | *.mo 65 | *.pot 66 | 67 | # Django stuff: 68 | *.log 69 | local_settings.py 70 | db.sqlite3 71 | db.sqlite3-journal 72 | 73 | # Flask stuff: 74 | instance/ 75 | .webassets-cache 76 | 77 | # Scrapy stuff: 78 | .scrapy 79 | 80 | # Sphinx documentation 81 | docs/_build/ 82 | 83 | # PyBuilder 84 | .pybuilder/ 85 | target/ 86 | 87 | # Jupyter Notebook 88 | .ipynb_checkpoints 89 | 90 | # IPython 91 | profile_default/ 92 | ipython_config.py 93 | 94 | # pyenv 95 | # For a library or package, you might want to ignore these files since the code is 96 | # intended to run in multiple environments; otherwise, check them in: 97 | # .python-version 98 | 99 | # pipenv 100 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 101 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 102 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 103 | # install all needed dependencies. 104 | #Pipfile.lock 105 | 106 | # poetry 107 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 108 | # This is especially recommended for binary packages to ensure reproducibility, and is more 109 | # commonly ignored for libraries. 110 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 111 | #poetry.lock 112 | 113 | # pdm 114 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 115 | #pdm.lock 116 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 117 | # in version control. 118 | # https://pdm.fming.dev/latest/usage/project/#working-with-version-control 119 | .pdm.toml 120 | .pdm-python 121 | .pdm-build/ 122 | 123 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 124 | __pypackages__/ 125 | 126 | # Celery stuff 127 | celerybeat-schedule 128 | celerybeat.pid 129 | 130 | # SageMath parsed files 131 | *.sage.py 132 | 133 | # Environments 134 | .env 135 | .venv 136 | env/ 137 | venv/ 138 | ENV/ 139 | env.bak/ 140 | venv.bak/ 141 | 142 | # Spyder project settings 143 | .spyderproject 144 | .spyproject 145 | 146 | # Rope project settings 147 | .ropeproject 148 | 149 | # mkdocs documentation 150 | /site 151 | 152 | # mypy 153 | .mypy_cache/ 154 | .dmypy.json 155 | dmypy.json 156 | 157 | # Pyre type checker 158 | .pyre/ 159 | 160 | # pytype static type analyzer 161 | .pytype/ 162 | 163 | # Cython debug symbols 164 | cython_debug/ 165 | 166 | # PyCharm 167 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 168 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 169 | # and can be added to the global gitignore or merged into this file. For a more nuclear 170 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 171 | #.idea/ 172 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BONE: Bayesian online learning in non-stationary environments 2 | 3 | **Paper** 📄: https://arxiv.org/abs/2411.10153 4 | 5 | ![all-test](https://github.com/user-attachments/assets/301aa490-edf4-4661-bc16-6853e2c0c947) 6 | 7 | 8 | ## Installation 9 | To run the experiments, make sure to have installed `jax>=0.4.2`, 10 | [rebayes-mini](https://github.com/gerdm/rebayes-mini/tree/main), 11 | [flax](https://github.com/google/flax), 12 | and the [BayesianOptimization](https://github.com/bayesian-optimization/BayesianOptimization) package: 13 | 14 | ```bash 15 | pip install git+https://github.com/gerdm/rebayes-mini.git 16 | pip install flax 17 | pip install bayesian-optimization 18 | ``` 19 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | !* 2 | -------------------------------------------------------------------------------- /docs/BONE-SSM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gerdm/BONE/4e2a459d92346d066f790ab8bc4d6bbe77434097/docs/BONE-SSM.png -------------------------------------------------------------------------------- /docs/bone-examples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gerdm/BONE/4e2a459d92346d066f790ab8bc4d6bbe77434097/docs/bone-examples.png -------------------------------------------------------------------------------- /docs/bone-m1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gerdm/BONE/4e2a459d92346d066f790ab8bc4d6bbe77434097/docs/bone-m1.png -------------------------------------------------------------------------------- /docs/bone-m2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gerdm/BONE/4e2a459d92346d066f790ab8bc4d6bbe77434097/docs/bone-m2.png -------------------------------------------------------------------------------- /docs/bone-m3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gerdm/BONE/4e2a459d92346d066f790ab8bc4d6bbe77434097/docs/bone-m3.png -------------------------------------------------------------------------------- /docs/day-ahead-dataset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gerdm/BONE/4e2a459d92346d066f790ab8bc4d6bbe77434097/docs/day-ahead-dataset.png -------------------------------------------------------------------------------- /docs/day-ahead-forecast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gerdm/BONE/4e2a459d92346d066f790ab8bc4d6bbe77434097/docs/day-ahead-forecast.png -------------------------------------------------------------------------------- /docs/day-ahead-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gerdm/BONE/4e2a459d92346d066f790ab8bc4d6bbe77434097/docs/day-ahead-results.png -------------------------------------------------------------------------------- /docs/index.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | /* 3 | Copyright © 2020 Clément Pit-Claudel 4 | https://github.com/cpitclaudel/academic-poster-template 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | */ 12 | a { 13 | color: inherit; 14 | } 15 | 16 | address { 17 | font-style: normal; 18 | } 19 | 20 | h1, h2, h3 { 21 | margin: 0; 22 | } 23 | 24 | pre, code, samp, .monospace { 25 | font-family: "Fira Code", monospace; 26 | } 27 | 28 | b { 29 | display: block; 30 | text-align: center; 31 | font-weight: 500; 32 | } 33 | 34 | @media all and (min-width: 80rem) { 35 | body { 36 | display: grid; 37 | grid-template-rows: auto 1fr auto; 38 | } 39 | body > header, body > footer { 40 | grid-auto-flow: column; 41 | justify-content: space-between; 42 | } 43 | body > header { 44 | grid-template-columns: auto 1fr auto; 45 | } 46 | main { 47 | align-content: flex-start; 48 | display: flex; 49 | flex-direction: column; 50 | flex-wrap: wrap; 51 | overflow: auto; 52 | padding: 0.5rem; 53 | } 54 | main::after { 55 | content: " "; 56 | display: block; 57 | flex-basis: 100%; 58 | width: 0.5rem; 59 | } 60 | main > * { 61 | flex-grow: 1; 62 | margin: 0.5rem; 63 | max-width: 40rem; 64 | min-width: 22.5rem; 65 | width: calc(25% - 1rem); 66 | } 67 | } 68 | @media not all and (min-width: 80rem) { 69 | body > header, body > footer { 70 | grid-auto-flow: row; 71 | justify-content: center; 72 | } 73 | body > header > div { 74 | margin-bottom: 0.75rem; 75 | } 76 | main > * { 77 | margin: 1rem; 78 | } 79 | article { 80 | overflow-x: auto; 81 | overflow-y: hidden; 82 | } 83 | } 84 | @media not print { 85 | body > header img { 86 | max-width: 150px; 87 | } 88 | } 89 | @media print { 90 | html { 91 | zoom: 1.5; 92 | } 93 | body > header { 94 | grid-template-columns: 1fr auto 1fr; 95 | } 96 | body > header aside:first-of-type { 97 | text-align: left; 98 | padding-left: 1rem; 99 | } 100 | body > header aside:nth-of-type(2) { 101 | text-align: right; 102 | padding-right: 1rem; 103 | grid-template-columns: auto auto; 104 | justify-content: end; 105 | } 106 | body > header h1 { 107 | font-size: 2.5rem !important; 108 | } 109 | body > header address { 110 | font-size: 1rem !important; 111 | } 112 | body > footer { 113 | grid-template-columns: 1fr auto 1fr; 114 | } 115 | body > footer > :first-child { 116 | text-align: left; 117 | padding-left: 1rem; 118 | } 119 | body > footer > :last-child { 120 | text-align: right; 121 | padding-right: 1rem; 122 | } 123 | body > main { 124 | overflow: hidden; 125 | } 126 | } 127 | html, body { 128 | height: 100%; 129 | width: 100%; 130 | } 131 | 132 | body { 133 | font-family: "Fira Sans Condensed", "Fira Sans", sans-serif; 134 | margin: 0; 135 | } 136 | body > header, body > footer { 137 | align-items: center; 138 | background: #2e3436; 139 | color: white; 140 | display: grid; 141 | grid-gap: 0.5rem; 142 | padding: 0.5rem; 143 | text-align: center; 144 | } 145 | body > header { 146 | font-size: 80%; 147 | } 148 | body > header img { 149 | max-height: 5rem; 150 | } 151 | body > header h1 { 152 | font-size: 1.5rem; 153 | font-weight: 600; 154 | } 155 | body > header h2 { 156 | font-size: 1.15rem; 157 | font-weight: 500; 158 | } 159 | body > header address { 160 | margin-bottom: 0.25rem; 161 | margin-top: 0.25rem; 162 | } 163 | body > header .publication-info { 164 | display: none; 165 | } 166 | body > header time { 167 | margin-top: 0.25rem; 168 | } 169 | body > header aside:nth-of-type(2) { 170 | display: grid; 171 | grid-template-columns: auto auto; 172 | } 173 | body > header aside:nth-of-type(2) a { 174 | display: grid; 175 | align-content: center; 176 | } 177 | 178 | main { 179 | box-sizing: border-box; 180 | min-height: 0; 181 | } 182 | main > * { 183 | box-sizing: border-box; 184 | } 185 | main > figure { 186 | align-content: center; 187 | justify-content: center; 188 | } 189 | main img, main object { 190 | align-self: center; 191 | justify-self: center; 192 | max-width: 100%; 193 | vertical-align: middle; 194 | } 195 | main figure { 196 | text-align: center; 197 | } 198 | main figure img { 199 | width: 100%; 200 | } 201 | main figure img:first-of-type:last-of-type, 202 | main figure object:first-of-type:last-of-type { 203 | display: block; 204 | margin: auto; 205 | } 206 | main figure figcaption { 207 | display: block; 208 | margin-top: 0.5rem; 209 | } 210 | 211 | article { 212 | background: white; 213 | display: flex; 214 | flex-direction: column; 215 | hyphens: none; 216 | line-height: 1.35; 217 | padding: 0 0.5rem 0.5rem 0.5rem; 218 | } 219 | article p, article ul, article ol, article pre, article div, article figure, article hr { 220 | margin: 0; 221 | } 222 | article > *, article > p, article > ul, article > ol, article > pre, article > div, article > figure, article > hr { 223 | margin: 0.5rem 0 auto 0; 224 | } 225 | article > mjx-container, article > .MJXc-display, 226 | article > .MJXp-display, 227 | article > .MathJax_Display, 228 | article > .MathJax_Preview, 229 | article > .MathJax_SVG_Display, 230 | article > .MathJax_SVG_Preview, 231 | article > .MathJax_PHTML_Display, 232 | article > .MathJax_PHTML_Preview, 233 | article > .MathJax_MathML { /* override MathJaX */ 234 | margin: 0.5rem 0 auto 0 !important; 235 | } 236 | article > header { 237 | background: #555753; 238 | color: #eeeeec; 239 | margin: 0 -0.5rem auto -0.5rem; 240 | padding: 0.25rem 0.5rem; 241 | } 242 | article > header > h3 { 243 | font-weight: 500; 244 | } 245 | article pre { 246 | overflow-x: auto; 247 | overflow-y: hidden; 248 | max-width: 100%; 249 | } 250 | article hr { 251 | border-width: thin 0 0 0; 252 | } 253 | article ul, article ol { 254 | padding: 0; 255 | } 256 | article ul > li, article ol > li { 257 | list-style-type: none; 258 | margin-left: 1.25em; 259 | margin-bottom: 0.25rem; 260 | } 261 | article ul > li::before, article ol > li::before { 262 | display: inline-block; 263 | margin-left: -1em; 264 | } 265 | article ul > li:last-child, article ol > li:last-child { 266 | margin-bottom: 0; 267 | } 268 | article ol { 269 | counter-reset: item; 270 | } 271 | article ol > li::before { 272 | content: counter(item) ". "; 273 | counter-increment: item; 274 | font-weight: 500; 275 | width: 1em; 276 | } 277 | article ul > li::before { 278 | background: #babdb6; 279 | border-radius: 100%; 280 | content: " "; 281 | height: 0.35em; 282 | vertical-align: middle; 283 | width: 0.35em; 284 | margin-right: 0.65em; 285 | } 286 | article ul.inline { 287 | padding-left: 0; 288 | display: flex; 289 | flex-wrap: wrap; 290 | justify-content: space-around; 291 | } 292 | article ul.inline li { 293 | display: inline; 294 | margin: 0.25em 0.5em; 295 | padding: 0; 296 | } 297 | article ul.inline li::before { 298 | display: none; 299 | } 300 | article th { 301 | border-bottom: 1px solid; 302 | } 303 | 304 | .boxed { 305 | border: thin solid #babdb6; 306 | padding: 0.25rem; 307 | } 308 | 309 | .center { 310 | text-align: center; 311 | } 312 | 313 | .center-self { 314 | justify-self: center; 315 | align-self: center; 316 | } 317 | 318 | .justify-center { 319 | justify-self: center; 320 | } 321 | 322 | .align-center { 323 | align-self: center; 324 | } 325 | 326 | .xxs { 327 | font-size: xx-small; 328 | } 329 | 330 | .xs { 331 | font-size: x-small; 332 | } 333 | 334 | .small { 335 | font-size: small; 336 | } 337 | 338 | .medium { 339 | font-size: medium; 340 | } 341 | 342 | .large { 343 | font-size: large; 344 | } 345 | 346 | .xl { 347 | font-size: x-large; 348 | } 349 | 350 | .xxl { 351 | font-size: xx-large; 352 | } 353 | 354 | .xxxl { 355 | font-size: xxx-large; 356 | } 357 | 358 | .columns, .columns-top, .columns-center, .columns-bottom { 359 | display: grid; 360 | grid-auto-flow: column; 361 | grid-gap: 0.5rem; 362 | } 363 | 364 | .container { 365 | display: grid; 366 | grid-auto-flow: column; 367 | column-gap: 1em; 368 | } 369 | 370 | .columns-top { 371 | align-items: start; 372 | } 373 | 374 | .columns-center { 375 | align-items: center; 376 | } 377 | 378 | .columns-bottom { 379 | align-items: end; 380 | } 381 | 382 | br.qquad { 383 | content: " "; 384 | margin-right: 4em; 385 | } 386 | 387 | .separator:empty { 388 | display: block; 389 | } 390 | 391 | .contents { 392 | display: contents; 393 | } 394 | 395 | mjx-container, .MJXc-display, 396 | .MJXp-display, 397 | .MathJax_Display, 398 | .MathJax_Preview, 399 | .MathJax_SVG_Display, 400 | .MathJax_SVG_Preview, 401 | .MathJax_PHTML_Display, 402 | .MathJax_PHTML_Preview, 403 | .MathJax_MathML { 404 | margin: 0 !important; 405 | overflow-x: auto; 406 | overflow-y: hidden; 407 | } 408 | 409 | .MathJax_Preview:empty { 410 | display: none; 411 | } 412 | 413 | body { 414 | font-family: "DM Sans Condensed", "DM Sans", sans-serif; 415 | } 416 | 417 | article > header > h3 { 418 | font-weight: 800; 419 | } 420 | 421 | html { 422 | font-size: 1rem; 423 | } 424 | 425 | .row { 426 | display: flex; 427 | } 428 | 429 | /* Create three equal columns that sits next to each other */ 430 | .column { 431 | flex: 50%; 432 | padding: 10px; 433 | } 434 | 435 | @media all and (min-width: 60rem) { 436 | main > * { 437 | flex-grow: 1; 438 | margin: 1rem; 439 | max-width: 40rem; 440 | min-width: 25rem; 441 | width: calc(25% - 2rem); 442 | } 443 | } 444 | 445 | /*# sourceMappingURL=index.css.map */ 446 | -------------------------------------------------------------------------------- /docs/index.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sourceRoot":"","sources":["../../base/base.scss","index.scss"],"names":[],"mappings":";AAAA;AAAA;AAAA;;AAAA;;AAAA;;AAAA;AAAA;AAiCI;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;;;AAIJ;EACI;IACI;IACA;;EAEA;IACI;IACA;;EAGJ;IACI;;EAIR;IACI;IACA;IACA;IACA;IACA;IACA;;EAGA;IACI;IACA;IACA;IACA;;EAGJ;IACI;IACA;IACA,WAzEO;IA0EP,WA3EO;IA4EP;;;AAKZ;EAEQ;IACI;IACA;;EAGJ;IACI,eApFE;;EAwFV;IACI,QAnFG;;EAsFP;IACI;IACA;;;AAIR;EAEQ;IACI;;;AAKZ;EACI;IACI;;EAGA;IAEI;;EACA;IACI;IACA,cA9GL;;EAgHC;IACI;IACA,eAlHL;IAmHK;IACA;;EAEJ;IACI;;EAGJ;IACI;;EAGR;IACI;;EACA;IACI;IACA,cAlIL;;EAoIC;IACI;IACA,eAtIL;;EAyIH;IACI;;;AAKZ;EACI;EACA;;;AAGJ;EACI;EACA;;AAEA;EACI;EACA,YCtKO;EDuKP,OC/JY;EDgKZ;EACA,UApKI;EAqKJ,SArKI;EAsKJ;;AAGJ;EACI;;AAEA;EACI,YApLQ;;AAuLZ;EACI;EACA;;AAGJ;EACI;EACA;;AAGJ;EACI,eA5LC;EA6LD,YA7LC;;AAgML;EACI;;AAGJ;EACI,YArMC;;AAwML;EACI;EACA;;AACA;EACI;EACA;;;AAMhB;EACI;EACA;;AAEA;EACI;;AAGJ;EACI;EACA;;AAGJ;EACI;EACA;EACA;EACA;;AAGJ;EACI;;AAEA;EACI;;AAGJ;AAAA;EAEI;EACA;;AAGJ;EACI;EACA,YArPA;;;AA0PZ;EACI,YC3Pa;ED4Pb;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;;AAGJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACI;;AAGJ;EACI,YCrRO;EDsRP,OC1RO;ED2RP;EACA;;AAEA;EACI;;AAIR;EACI;EACA;EACA;;AAGJ;EACI;;AAGJ;EACI;;AAEA;EACI;EACA;EACA,eA1SC;;AA4SD;EACI;EACA;;AAGJ;EACI;;AAKZ;EACI;;AAEA;EAEI;EACA;EACA;EACA;;AAIR;EACI,YC3UO;ED4UP;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;;AAEA;EACI;;AAKZ;EACI;;;AAQR;EACI;EACA,SAzWS;;;AA4Wb;EACI;;;AAGJ;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EAAO;;;AACP;EAAM;;;AACN;EAAS;;;AACT;EAAU;;;AACV;EAAS;;;AACT;EAAM;;;AACN;EAAO;;;AACP;EAAQ;;;AAER;EACI;EACA;EACA,UAxYQ;;;AA2YZ;EACI;EACA;EACA;;;AAGJ;EAAe;;;AACf;EAAkB;;;AAClB;EAAkB;;;AAElB;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;;;AAOJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACI;EACA;EACA;;;AAeJ;EACI;;;ACjbR;EACI;;;AAKI;EACI;;;AAKZ;EAAO;;;AAGP;EACI;;;AAGF;AACD;EACG;EACA;;;AAKJ;EACE;IACE;IACA;IACA;IACA;IACA","file":"index.css"} -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | BONE — generalised Bayesian online learning in non-stationary environments 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 29 |
30 |

BONE

31 |

A unifying framework for generalised Bayesian online learning in non-stationary environments

32 |
33 | G. Duran-Martina,b, 34 | A.Y. Shestopaloffa, 35 | L. Sanchez-Betancourtb,c, 36 | K. Murphyd. 37 |
38 | aQueen Mary University, 39 | bOxford-Man Institute of Quantitative Finance, 40 | cUniversity of Oxford, 41 | dGoogle Deepmind. 42 |
43 | 44 | TMRL, 45 | 46 | 47 |
48 | 50 |
51 |
52 |
53 |
54 |

TL;DR

55 |
56 |

57 | 58 | The BONE framework allows the classification and development of new online learning algorithms 59 | in non-stationary environments. 60 | 61 |

62 |

63 | Our framework encompasses methods in 64 | the filtering literature (e.g., Kalman filter), 65 | the segmentation literature (e.g., Bayesian online changepoint detection), 66 | the continual learning literature (e.g., variational continual learning), 67 | the contextual bandit literature (e.g., Bayesian neural bandits), and 68 | the forecasting literature (e.g., Bayesian ensemble models). 69 |

70 |
71 | 72 |
73 | State-space model (SSM) induced by BONE. 74 |
75 |
76 |
77 |
78 |
79 |

BONE components

80 |
81 | 82 | 98 |

99 | The expected posterior predictive under BONE is 100 | $$ 101 | \begin{aligned} 102 | &\hat{\bf y}_t 103 | = \sum_{\psi_t \in \Psi_t} \nu(\psi_t, {\cal D}_{1:t})\, 104 | \int q(\theta; \psi_t, {\cal D}_{1:t})\, 105 | h(\theta, {\bf x}_t)\,d\theta,\\ 106 | &\\ 107 | &q(\theta; \psi_t, {\cal D}_{1:t}) 108 | \propto \exp(-\ell_t(\theta))\,\pi(\theta; \psi_t, {\cal D}_{1:t-1}). 109 | \end{aligned} 110 | $$ 111 |

112 |
113 | 114 |
115 |
116 |

(M.1) Model for observations

117 |
118 |

119 | 120 | Represents the function that maps the features \({\bf x}_t\) to the observations \({\bf y}_t\). 121 | 122 | 123 | Choice is dependent on the nature of the data and the environment. 124 |

125 |

126 | Simple linear models 127 | $$ 128 | \begin{aligned} 129 | &\text{(Regression)}\\ 130 | &h(\theta, {\bf x}_t) = \theta^\intercal\,{\bf x}_t\\ 131 | &\\ 132 | &\text{(Classification)}\\ 133 | &h(\theta, {\bf x}_t) = \sigma(\theta^\intercal\,{\bf x}_t) 134 | \end{aligned} 135 | $$ 136 |

137 |

138 | Extensions to complex models 139 |

    140 |
  1. Neural networks: For non-linear relationships and complex patterns (e.g., CIFAR-100 dataset).
  2. 141 |
  3. Time-series models: to model temporal dependencies (e.g., LSTM, ARIMA).
  4. 142 |
143 |
144 | 145 |
146 | Choice of measurement model \(h(\theta, {\bf x}_t)\) in BONE. 147 |
148 |
149 |

150 | 151 |
152 | 153 | 154 |
155 |
156 |

(M.2) Choice of auxiliary variable

157 |
158 | 159 | Encodes our belief about what a "regime" is. 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 |
namevaluescardinality
C\(\{c\}\)\(1\)
CPT\(2^{ \{0, 1, \ldots, t\} }\)\(2^t\)
CPP\([0,1]\)\(\infty\)
CPL\(\{0,1\}^t\)\(2^t\)
CPV\((0,1)^t\)\(\infty\)
ME\(\{1, \ldots, K\}\)\(K\)
RL\(\{0, 1, \ldots, t\}\)\(t\)
RLCC\(\{\{0, t\}, \ldots, \{t, 0\}\}\)\(2 + t(t+1)/2\)
208 |

209 | C is constant, 210 | CPT is changepoint timestep, 211 | CPP is changepoint probability, 212 | CPL is changepoint location, 213 | CPV is changepoint probability vector, 214 | ME is mixture of experts, 215 | RL is runlength, 216 | RLCC is runlength with changepoint count. 217 |

218 |
219 | 220 |
221 | Choice of auxiliary variable \(\psi_t\). 222 |
223 |
224 |
225 | 226 | 227 |
228 |
229 |

(M.3) Model for conditional priors

230 |
231 | 232 | Modify prior beliefs about the model parameters based on past data and the auxiliary variable. 233 | 234 |

235 | In the Gaussian case, the conditional prior modifies the mean and covariance 236 | $$ 237 | \begin{aligned} 238 | &\pi(\theta_t;\, \psi_t,\, {\cal D}_{1:t-1}) \\ 239 | &={\cal N}\big(\theta_t\vert g_{t}(\psi_t, {\cal D}_{1:t-1}), G_{t}(\psi_t, {\cal D}_{1:t-1})\big). 240 | \end{aligned} 241 | $$ 242 |

243 | Examples 244 |

245 | C-static: constant auxvar with static updates. 246 | $$ 247 | \begin{aligned} 248 | &g_{t}(\psi_t, {\cal D}_{1:t-1}) = \mu_{t-1},\\ 249 | &G_{t}(\psi_t, {\cal D}_{1:t-1}) = \Sigma_{t-1}. 250 | \end{aligned} 251 | $$ 252 |

253 |
254 |

255 | RL-PR: runlength with prior reset 256 | $$ 257 | \begin{aligned} 258 | &g_{t}(\psi_t, {\cal D}_{1:t-1}) = \mu_{0}{\mathbb 1}(\psi_t = 0) + \mu_{(\psi_{t-1})}{\mathbb 1}(\psi_t > 0),\\ 259 | &G_{t}(\psi_t, {\cal D}_{1:t-1}) = \Sigma_{0}{\mathbb 1}(\psi_t = 0) + \Sigma_{(\psi_{t-1})}{\mathbb 1}(\psi_t > 0). 260 | \end{aligned} 261 | $$ 262 | The subscript \((\psi_t)\) denotes the posterior mean and covariance using the last \(\psi_t > 0\) observations. 263 |

264 |
265 |

266 | RL-OUPR: Runlength with OU prior discount or prior reset 267 | $$ 268 | g_{t}(\psi_t, {\cal D}_{1:t-1}) = 269 | \begin{cases} 270 | \mu_0\,(1 - \nu_t(\psi_t)) + \mu_{(\psi_{t-1})}\,\nu_t(\psi_t) & \text{if } \psi_t > 0,\\ 271 | \mu_0 & \text{if } \psi_t = 0. 272 | \end{cases} 273 | $$ 274 |

275 |
276 | 277 |
278 | Choice of auxiliary variable \(\psi_t\). 279 |
280 |
281 |
282 | 283 | 284 |
285 |
286 |

(A.1 / A.2) Algorithm for posterior update for parameters \(\theta\) and auxiliary variables \(\psi_t\)

287 |
288 |

289 | $$ 290 | \begin{aligned} 291 | q(\theta; \psi_t, {\cal D}_{1:t}) & \text{ posterior update}\\ 292 | \nu(\psi_t, {\cal D}_{1:t}) & \text{ weight update} 293 | \end{aligned} 294 | $$ 295 |

302 |

303 |
304 | 305 | 306 |
307 |
308 |

Examples in the literature

309 |
310 |
311 | 312 |
313 | Examples of BONE in the literature. 314 |
315 |
316 |
317 | 318 | 319 |
320 |
321 |

Experiment: Forecasting under distribution shift

322 |
323 |

324 | We evaluate members of the BONE framework on electricity load forecasting during the Covid-19 pandemic. 325 | Our choice of measurement model h (M.1) is a two-hidden layer multilayered perceptron (MLP) with four units per 326 | layer and a ReLU activation function. 327 | Features are lagged by one hour. 328 |

329 |
330 | 331 |
332 | Forecasting under distribution shift: 333 | changes in the output \({\bf y}_t\) (electricity load) are not 334 | reflected in the input \({\bf x}_t\) (weather features). 335 |
336 |
337 | 338 |
339 |
340 |
341 |

Results

342 |
343 |
344 | 345 | 346 |
347 | Top: Forecasting results. 348 | Bottom: 5-day mean absolute error (MAE). 349 |
350 |
351 |
352 | 353 |
354 | 365 | 366 | 367 | 368 | 369 | -------------------------------------------------------------------------------- /docs/index.jinja2: -------------------------------------------------------------------------------- 1 | {% extends "base/base.jinja2" %} 2 | 3 | 4 | {% set poster_title = "WoLF" %} 5 | {% set venue = "Unpublished" %} 6 | {% set poster_subtitle = "Outlier-robust Kalman Filtering through generalises Bayes" %} 7 | {% set webpage_title = poster_title + " — " + poster_subtitle %} 8 | {% set project_url = "https://github.com/gerdm/weighted-likelihood-filter" %} 9 | 10 | {% set pub_datetime_iso = "2020-09-08" %} 11 | {% set pub_date = "September 8, 2020" %} 12 | 13 | 14 | {% block authors %} 15 | {# Put authors here, with one link per author. #} 16 | G. Duran-Martina,c, 17 | M. Altamiranob, 18 | A.Y. Shestopaloffa, 19 | L. Sanchez-Betancourtc,d, 20 | J. Knoblauchb, 21 | M. Jonese, 22 | F.X. Briolb, 23 | K. Murphyf. 24 | {% endblock %} 25 | 26 | {% block affiliations %} 27 | aQueen Mary University, 28 | bUniversity College London, 29 | cOxford-Man Institute of Quantitative Finance, 30 | dUniversity of Oxford, 31 | eUniversity of Colorado Boulder, 32 | fGoogle Deepmind. 33 | {% endblock %} 34 | 35 | 36 | {% block contents %} 37 | 38 |
39 |

TL;DR

40 |

41 | 42 | The weighted-observation likelihood filter (WoLF) is a provably robust variant of the Kalman filter (KF) 43 | 44 | in the presence of outliers and misspecified measurement models. 45 | We show its capabilities in 46 | tracking problems (via the KF), 47 | online learning of neural neworks (via the extended KF), 48 | and data assimilation (via the ensemble KF). 49 |

50 | 51 | 52 |
53 | 54 |
55 | The dotted blue line shows the KF posterior mean estimate and 56 | the solid orange line shows the WoLF posterior mean estimate. 57 |
58 |
59 | 60 |
61 | 62 | 63 |
64 |

Problem statement (linear setting)

65 |

Consider the state-space model (SSM)

66 | 67 | $$ 68 | \def\R{\mathbb{R}} 69 | \def\bm#1{\boldsymbol #1} 70 | \begin{aligned} 71 | {\bm\theta_t} &= {\bf F}_t\bm\theta_{t-1} + \bm\phi_t,\\ 72 | {\bm y}_t &= {\bf H}_t\bm\theta_t + \bm\varphi_t, 73 | \end{aligned} 74 | $$ 75 | 76 |

77 | with \(\bm\theta_t\in\R^p\) the (latent) state vector, \({\bm y}_t\in\R^d\) the (observed) measurement vector, \({\bf F}_t\in\R^{p\times p}\) the state transition matrix, \({\bf H}_t\in\R^{d\times p}\), \(\bm\phi_t\) a zero-mean Gaussian-distributed random vector with known covariance matrix \({\bf Q}_t\), and \(\bm\varphi_t\) any zero-mean random vector representing the measurement noise. 78 |

79 | 80 |

81 | We determine either \(\mathbb{E}[\bm\theta_t \vert \bm y_{1:t}]\) or \(\mathbb{E}[\bm y_{t+1} \vert \bm y_{1:t}]\) recursively 82 | by applying the predict and modified update equations. 83 |

84 | 85 | $$ 86 | \begin{aligned} 87 | q(\bm\theta_t \vert \bm y_{1:t-1}) 88 | &= \int p(\bm\theta_t \vert \bm\theta_{t-1}) 89 | q(\bm\theta_{t-1} \vert \bm y_{1:t-1}) d\bm\theta_{t-1}\\ 90 | q(\bm\theta_t \vert \bm y_{1:t}) 91 | &\propto 92 | \exp(-\ell_t(\bm\theta_t)) 93 | q(\bm\theta_t \vert \bm y_{1:t-1}) 94 | \end{aligned} 95 | $$ 96 | 97 |

98 | with \(\ell_t(\bm\theta) = -W\left(\bm y_{t}, \hat{\bm y}_t\right)\,\log p(\bm y_t \vert \bm\theta_t)\), and 99 | \(W: \mathbb{R}^{d}\times\mathbb{R}^d \to \mathbb{R}\) the weighting function. 100 |

101 |
102 | 103 |
104 |

Weighted likelihood filter (WoLF)

105 |

106 | If the SSM follows linear dynamics, the predict and update equations are 107 |

108 |

109 | Require \({\bf F}_t, {\bf Q}_t\)// predict step
110 | \(\bm\mu_{t\vert t-1} \gets {\bf F}_t\bm\mu_t\)
111 | \(\bm\Sigma_{t\vert t-1} \gets {\bf F}_t\bm\Sigma_t{\bf F}_t^\intercal + {\bf Q}_t\)
112 |

113 |

114 | Require \(\bm y_t, {\bf H}_t, {\bf R}_t\)// update step
115 | \(\hat{\bm y}_t \gets {\bf H}_t\bm\mu_{t|t-1}\)
116 | \(w_t \gets W\left(\bm y_{t}, \hat{\bm y}_t\right)\)
117 | \(\bm\Sigma_t^{-1} \gets \bm\Sigma_{t|t-1} + w_t^2 {\bf H}_t^\intercal{\bf R}_t^{-1}{\bf H}_t\)
118 | \({\bf K}_t \gets w_t^2 \bm\Sigma_t{\bf H}_t^\intercal{\bf R}_t^{-1}\)
119 | \(\bm\mu_t \gets \bm\mu_{t|t-1} + {\bf K}_t(\bm y_t - \hat{\bm y}_t)\)
120 |

121 |
122 | 123 |
124 |

Weighting functions

125 |

126 | Two choices of weighting functions: 127 |

    128 |
  1. The inverse multi-quadratic (IMQ) — 129 | a compensation-based weighting function, and 130 |
  2. The thresholded Mahalanobis distance (TMD) — 131 | a detect-and-reject weighting function. 132 |
133 |

134 |

135 | Inverse multi-quadratic weighting function (IMQ) 136 | $$ 137 | W\left(\bm y_{t}, \hat{\bm y}_t\right) =\left(1+\frac{||\bm y_{t}-\hat{\bm y}_{t}||_2^2}{c^{2}}\right)^{-1/2} 138 | $$ 139 | with \(c > 0\). 140 |

141 | 142 |

143 | Thresholded Mahalanobis-based weighting function (TMD) 144 | $$ 145 | W\left(\bm y_{t}, \hat{\bm y}_t\right) = 146 | \begin{cases} 147 | 1 & \text{if } \|{\bf R}_t^{-1/2}(\bm y_t - \hat{\bm y}_t)\|_2^2 \leq c\\ 148 | 0 & \text{otherwise} 149 | \end{cases} 150 | $$ 151 | with \(c > 0\). 152 |

153 |
154 | 155 | 156 |
157 |

Theoretical results

158 | 159 |

160 | Definition
161 | The posterior influence function (PIF) is 162 | $$ 163 | \text{PIF}(\bm y_t^c, \bm y_{1:t-1}) = \text{KL}( 164 | q(\bm\theta_t \vert \bm y_t^c, \bm y_{1:t-1})\,\|\, 165 | q(\bm\theta_t \vert \bm y_t, \bm y_{1:t-1})\,\|\, 166 | ). 167 | $$ 168 |

169 | 170 |

171 | Definition: Outlier-robust filter
172 | A filter is outlier-robust if the PIF is bounded, i.e., 173 | $$ 174 | \sup_{\bm y_t^c\in\R^d}|\text{PIF}(\bm y_t^c, \bm y_{1:t-1})| < \infty. 175 | $$ 176 |

177 | 178 |

179 | Theorem
180 | If \(\sup_{\bm y_t\in\R^d} W\left(\bm y_t, \hat{\bm y}_t\right) < \infty\) 181 | and \(\sup_{\bm y_t\in\R^d} W\left(\bm y_{t}, \hat{\bm y}_t\right)^2\,\|\bm y_t\|^2 < \infty\) then the PIF is bounded. 182 |

183 | 184 |
    185 | Remarks 186 |
  1. The Kalman filter is not outlier-robust.
  2. 187 |
  3. Filters with IMQ and TMD weighting function are outlier-robust.
  4. 188 |
189 | 190 |
191 | 192 |
193 | PIF for the 2d-tracking problem. 194 | The last measurement \(\bm y_t\) is replaced by \(\bm y_t^c = \bm y_t + \bm\epsilon\), 195 | where \(\bm\epsilon \in [-5, 5]^2\). 196 |
197 |
198 | 199 |
200 | 201 |
202 |

Computational results

203 |

204 | Compared to variational-Bayes (VB) methods, which require multiple iterations to converge, 205 | WoLF has an equivalent computational cost to the Kalman filter. 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 | 260 |
MethodTime#HPRef
KF\(O(p^3)\)0Kalman1960
KF-B\(O(I\,p^3)\)3Wang2018
KF-IW\(O(I\,p^3)\)2Agamennoni2012
OGD\(O(I\, p^2)\)2Bencomo2023
WoLF-IMQ\(O(p^3)\)1(Ours)
WoLF-TMD\(O(p^3)\)1(Ours)
256 | Below, \(I\) is the number of inner iterations, 257 | \(p\) is the dimension of the state vector, 258 | and #HP is the number of hyperparameters. 259 |
261 |
262 | 263 |
264 |

Experiment: Kalman filter (KF)

265 |

2d tracking

266 |

267 | Linear SSM with \({\bf Q}_t = q\) \({\bf I}_4\), \({\bf R}_t = r\,{\bf I}_2\), 268 |

269 |
270 | $$ 271 | \begin{aligned} 272 | {\bf F}_t &= 273 | \begin{pmatrix} 274 | 1 & 0 & \Delta & 0\\ 275 | 0 & 1 & 0 & \Delta \\ 276 | 0 & 0 & 1 & 0 \\ 277 | 0 & 0 & 0 & 1 278 | \end{pmatrix}, & 279 | {\bf H}_t &= \begin{pmatrix} 280 | 1 & 0 & 0 & 0\\ 281 | 0 & 1 & 0 & 0 282 | \end{pmatrix}, 283 | \end{aligned} 284 | $$ 285 |
286 |

287 | \(\Delta = 0.1\) is the sampling rate, \(q = 0.10\) is the system noise, \(r = 10\) is the measurement noise, and \({\bf I}_K\) is a \(K\times K\) identity matrix. 288 |

289 |

290 | We measure the RMSE of the posterior mean estimate of the state components. 291 |

292 | 293 | Student variant 294 |

295 | Measurements are sampled according to 296 |

297 | $$ 298 | \begin{aligned} 299 | p(\bm y_t \vert \bm\theta_t) 300 | &= \text{St}({\bm y_t\,\vert\,{\bf H}_t\bm\theta_t,\,{\bf R}_t,\nu_t})\\ 301 | &= \int \mathcal{N}\left(\bm y_t, {\bf H}_t\bm\theta_t, {\bf R}_t/\tau\right) 302 | \text{Gam}(\tau \vert \nu_t / 2, \nu_t / 2) d\tau. 303 | \end{aligned} 304 | $$ 305 | 306 | Mixture variant 307 |

308 | Measurements are sampled according to 309 |

310 | $$ 311 | \begin{aligned} 312 | p(\bm y_t \vert \bm\theta_t) 313 | &= {\cal N}\left(\bm y_t \vert {\bf m}_t, {\bf R}_t\right),\\ 314 | {\bf m}_t &= 315 | \begin{cases} 316 | {\bf H}_t\,\bm\theta_t & \text{w.p.}\ 1 - p_\epsilon,\\ 317 | 2\,{\bf H}_t\,\bm\theta_t & \text{w.p.}\ p_\epsilon, 318 | \end{cases} 319 | \end{aligned} 320 | $$ 321 |

322 | with \(\epsilon = 0.05\). 323 |

324 | 325 |
326 | 327 |
328 |
329 |
330 |

KF results

331 |
332 | Sample runs 333 |
334 |
335 | 336 |
337 |
338 | 339 |
340 |
341 | 342 | Mean slowdown rate over KF 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 |
MethodStudentMixture
KF-B2.0x3.7x
KF-IW1.2x5.3x
WoLF-IMQ (ours)1.0x1.0x
WoLF-TMD (ours)1.0x1.0x
374 | 375 |
376 | 377 | 378 |
379 |

Experiment: extended Kalman filter (EKF)

380 |

Online learning of UCI datasets

381 |

382 | Online training of neural networks on a corrupted version of the tabular UCI datasets. 383 | We consider a multilayered perceptron (MLP) with twenty hidden units, two hidden layers, and a real-valued output unit. 384 | We evaluate the median squared error (RMedSE) between the true and predicted output. 385 |

386 |

The SSM is 387 | $$ 388 | \begin{aligned} 389 | {\bm\theta_t} &= \bm\theta_{t-1} + \bm\phi_t\\ 390 | {\bm y}_t &= h_t(\bm\theta_t) + \bm\varphi_t, 391 | \end{aligned} 392 | $$ 393 |
394 | with 395 | \(h_t(\bm\theta_t) = h(\bm\theta_t, {\bf x}_t) \) the MLP and 396 | \({\bf x}_t\in\mathbb{R}^m\) the input vector. 397 |

398 |

399 | We estimate \( \mathbb{E}[\bm\theta_t \vert \bm y_{1:t}] \) via the extended Kalman filter (EKF) — one measurement, one parameter update. 400 | We modify the measurement mean with 401 |

402 | $$ 403 | \mathbb{E}[\bm y_t \vert \bm\theta_t] 404 | \approx {\bf H}_t(\bm\theta_t - \bm\mu_{t | t-1}) + h_t(\bm\mu_{t | t-1}) =: \bar{\bm y}_t. 405 | $$ 406 | 407 |
408 | 409 |
410 |

EKF Results

411 | 412 |
413 | 414 |
415 | RMedSE versus time per step, relative to online gradient descent (OGD), acrross corrupted UCI datasets. 416 |
417 |
418 | 419 |
420 |
421 | 422 |

Experiment: ensemble Kalman filter (EnKF)

423 |

Data assimilation

424 | The SSM is 425 | $$ 426 | \begin{aligned} 427 | \dot{\bm\theta}_{s,i} &= \Big(\bm\theta_{s, i+1} - \bm\theta_{s, i-2}\Big) \bm\theta_{s, i-1} - \bm\theta_{s,i} + \bm\phi_{s,i},\\ 428 | {\bm y}_{s,i} &= 429 | \begin{cases} 430 | \bm\theta_{s,i} + \bm\varphi_{s,i} & \text{w.p. } 1 - p_\epsilon,\\ 431 | 100 & \text{w.p. } p_\epsilon. 432 | \end{cases} 433 | \end{aligned} 434 | $$ 435 |

436 | Here, \(\bm\theta_{s,k}\) is the value of the state component \(k\) at step \(s\), 437 | \(\bm\phi_{s,i} \sim {\cal N}(8, 1)\), \(\bm\varphi_{s,i} \sim {\cal N}(0, 1)\), \(p_\epsilon = 0.001\), 438 | \(i = 1, \ldots, d\), \(s = 1, \ldots, S\), with \(S \gg 1\) the number of steps, and 439 | \(\bm\theta_{s, d + k} = \bm\theta_{s, k}\), \(\bm\theta_{s, -k} = \bm\theta_{s, d - k}\). 440 | 441 | We consider the metric 442 | \(L_t = \sqrt{\frac{1}{d}(\bm\theta_t - \bm\mu_t)^\intercal (\bm\theta_t - \bm\mu_t)}\). 443 |

444 | 445 |
446 |
447 |

EnKF results

448 | 449 |
450 | 451 |
452 | 453 | 454 |
455 | 456 |
457 | Bootstrap estimate of \(L_T\) over 20 runs and 500 samples 458 | as a function of the \(c\) hyperparameter. 459 |
460 |
461 | 462 |
463 | 464 | 465 | {% endblock %} 466 | 467 | 468 | {% block footer_left %} 469 | 470 |
github.com/gerdm/weighted-likelihood-filter
471 |
472 | {% endblock %} -------------------------------------------------------------------------------- /docs/index.scss: -------------------------------------------------------------------------------- 1 | @use "base/base.scss" as *; 2 | 3 | ////////////////// 4 | // Tango colors // 5 | ////////////////// 6 | 7 | $tango-blue-l: #729fcf; 8 | $tango-blue-m: #3465a4; 9 | $tango-blue-d: #204a87; 10 | 11 | $tango-aluminum-1: #eeeeec; 12 | $tango-aluminum-2: #d3d7cf; 13 | $tango-aluminum-3: #babdb6; 14 | $tango-aluminum-4: #888a85; 15 | $tango-aluminum-5: #555753; 16 | $tango-aluminum-6: #2e3436; 17 | 18 | @include base( 19 | $color-title: $tango-aluminum-1, 20 | $color-accent: $tango-aluminum-3, 21 | $color-bg-light: white, 22 | $color-bg-dark: $tango-aluminum-5, 23 | $color-header-bg: $tango-aluminum-6, 24 | $color-header-text: white 25 | ); 26 | 27 | 28 | 29 | body{ 30 | font-family: 'DM Sans Condensed', 'DM Sans', sans-serif; 31 | } 32 | 33 | article{ 34 | > header{ 35 | > h3{ 36 | font-weight: 800; 37 | } 38 | } 39 | } 40 | 41 | html { font-size: 1rem } 42 | 43 | 44 | .row { 45 | display: flex; 46 | } 47 | 48 | /* Create three equal columns that sits next to each other */ 49 | .column { 50 | flex: 50%; 51 | padding: 10px; 52 | } 53 | 54 | $grid-gap: 2.0rem; 55 | 56 | @media all and (min-width: 60rem) { 57 | main > * { 58 | flex-grow: 1; 59 | margin: calc($grid-gap / 2); 60 | max-width: 40rem; 61 | min-width: 25rem; 62 | width: calc(100% / 4 - $grid-gap); 63 | } 64 | } -------------------------------------------------------------------------------- /docs/qr-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gerdm/BONE/4e2a459d92346d066f790ab8bc4d6bbe77434097/docs/qr-code.png -------------------------------------------------------------------------------- /docs/rlpr-tnoise-rl-log-posterior.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gerdm/BONE/4e2a459d92346d066f790ab8bc4d6bbe77434097/docs/rlpr-tnoise-rl-log-posterior.png -------------------------------------------------------------------------------- /docs/rlpr-wolf-tnoise-rl-log-posterior.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gerdm/BONE/4e2a459d92346d066f790ab8bc4d6bbe77434097/docs/rlpr-wolf-tnoise-rl-log-posterior.png -------------------------------------------------------------------------------- /figures/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gerdm/BONE/4e2a459d92346d066f790ab8bc4d6bbe77434097/figures/empty -------------------------------------------------------------------------------- /notebooks/slides/moons_data.py: -------------------------------------------------------------------------------- 1 | """ 2 | Prepcocessing and data augmentation for the datasets. 3 | """ 4 | import re 5 | import io 6 | import os 7 | import jax 8 | import chex 9 | import zipfile 10 | import requests 11 | import numpy as np 12 | import pandas as pd 13 | import jax.numpy as jnp 14 | import jax.random as jr 15 | from jax import vmap 16 | 17 | from sklearn.datasets import make_moons 18 | 19 | 20 | def make_showdown_moons(n_train, n_test, n_train_warmup, n_test_warmup, noise, seed=314): 21 | np.random.seed(seed) 22 | train = make_moons(n_samples=n_train, noise=noise) 23 | test = make_moons(n_samples=n_test, noise=noise) 24 | warmup_train = make_moons(n_samples=n_train_warmup, noise=noise) 25 | warmup_test = make_moons(n_samples=n_test_warmup, noise=noise) 26 | 27 | train = jax.tree_map(jnp.array, train) 28 | test = jax.tree_map(jnp.array, test) 29 | warmup_train = jax.tree_map(jnp.array, warmup_train) 30 | warmup_test = jax.tree_map(jnp.array, warmup_test) 31 | 32 | return train, test, warmup_train, warmup_test 33 | 34 | def _rotation_matrix(angle): 35 | """ 36 | Create a rotation matrix that rotates the 37 | space 'angle'-radians. 38 | """ 39 | R = np.array([ 40 | [np.cos(angle), -np.sin(angle)], 41 | [np.sin(angle), np.cos(angle)] 42 | ]) 43 | return R 44 | 45 | 46 | def _make_rotating_moons(radians, n_samples=100, **kwargs): 47 | """ 48 | Make two interleaving half circles rotated by 'radians' radians 49 | 50 | Parameters 51 | ---------- 52 | radians: float 53 | Angle of rotation 54 | n_samples: int 55 | Number of samples 56 | **kwargs: 57 | Extra arguments passed to the `make_moons` function 58 | """ 59 | X, y = make_moons(n_samples=n_samples, **kwargs) 60 | X = jnp.einsum("nm,mk->nk", X, _rotation_matrix(radians)) 61 | return X, y 62 | 63 | 64 | def make_rotating_moons(n_train, n_test, n_rotations, min_angle=0, max_angle=360, seed=314, **kwargs): 65 | """ 66 | n_train: int 67 | Number of training samples per rotation 68 | n_test: int 69 | Number of test samples per rotation 70 | n_rotations: int 71 | Number of rotations 72 | """ 73 | np.random.seed(seed) 74 | n_samples = n_train + n_test 75 | min_rad = np.deg2rad(min_angle) 76 | max_rad = np.deg2rad(max_angle) 77 | 78 | radians = np.linspace(min_rad, max_rad, n_rotations) 79 | X_train_all, y_train_all, rads_train_all = [], [], [] 80 | X_test_all, y_test_all, rads_test_all = [], [], [] 81 | for rad in radians: 82 | X, y = _make_rotating_moons(rad, n_samples=n_samples, **kwargs) 83 | rads = jnp.ones(n_samples) * rad 84 | 85 | X_train = X[:n_train] 86 | y_train = y[:n_train] 87 | rad_train = rads[:n_train] 88 | 89 | X_test = X[n_train:] 90 | y_test = y[n_train:] 91 | rad_test = rads[n_train:] 92 | 93 | X_train_all.append(X_train) 94 | y_train_all.append(y_train) 95 | rads_train_all.append(rad_train) 96 | 97 | X_test_all.append(X_test) 98 | y_test_all.append(y_test) 99 | rads_test_all.append(rad_test) 100 | 101 | X_train_all = jnp.concatenate(X_train_all, axis=0) 102 | y_train_all = jnp.concatenate(y_train_all, axis=0) 103 | rads_train_all = jnp.concatenate(rads_train_all, axis=0) 104 | X_test_all = jnp.concatenate(X_test_all, axis=0) 105 | y_test_all = jnp.concatenate(y_test_all, axis=0) 106 | rads_test_all = jnp.concatenate(rads_test_all, axis=0) 107 | 108 | train = (X_train_all, y_train_all, rads_train_all) 109 | test = (X_test_all, y_test_all, rads_test_all) 110 | 111 | return train, test 112 | 113 | -------------------------------------------------------------------------------- /outputs/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gerdm/BONE/4e2a459d92346d066f790ab8bc4d6bbe77434097/outputs/empty --------------------------------------------------------------------------------