Updating predictions by previous prediction error

## boundary (singular) fit: see ?isSingular
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: delta_pred_2 ~ pe_2_lag1 + exam + (1 | cohort/id)
##    Data: df.new
## 
## REML criterion at convergence: 12583.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.8291 -0.5280 -0.0194  0.5468  3.8890 
## 
## Random effects:
##  Groups    Name        Variance Std.Dev.
##  id:cohort (Intercept)   0.000   0.00   
##  cohort    (Intercept)   3.881   1.97   
##  Residual              222.281  14.91   
## Number of obs: 1526, groups:  id:cohort, 696; cohort, 3
## 
## Fixed effects:
##              Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)    1.8212     1.7454    8.8016   1.043    0.325    
## pe_2_lag1      0.3027     0.0317 1522.9993   9.550   <2e-16 ***
## exam          -0.3934     0.4144 1469.2917  -0.949    0.343    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##           (Intr) p_2_l1
## pe_2_lag1  0.003       
## exam      -0.722 -0.046
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
## Warning: Removed 2839 rows containing missing values (geom_point).

Splitting by PE direction

Positive PEs drive prediction updating

## boundary (singular) fit: see ?isSingular
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: delta_pred_2 ~ pe_2_lag1 + (1 | id)
##    Data: df.new[which(df.new$pe_2_lag1 > 0), ]
## 
## REML criterion at convergence: 7357.9
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.7812 -0.5184 -0.0199  0.5320  3.6231 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  id       (Intercept)   0.0     0.00   
##  Residual             232.1    15.23   
## Number of obs: 888, groups:  id, 521
## 
## Fixed effects:
##              Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)  -2.36073    0.89791 886.00000  -2.629  0.00871 ** 
## pe_2_lag1     0.51091    0.07134 886.00000   7.161 1.68e-12 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##           (Intr)
## pe_2_lag1 -0.822
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

## Warning: Removed 503 rows containing missing values (geom_point).

Negative PEs unrelated to prediction updating

## boundary (singular) fit: see ?isSingular
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: delta_pred_2 ~ pe_2_lag1 + (1 | id)
##    Data: df.new[which(df.new$pe_2_lag1 < 0), ]
## 
## REML criterion at convergence: 5041.8
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.8426 -0.5135  0.1544  0.5358  3.8943 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  id       (Intercept)   0.0     0.00   
##  Residual             215.5    14.68   
## Number of obs: 614, groups:  id, 411
## 
## Fixed effects:
##              Estimate Std. Error        df t value Pr(>|t|)  
## (Intercept)  -2.12677    0.97976 612.00000  -2.171   0.0303 *
## pe_2_lag1     0.03783    0.08051 612.00000   0.470   0.6386  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##           (Intr)
## pe_2_lag1 0.797 
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

## Warning: Removed 345 rows containing missing values (geom_point).

Takeaway: model positive and negative PEs separately

## boundary (singular) fit: see ?isSingular
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: delta_pred_2 ~ unsigned_lag_pe_2 * pe_2_lag_sign_f + (1 | id)
##    Data: df.new
## 
## REML criterion at convergence: 12400.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.8526 -0.5162  0.0646  0.5327  3.8085 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  id       (Intercept)   0.0     0.00   
##  Residual             225.3    15.01   
## Number of obs: 1502, groups:  id, 694
## 
## Fixed effects:
##                                      Estimate Std. Error         df t value
## (Intercept)                          -2.12677    1.00184 1498.00000  -2.123
## unsigned_lag_pe_2                    -0.03783    0.08232 1498.00000  -0.460
## pe_2_lag_sign_f1                     -0.23396    1.33655 1498.00000  -0.175
## unsigned_lag_pe_2:pe_2_lag_sign_f1    0.54874    0.10825 1498.00000   5.069
##                                    Pr(>|t|)    
## (Intercept)                          0.0339 *  
## unsigned_lag_pe_2                    0.6459    
## pe_2_lag_sign_f1                     0.8611    
## unsigned_lag_pe_2:pe_2_lag_sign_f1 4.49e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) un___2 p_2___
## unsgnd_l__2 -0.797              
## p_2_lg_sg_1 -0.750  0.597       
## u___2:_2___  0.606 -0.760 -0.807
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Computing information content

## Warning: Removed 512 row(s) containing missing values (geom_path).

Updating vs. info content

## boundary (singular) fit: see ?isSingular
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: delta_pred_2 ~ log_info_content_lag1 * pe_2_lag_sign_f + (1 |      id)
##    Data: df.new
## 
## REML criterion at convergence: 4662.4
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.4666 -0.5300 -0.0745  0.5864  3.7737 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  id       (Intercept)   0.0     0.00   
##  Residual             179.8    13.41   
## Number of obs: 582, groups:  id, 248
## 
## Fixed effects:
##                                        Estimate Std. Error      df t value
## (Intercept)                             -13.210      2.446 578.000  -5.401
## log_info_content_lag1                     5.517      1.133 578.000   4.870
## pe_2_lag_sign_f1                         14.661      3.265 578.000   4.490
## log_info_content_lag1:pe_2_lag_sign_f1   -5.131      1.540 578.000  -3.332
##                                        Pr(>|t|)    
## (Intercept)                            9.70e-08 ***
## log_info_content_lag1                  1.44e-06 ***
## pe_2_lag_sign_f1                       8.60e-06 ***
## log_info_content_lag1:pe_2_lag_sign_f1 0.000917 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) lg___1 p_2___
## lg_nf_cnt_1 -0.934              
## p_2_lg_sg_1 -0.749  0.700       
## l___1:_2___  0.687 -0.736 -0.938
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

