Statistical learning shapes pain perception and prediction independently of external cues

  1. Jakub Onysk  Is a corresponding author
  2. Nicholas Gregory
  3. Mia Whitefield
  4. Maeghal Jain
  5. Georgia Turner
  6. Ben Seymour
  7. Flavia Mancini  Is a corresponding author
  1. Computational and Biological Learning Unit, Department of Engineering, University of Cambridge, United Kingdom
  2. Applied Computational Psychiatry Lab, Max Planck Centre for Computational Psychiatry and Ageing Research, Queen Square Institute of Neurology and Mental Health Neuroscience Department, Division of Psychiatry, University College London, United Kingdom
  3. MRC Cognition and Brain Sciences Unit, University of Cambridge, United Kingdom
  4. Wellcome Centre for Integrative Neuroimaging, John Radcliffe Hospital, Headington, United Kingdom
  5. Center for Information and Neural Networks (CiNet), Japan
20 figures, 10 tables and 1 additional file

Figures

Task design.

On each trial, each participant received a thermal stimulus lasting 2s from a sequence of intensities. This was followed by a perception (A) or a prediction (B) input screen, where the y-axis indicates the level of perceived/predicted intensity (0–100) centred around participant’s pain threshold, and the x-axis indicates the level of confidence in one’s perception (0–1). The inter-stimulus interval (ISI; black screen) lasted 2.5s (trial example in C). (D) Example intensity sequences are plotted in green, participant’s perception and prediction responses are in red and black, respectively. (E) Participant’s confidence rating for perception (red) and prediction (black) trials.

Participant’s model-naive performance in the task.

Violin plots of participant root mean square error (RMSE) for each condition for A: rating and B: prediction responses as compared with the input. Lower and upper hinges correspond to the first and third quartiles of partipants’ errors (the upper/lower whisker extends from the hinge to the largest/smallest value no further than 1.5 * ”Interquartile range” from the hinge); the line in the box corresponds to the median. Each condition has N=27 particpants.

Expectation weighted models.

Computational models used in the main analysis to capture participants’ pain perception (P^t) and prediction (E^t+1) ratings. Both types of ratings are affected by confidence rating (Ct)) on each trial. (A) In the reinforcement learning model, participant’s pain perception (Pt) is taken to be weighted sum of the current noxious input (Nt) and their current pain expectation (Et). Following the noxious input, participant updates their pain expectation (Et+1). (B) In the Kalman filter model, a generative model of the environment is assumed (yellow background) - where the mean pain level (xt) evolves according to a Gaussian random walk (volatility v2). The true pain level on each trial (πt) is then drawn from a Gaussian (stochasticity s2). Lastly, the noxious input, Nt, is assumed an imperfect indicator of the true pain level (subjective noise ϵ2). Inference and prediction steps are depicted in a blue box. Participant’s perceived pain is a weighted sum of expectation about the pain level (mt) and current noxious input (Nt). Following each observation, Nt, participant updates their expectation about the pain level (mt+1).

Confidence scaling factor demonstration.

(A–F) For a range of values of the confidence scaling factor C, we simulated a set of typical responses a participant would make for various levels of confidence ratings. The belief about the mean of the sequence is set at 50, while the response noise at 10. The confidence scaling factor C effectively scales the response noise, adding or reducing response uncertainty. (G–L) The effect of different levels of parameter C on noise scaling. As C increases the effect of confidence is diminished.

Model comparison for each sequence condition (A–D).

The dots indicate the expected log point-wise predictive density (ELPD) difference between the winning model (eKF - expectation weighted Kalman filter) and every other model. The line indicates the standard error (SE) of the difference. The non-winning models’ ELPD differences are annotated with the ratio between the ELPD difference and SE indicating the sigma effect, a significance heuristic.

The effect of the confidence scaling factor on noise scaling for each condition.

(A–D) Each coloured line corresponds to one participant, with the black line indicating the mean across all participants. The mean slope for each condition is annotated.

Appendix 1—figure 1
Linear transformation of the input at perception trials.

Blue dots indicate participant’s perception responses for a given level of stimulus intensity, black dots indicate transformed intensity values, a linear least squares regression was performed to achieve the best fitting line through participant’s responses as shown in red, the intercept was constrained>0.

Appendix 1—figure 2
Participants’ responses (red - perception; green - prediction) to the noxious input (dotted line) sequences.

Vertical purple lines mark the end of each condition.

Appendix 1—figure 3
Participants’ confidence ratings (red - perception; green - prediction) during the task.

Vertical purple lines mark the end of each condition.

Appendix 1—figure 4
Example plot of the input sequences (black) for each condition, one participant’s responses (white) and the winning, expectation weighted Kalman filter (eKF), model predictions (blue) including 95% confidence intervals (shaded blue) for (A–D) perception and (E–H) prediction.
Appendix 1—figure 5
Model responses against participants’ responses for each condition and each response type (A–D) perception and (E–H) prediction.

The annotated value is the grand mean correlation across subjects for each condition and response type.

Appendix 1—figure 6
Parameter recovery average SD for: (A) eRL; (B) RL; (C) eKF; (D) KF; (E) Random model.

The average SD is plotted as a function of simulation number averaged across 500 permutations of ≈100 simulations. The coloured shading corresponds to 1 SD around the average error.

Appendix 1—figure 7
Parameter recovery scatter plot for expectation weighted reinforcement learning (eRL) model from ≈100 simulations for: (A) ɑ; (B) ɣ; (C) ξ; (D) E0; (E) C parameter.
Appendix 1—figure 8
Parameter recovery scatter plot for reinforcement learning (RL) model from ≈100 simulations for: (A) ɑ; (B) ξ; (C) E0; (D) C parameter.
Appendix 1—figure 9
Parameter recovery scatter plot for expectation weighted Kalman filter (eKF) model from ≈100 simulations for: (A) ε; (B) s; (C) v; (D) ξ; (E) E0; (F) w0; (G) C parameter.
Appendix 1—figure 10
Parameter recovery scatter plot for Kalman filter (KF) model from ≈100 simulations for: (A) s; (B) v; (C) ξ; (D) E0; (E) w0; (F) C parameter.
Appendix 1—figure 11
Parameter recovery scatter plot for random model from ≈100 simulations for: (A) ξ; (B) R; (C) C parameter.
Appendix 1—figure 12
Group-level distributions for parameters for each condition for the expectation weighted Kalman filter (eKF) model.
Appendix 1—figure 13
Violin plots (and box-plots) of individual-level parameters for each condition in the winning expectation weighted Kalman filter (eKF) model.

Lower and upper hinges correspond to the first and third quartiles of partipants’ errors (the upper/lower whisker extends from the hinge to the largest/smallest value no further than 1.5 * ”Interquartile range” from the hinge); the line in the box corresponds to the median. Each condition has N=27 particpants.

Author response image 1
Stimulis intensity transformation.

Tables

Appendix 1—table 1
Within-subjects effects from repeated measures ANOVA of participant’s RMSE scores with stochasticity, volatility, and response type factors.

SS - sum of squares, MS - mean square, RMSE - root mean square error

EffectSSdfMSFpη2ηp2
Volatility10.714110.7140.9600.3360.0070.036
Residuals290.1662611.160
Stochasticity113.9641113.96419.939<0.001*0.0740.434
Residuals148.603265.715
Type365.0001365.00085.109<0.001*0.2370.766
Residuals111.503264.289
Volatility × stochasticity0.00610.0065.688e-40.9813.723e-62.188e-5
Residuals261.9122610.074
Volatility × type7.31317.3133.1960.0850.0050.109
Residuals59.487262.288
Stochasticity × type63.662163.66229.842<0.001*0.0410.534
Residuals55.466262.133
Volatility × stochasticity × type1.35611.3560.7040.4098.807e-40.026
Residuals50.060261.925
  1. * indicates statistical significance at 0.05 level.

Appendix 1—table 2
Post hoc comparisons for the repeated measures ANOVA’s interaction effect of stochasticity × type.
95%CI for mean diff.
Mean diff.LowerUpperSEtpbonf
High, perceptionLow, perception0.367−0.6871.4210.3810.9631.000
High, prediction−3.686−4.636−2.7350.345−10.688<0.001*
Low, prediction−1.147−2.3290.0340.430−2.6650.062
Low, perceptionHigh, prediction−4.053−5.234−2.8710.430−9.415<0.001*
Low, prediction−1.514−2.464−0.5640.345−4.390<0.001*
High, predictionLow, prediction2.5391.4843.5930.3816.658<0.001*
  1. * indicates statistical significance at 0.05 level.

Appendix 1—table 3
Pearson correlation coefficient r (SD) from the parameter recovery analysis for each model.
eRL
αγξE0C
r (SD)0.685 (0.113)0.92 (0.049)0.993 (0.005)0.723 (0.093)0.481 (0.131)
RL
αξE0C
r (SD)0.842 (0.081)0.993 (0.004)0.625 (0.107)0.455 (0.133)
eKF
ϵsvξE0w0C
r (SD)0.742 (0.1)0.531 (0.13)0.745 (0.09)0.986 (0.075)0.849 (0.118)0.309 (0.179)0.472 (0.123)
KF
svξE0w0C
r (SD)0.605 (0.129)0.589 (0.117)0.993 (0.005)0.585 (0.157)0.298 (0.18)0.442 (0.146)
Random model
ξRC
r (SD)0.996 (0.004)0.999 (0.001)0.079 (0.206)
Appendix 1—table 4
Confusion matrix from the model recovery analysis based on ≈100 simulations.

The y-axis indicates which model simulated the dataset, while the x-axis indicates which model fit the data based on leave-one-out information criterion (LOOIC).

