File:Visualization of Thompson sampling.gif

Visualization_of_Thompson_sampling.gif(640 × 480 pixels, file size: 8.87 MB, MIME type: image/gif, looped, 301 frames, 30 s)

Summary

Description
English: Visualization of Thompson sampling in a simulated simplified context. We want to evaluate different treatment efficacies (our unknowns) in an efficient way. This is a case of basic multi-arm bandit problem. Outcome is simplified as either success of failure, and each treatment has its own (unknown to us) real probability of success (indicated by rotated squares). At each step, a patient comes in, and Thompson sampling is applied to choose which treatment to give. To that end: 1) for each treatment, a random number is picked following our current bayesian belief for that treatment's actual probability of success; 2) the treatment in which we picked the maximum of these random numbers is chosen (argmax) and applied; 3) once we get the result (success or failure), our belief is updated accordingly, and we can go to the next step.

The number below each treatment's rotated square represents the numbers of patients who received this treatment up until now. The more a treatment is applied, the less uncertainty we have about its probability of success (the distribution is "thinner").

We can see that here, Thompson sampling rapidly abandons the ineffective treatments (T1 and Placebo) and favors the most effective ones (T3 and T4).
Français : Visualisation de l'échantillonnage de Thompson dans un contexte simplifié de simulation. On veut évaluer les efficacités de différents traitements de façon efficiente. C'est un cas simple de bandit manchot. L'issue d'un traitement est simplifiée : soit succès, soit échec, et chaque traitement a sa propre probabilité de succès (inconnue pour nous), indiquée par les carrés pivotés. À chaque tour, un patient arrive, et l'échantillonnage de Thompson est appliqué pour décider du traitement lui donner. Pour cela : 1) pour chaque traitement, un nombre aléatoire est tiré, suivant la distribution actuelle de la croyance sur la probabilité de succès du traitement; 2) le traitement qui a obtenu le nombre aléatoire le plus élevé est choisi (argmax) et appliqué; 3) une fois qu'on reçoit le résultat (succès ou échec), la croyance sur la probabilité de succès de ce traitement est mise à jour, et on peut passer au tour suivant.

Le nombre en dessous de chaque carré pivoté représente le nombre de patients ayant reçu le traitement jusqu'ici. Plus un traitement est appliqué, moins on a d'incertitude sur sa probabilité de succès (la distribution est plus "fine").

On peut voir qu'ici, l'échantillonnage de Thompson abandonne rapidement les traitements inefficaces (T1 et Placebo) et favorise les plus efficaces (T3 et T4).
Date
Source Own work
Author Nguiard

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution
This file is licensed under the Creative Commons Attribution 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

Captions

Concrete example of Thompson sampling applied to simulate treatment efficacy evaluation.

10 April 2020

image/gif

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current09:35, 10 November 2023Thumbnail for version as of 09:35, 10 November 2023640 × 480 (8.87 MB)NguiardUploaded own work with UploadWizard
The following pages on the English Wikipedia use this file (pages on other projects are not listed):

Global file usage

The following other wikis use this file: