Skip to main content
. 2022 Aug 21;12(8):1277. doi: 10.3390/life12081277
Algorithm 1 Thompson sampling
  • 1:

    for i=1,2,,do

  • 2:

        for u{1,,K} do

  • 3:

            Sample θu^beta(αu,βu)             ▹ sample model

  •   Ui=arg maxuθu^              ▹ select and apply action

  • 4:

        Apply Ui and observe Ci

  • 5:

        (αUi,βUi)(αUi,βUi)+(Ci,1Ci)      ▹ update distribution