eRLRLeKFKFRandom
SimulatedeRL0.3270.1730.4040.0960.000
RL0.2230.2340.2230.3190.000
eKF0.3820.0670.4270.1240.000
KF0.2290.2810.2810.2080.000
Random0.2920.0000.3580.0000.349
Fit
Appendix 1—table 5
Model comparison results for each condition.
ConditionModel nameELPD differenceSE differenceSigma effectLOOIC
Vol. high Stoch. higheKF - expectation weighted0.0000.00015748.389
eRL - expectation weighted–9.5605.0711.88515767.509
RL–139.40761.3622.27216027.202
KF–161.44477.3352.08816071.277
Random response–730.60077.0099.48717209.588
Vol. high Stoch. loweKF - expectation weighted0.0000.00015682.115
eRL - expectation weighted–17.4395.8962.95815716.993
RL–131.81735.9363.66815945.749
KF–133.46437.1713.59115949.042
Random response–824.34679.14810.41517330.807
Vol. low Stoch. higheKF - expectation weighted0.0000.00015990.114
eRL - expectation weighted–12.0277.0291.71116014.169
RL–149.33843.8743.40416288.789
KF–159.73846.4853.43616309.590
Random response–831.09684.5499.83017652.306
Vol. low Stoch. loweKF - expectation weighted0.0000.00015904.936
eRL - expectation weighted–11.0684.3092.56915927.072
RL–70.58816.6434.24116046.111
KF–74.03120.9723.53016052.997
Random response–901.792107.2448.40917708.519
Appendix 1—table 6
Bulk and tail effective sample size (ESS) values for vol. high - stoch. high.
ModelParam.ESS (bulk)ESS (tail)
eRLα58.16647.491
C90.579.142
E054.655137.729
ξ31.23347.726
γ39.50949.335
RLα56.2236.057
C99.64252.599
E0126.757467.373
ξ31.32236.92
eKFC89.28183.274
E037.723103.977
ϵ94.203429.332
v53.09941.511
s1665.5664593.161
w0616458.467467603.626
ξ31.32247.1
KFC101.58455.345
E0122.76512.134
v114.64454.015
s438.028730.579
w0904.6436759.804
ξ31.45736.763
RandomR27.93933.982
C397.862259.967
ξ32.33441.271
Appendix 1—table 7
Bulk and tail effective sample size (ESS) values for vol. high - stoch. low.
ModelParam.ESS (bulk)ESS (tail)
eRLα86.3260.849
C235.396373.736
E043.489109.903
ξ30.47136.664
γ42.12555.178
RLα49.22140.877
C328.761455.542
E063.341111.689
ξ30.30438.063
eKFC227.813363.944
E033.393104.395
ϵ376.6911218.299
v45.86137.486
s99526.69148393.383
w0567627.288634817.458
ξ30.43836.66
KFC328.005448.632
E057.467124.471
v293.426480.255
s164.454598.211
w0412979.973354163.251
ξ30.1638.105
RandomR28.39732.922
C1794.6141170.459
ξ30.20434.896
Appendix 1—table 8
Bulk and tail effective sample size (ESS) values for vol. low - stoch. high.
ModelParam.ESS (bulk)ESS (tail)
eRLα43.31240.66
C248.885434.44
E049.00685.409
ξ29.6834.909
γ45.3752.755
RLα39.91135.351
C433.949435.575
E0181.442618.317
ξ29.52736.192
eKFC248.848418.003
E035.36351.728
ϵ1272.8382427.211
v41.14440.915
s2399.6576854.212
w0612283.163531588.25
ξ29.69934.762
KFC423.339417.747
E088.749302.863
v58.79547.015
s206.969672.666
w0499152.469573964.793
ξ29.51136.341
RandomR27.89232.919
C269.239106.139
ξ29.6944.38
Appendix 1—table 9
Bulk and tail effective sample size (ESS) values for vol. low - stoch. low.
ModelParam.ESS (bulk)ESS (tail)
eRLα57.11640.932
C162.472129.413
E043.707117.295
ξ29.63234.486
γ65.497151.548
RLα45.89237.244
C158.68198.898
E080.406441.719
ξ29.55835.077
eKFC149.16126.209
E038.8873.732
ϵ653.6351473.554
v48.88343.445
s2263.5479318.066
w0635517.969313426.188
ξ29.69934.721
KFC158.729105.929
E071.438457.431
v91.98869.957
s287.835895.249
w0527620.655587092.529
ξ29.52735.147
RandomR28.47438.123
C2426.5811279.66
ξ29.53234.731
Appendix 1—table 10
Model diagnostics for each condition - estimated Bayesian fraction of missing information (E-BFMI), number of divergent transition E-BFMI values per chain.
ConditionModel# chains low E-BFMI# div. transitionsE-BFMI values
HVHSeRL000.696 0.713 0.695 0.691
RL000.76 0.748 0.771 0.806
eKF000.755 0.767 0.771 0.759
KF000.633 0.596 0.547 0.563
Random000.842 0.851 0.843 0.835
HVLSeRL000.689 0.76 0.69 0.689
RL000.624 0.688 0.688 0.685
eKF000.741 0.764 0.753 0.779
KF000.654 0.734 0.689 0.674
Random000.883 0.779 0.836 0.833
LVHSeRL000.73 0.732 0.728 0.702
RL000.719 0.714 0.742 0.7
eKF000.753 0.755 0.792 0.766
KF000.75 0.768 0.729 0.754
Random000.864 0.849 0.883 0.845
LVLSeRL000.764 0.762 0.75 0.764
RL000.714 0.764 0.719 0.697
eKF000.783 0.751 0.772 0.77
KF000.705 0.695 0.702 0.726
Random000.835 0.829 0.852 0.847

Additional files

Download links

A two-part list of links to download the article, or parts of the article, in various formats.

Downloads (link to download the article as PDF)

Open citations (links to open the citations from this article in various online reference manager services)

Cite this article (links to download the citations from this article in formats compatible with various reference manager tools)

  1. Jakub Onysk
  2. Nicholas Gregory
  3. Mia Whitefield
  4. Maeghal Jain
  5. Georgia Turner
  6. Ben Seymour
  7. Flavia Mancini
(2024)
Statistical learning shapes pain perception and prediction independently of external cues
eLife 12:RP90634.
https://doi.org/10.7554/eLife.90634.3