possible explanation: PEs cause updating in expected direction when information content is low (i.e., surprise is minimal)

## boundary (singular) fit: see ?isSingular
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: 
## delta_pred_2 ~ log_info_content_lag1 * pe_2_lag_sign_f + unsigned_lag_pe_2 *  
##     pe_2_lag_sign_f + (1 | id)
##    Data: df.new
## 
## REML criterion at convergence: 4629
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.6030 -0.5287  0.0538  0.5521  3.5874 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  id       (Intercept)   0.0     0      
##  Residual             168.9    13      
## Number of obs: 582, groups:  id, 248
## 
## Fixed effects:
##                                        Estimate Std. Error       df t value
## (Intercept)                            -13.1000     2.3757 576.0000  -5.514
## log_info_content_lag1                    5.8892     1.2086 576.0000   4.873
## pe_2_lag_sign_f1                        10.4074     3.2382 576.0000   3.214
## unsigned_lag_pe_2                       -0.1019     0.1384 576.0000  -0.737
## log_info_content_lag1:pe_2_lag_sign_f1  -6.8260     1.5899 576.0000  -4.293
## pe_2_lag_sign_f1:unsigned_lag_pe_2       0.8399     0.1824 576.0000   4.604
##                                        Pr(>|t|)    
## (Intercept)                            5.30e-08 ***
## log_info_content_lag1                  1.42e-06 ***
## pe_2_lag_sign_f1                        0.00138 ** 
## unsigned_lag_pe_2                       0.46162    
## log_info_content_lag1:pe_2_lag_sign_f1 2.07e-05 ***
## pe_2_lag_sign_f1:unsigned_lag_pe_2     5.10e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) lg___1 p_2_l__1 un___2 l___1:
## lg_nf_cnt_1 -0.821                              
## p_2_lg_sg_1 -0.734  0.602                       
## unsgnd_l__2 -0.063 -0.418  0.046                
## l___1:_2___  0.624 -0.760 -0.818    0.318       
## p_2___1:___  0.048  0.317 -0.169   -0.759 -0.328
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

see if information content or PE differentially predict updating for pos vs. neg PEs

Need to try fitting curves to these data…

Positive PEs

## boundary (singular) fit: see ?isSingular
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: delta_pred_2 ~ pe_2_lag1 * log_info_content_lag1 + (1 | id)
##    Data: df.new[which(df.new$pe_2_lag1 > 0), ]
## 
## REML criterion at convergence: 2728.4
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.0375 -0.5560  0.0138  0.5408  3.7640 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  id       (Intercept)   0.0     0.00   
##  Residual             153.3    12.38   
## Number of obs: 347, groups:  id, 202
## 
## Fixed effects:
##                                  Estimate Std. Error        df t value Pr(>|t|)
## (Intercept)                      -2.20901    4.48982 343.00000  -0.492   0.6230
## pe_2_lag1                         0.69646    0.35895 343.00000   1.940   0.0532
## log_info_content_lag1            -1.19568    2.34226 343.00000  -0.510   0.6100
## pe_2_lag1:log_info_content_lag1   0.02146    0.17619 343.00000   0.122   0.9031
##                                  
## (Intercept)                      
## pe_2_lag1                       .
## log_info_content_lag1            
## pe_2_lag1:log_info_content_lag1  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) p_2_l1 lg___1
## pe_2_lag1   -0.884              
## lg_nf_cnt_1 -0.963  0.834       
## p_2_l1:___1  0.884 -0.949 -0.907
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Negative PEs

## boundary (singular) fit: see ?isSingular
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: delta_pred_2 ~ pe_2_lag1 * log_info_content_lag1 + (1 | id)
##    Data: df.new[which(df.new$pe_2_lag1 < 0), ]
## 
## REML criterion at convergence: 1898.8
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.3601 -0.4846  0.1823  0.5959  2.3758 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  id       (Intercept)   0.0     0.00   
##  Residual             192.2    13.86   
## Number of obs: 235, groups:  id, 152
## 
## Fixed effects:
##                                 Estimate Std. Error       df t value Pr(>|t|)
## (Intercept)                     -18.3568     4.8360 231.0000  -3.796 0.000188
## pe_2_lag1                        -0.3244     0.3652 231.0000  -0.888 0.375334
## log_info_content_lag1             8.5357     2.4418 231.0000   3.496 0.000567
## pe_2_lag1:log_info_content_lag1   0.1916     0.1501 231.0000   1.276 0.203145
##                                    
## (Intercept)                     ***
## pe_2_lag1                          
## log_info_content_lag1           ***
## pe_2_lag1:log_info_content_lag1    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) p_2_l1 lg___1
## pe_2_lag1    0.792              
## lg_nf_cnt_1 -0.950 -0.688       
## p_2_l1:___1 -0.852 -0.915  0.849
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular