Preparations before modelling

Import packages for modelling

library(tidyverse)
library(nlme)
library(ggplot2)
library(scales)
library(ggpubr)
library(mgcv)
library(itsadug)
# for Lobanov transformation
library(phonR)

Set the number of cores for computation

ncores<-18

Change the color plan

library(colorspace)
library(scales)
# heatmap like
mapcols  <- rev(colorRamps::matlab.like2(100))
# a "more transparent" heatmap like
mapcols_pastel <- lighten(desaturate(mapcols, amount = 0.3), amount = 0.2)

Change the range of x-axis in the plotting

# This is for normalized time scale
ticknames<-c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1)
tickvals <- c(0,1,2,3,4,5,6,7,8,9,10)
# For re-transformed real-time scale
ticknames1<-c(0, 20, 40, 60, 80, 100, 120, 140, 160)
tickvals1 <- c(0, 20, 40, 60, 80, 100, 120, 140, 160)
ticknames2<-c(0, 25, 50, 75, 100, 125, 150, 175, 200)
tickvals2<- c(0, 25, 50, 75, 100, 125, 150, 175, 200)

import dataframes

The data used in the analysis are obtained from the corpus AISHELL-1 published by Beijing Shell Shell Technology Co.,Ltd. The recordings are conducted in a quiet indoor environment using a high fidelety mircophone and downsampled to 16kHz. The sample used in the study are from 10 male speakers and 10 female speakers of Standard Mandarin. We obtained 4 sub-datasets, of two falling diphthongs /ai/ and /au/ by two genders.

load("~/dataaimas.Rda")

load("~/dataaifem.Rda")

load("~/dataaumas.Rda")

load("~/dataaufem.Rda")

Overview of the dataset

head(data.ai.fem)

numero is the numero when extracting; sex is the gender of the speaker; speaker is the speaker ID; file is the audio file where the extracted token from; measurement.no is the normalized time point from 0 to 10; diphthong is what the diphthong is; tone is the tone of this token (tone 3 sandhi is transformed to tone 2); toneOri is the original tonal category; tone.ord is the tone as the ordered factor value (1<2<3<4); tonebis.ord is the reorganized ordered factor value (4<1<2<3) (see Appendix B); word is the word which the syllable belongs to; leftTone is the pre-target tone; rightTone is the post-target tone; initial is whether the character is at the beginning of the sentence (in the current study, the value should always be N); aspiration is whether the segment at onset is aspirated (in this study, the value should always be no); duration..ms. is the duration of the diphthong in ms; f1, f2, f0 are F1, F2, f0 in Hz; durationZscore2, f1Zscore2, f2Zscore2, f0Zscore2 are the values in Z-score; start is whether the measurement point is at the start point of all the 11 points (this is for the auto-regressive modelling); posR is the relative position in the sentance; wordPos, speakerPos, wordLeftRightTone, speakerLeftRightTone are word information and speaker information adjusted by posR and LeftTone and RightTone.

names(data.ai.fem)
 [1] "numero"               "sex"                  "speaker"             
 [4] "file"                 "measurement.no"       "diphthong"           
 [7] "tone"                 "toneOri"              "tone.ord"            
[10] "toneBis.ord"          "word"                 "leftTone"            
[13] "rightTone"            "initial"              "aspiration"          
[16] "duration..ms."        "f1"                   "f2"                  
[19] "f0"                   "durationZscore2"      "f1Zscore2"           
[22] "f2Zscore2"            "f0Zscore2"            "start"               
[25] "posR"                 "wordPos"              "speakerPos"          
[28] "speakerLeftRightTone" "wordLeftRightTone"   

For plotting: resconstruction of the data to the absolute scale

/ai/ male

meanDurationZByTone <- aggregate(data.ai.mas$durationZscore2, by = list(tone = data.ai.mas$tone.ord),mean)
print(meanDurationZByTone)
# global mean values and standard deviations
## f0
global_mean0 <- mean(data.ai.mas$f0, na.rm = TRUE)
global_sd0 <- sd(data.ai.mas$f0, na.rm = TRUE)
## f1
global_mean1 <- mean(data.ai.mas$f1, na.rm = TRUE)
global_sd1 <- sd(data.ai.mas$f1, na.rm = TRUE)
## f2
global_mean2 <- mean(data.ai.mas$f2, na.rm = TRUE)
global_sd2 <- sd(data.ai.mas$f2, na.rm = TRUE)
## duration
global_meand <- mean(data.ai.mas$duration..ms., na.rm = TRUE)
global_sdd <- sd(data.ai.mas$duration..ms., na.rm = TRUE)
# print results
print(global_mean0)
[1] 130.9548
print(global_sd0)
[1] 23.29733
print(global_mean1)
[1] 621.0464
print(global_sd1)
[1] 107.4572
print(global_mean2)
[1] 1684.322
print(global_sd2)
[1] 152.3606
print(global_meand)
[1] 139.8406
print(global_sdd)
[1] 40.63055
# reconstructed absolute duration of 4 tones
durationT1 <- meanDurationZByTone[1,2] * global_sdd + global_meand
durationT2 <- meanDurationZByTone[2,2] * global_sdd + global_meand
durationT3 <- meanDurationZByTone[3,2] * global_sdd + global_meand
durationT4 <- meanDurationZByTone[4,2] * global_sdd + global_meand
print(durationT1)
[1] 155.0534
print(durationT2)
[1] 146.0003
print(durationT3)
[1] 144.2412
print(durationT4)
[1] 147.4211

/ai/ female

meanDurationZByTonef <- aggregate(data.ai.fem$durationZscore2, by = list(tone = data.ai.fem$tone.ord),mean)
print(meanDurationZByTonef)
# global mean values and standard deviations
## f0
global_mean0f <- mean(data.ai.fem$f0, na.rm = TRUE)
global_sd0f <- sd(data.ai.fem$f0, na.rm = TRUE)
## f1
global_mean1f <- mean(data.ai.fem$f1, na.rm = TRUE)
global_sd1f <- sd(data.ai.fem$f1, na.rm = TRUE)
## f2
global_mean2f <- mean(data.ai.fem$f2, na.rm = TRUE)
global_sd2f <- sd(data.ai.fem$f2, na.rm = TRUE)
## duration
global_meandf <- mean(data.ai.fem$duration..ms., na.rm = TRUE)
global_sddf <- sd(data.ai.fem$duration..ms., na.rm = TRUE)
# print results
print(global_mean0f)
[1] 219.3686
print(global_sd0f)
[1] 33.53907
print(global_mean1f)
[1] 766.5056
print(global_sd1f)
[1] 157.2238
print(global_mean2f)
[1] 1896.827
print(global_sd2f)
[1] 218.7678
print(global_meandf)
[1] 152.4137
print(global_sddf)
[1] 32.45953
# reconstructed absolute duration of 4 tones
durationT1f <- meanDurationZByTonef[1,2] * global_sddf + global_meandf
durationT2f <- meanDurationZByTonef[2,2] * global_sddf + global_meandf
durationT3f <- meanDurationZByTonef[3,2] * global_sddf + global_meandf
durationT4f <- meanDurationZByTonef[4,2] * global_sddf + global_meandf
print(durationT1f)
[1] 144.0195
print(durationT2f)
[1] 156.5566
print(durationT3f)
[1] 152.7313
print(durationT4f)
[1] 151.7184

##/au/ male

meanDurationZByToneau <- aggregate(data.au.mas$durationZscore2, by = list(tone = data.au.mas$tone.ord),mean)
print(meanDurationZByToneau)
# global mean values and standard deviations
## f0
global_mean0au <- mean(data.au.mas$f0, na.rm = TRUE)
global_sd0au <- sd(data.au.mas$f0, na.rm = TRUE)
## f1
global_mean1au <- mean(data.au.mas$f1, na.rm = TRUE)
global_sd1au <- sd(data.au.mas$f1, na.rm = TRUE)
## f2
global_mean2au <- mean(data.au.mas$f2, na.rm = TRUE)
global_sd2au <- sd(data.au.mas$f2, na.rm = TRUE)
## duration
global_meandau <- mean(data.au.mas$duration..ms., na.rm = TRUE)
global_sddau <- sd(data.au.mas$duration..ms., na.rm = TRUE)

# print results
print(global_mean0au)
[1] 129.9584
print(global_sd0au)
[1] 24.0711
print(global_mean1au)
[1] 609.4632
print(global_sd1au)
[1] 94.02331
print(global_mean2au)
[1] 1175.144
print(global_sd2au)
[1] 171.9271
print(global_meandau)
[1] 138.8545
print(global_sddau)
[1] 35.32614
# reconstructed absolute duration of 4 tones
durationT1au <- meanDurationZByToneau[1,2] * global_sddau + global_meandau
durationT2au <- meanDurationZByToneau[2,2] * global_sddau + global_meandau
durationT3au <- meanDurationZByToneau[3,2] * global_sddau + global_meandau
durationT4au <- meanDurationZByToneau[4,2] * global_sddau + global_meandau
print(durationT1au)
[1] 149.8533
print(durationT2au)
[1] 138.4197
print(durationT3au)
[1] 130.7606
print(durationT4au)
[1] 139.0956

/au/ female

meanDurationZByToneauf <- aggregate(data.au.fem$durationZscore2, by = list(tone = data.au.fem$tone.ord),mean)
print(meanDurationZByToneauf)
# global mean values and standard deviations
## f0
global_mean0auf <- mean(data.au.fem$f0, na.rm = TRUE)
global_sd0auf <- sd(data.au.fem$f0, na.rm = TRUE)
## f1
global_mean1auf <- mean(data.au.fem$f1, na.rm = TRUE)
global_sd1auf <- sd(data.au.fem$f1, na.rm = TRUE)
## f2
global_mean2auf <- mean(data.au.fem$f2, na.rm = TRUE)
global_sd2auf <- sd(data.au.fem$f2, na.rm = TRUE)
## duration
global_meandauf <- mean(data.au.fem$duration..ms., na.rm = TRUE)
global_sddauf <- sd(data.au.fem$duration..ms., na.rm = TRUE)

# print results
print(global_mean0auf)
[1] 223.0908
print(global_sd0auf)
[1] 33.08992
print(global_mean1auf)
[1] 751.3295
print(global_sd1auf)
[1] 127.0412
print(global_mean2auf)
[1] 1348.953
print(global_sd2auf)
[1] 191.1671
print(global_meandauf)
[1] 158.5503
print(global_sddauf)
[1] 30.91023
# reconstructed absolute duration of 4 tones
durationT1auf <- meanDurationZByToneauf[1,2] * global_sddauf + global_meandauf
durationT2auf <- meanDurationZByToneauf[2,2] * global_sddauf + global_meandauf
durationT3auf <- meanDurationZByToneauf[3,2] * global_sddauf + global_meandauf
durationT4auf <- meanDurationZByToneauf[4,2] * global_sddauf + global_meandauf
print(durationT1auf)
[1] 159.5236
print(durationT2auf)
[1] 163.6863
print(durationT3auf)
[1] 153.0105
print(durationT4auf)
[1] 159.554

Model 1: Diphthong realization based on tones

Model 1A: /ai/ male, F1 as output


gamm.model1a.noAR <- bam(f1Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  

                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                        
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1a.noAR, paste("Gamm_model1a_noAR.rds"))
gamm.model1a.noAR <- 
  readRDS("Gamm_model1a_noAR.rds")
r.gamm.model1a <- start_value_rho(gamm.model1a.noAR)
# Auto-regressive model

gamm.model1a <- bam(f1Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                        
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                        
                      data=data.ai.mas, method="fREML", rho = r.gamm.model1a, AR.start = data.ai.mas$start, discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1a, paste("Gamm_model1a.rds"))
gamm.model1a <- 
  readRDS("Gamm_model1a.rds")
summary(gamm.model1a, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f1Zscore2 ~ toneBis.ord + s(measurement.no, bs = "cr") + s(measurement.no, 
    by = toneBis.ord, bs = "cr") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1, by = toneBis.ord) + s(measurement.no, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerPos, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, word, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordPos, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 3, m = 1)

Parametric coefficients:
             Estimate Std. Error t value Pr(>|t|)   
(Intercept)   0.13798    0.04700   2.936  0.00334 **
toneBis.ord1 -0.43108    0.16979  -2.539  0.01113 * 
toneBis.ord2  0.08773    0.09831   0.892  0.37223   
toneBis.ord3  0.03179    0.11072   0.287  0.77402   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
                                 edf Ref.df      F p-value    
s(measurement.no)              7.805  8.046 69.293  <2e-16 ***
s(measurement.no):toneBis.ord1 2.093  2.662  0.741  0.5883    
s(measurement.no):toneBis.ord2 7.016  7.863  9.458  <2e-16 ***
s(measurement.no):toneBis.ord3 3.813  4.531  2.577  0.0272 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =   0.64   Deviance explained = 67.4%
fREML = 9248.7  Scale est. = 0.30499   n = 12023
gam.check(gamm.model1a)


Method: fREML   Optimizer: perf chol
$grad
 [1]  4.041212e-14 -2.884692e-12 -9.547918e-14 -2.406964e-13 -1.030642e-11 -5.341571e-05 -9.061204e-05 -9.884080e-05 -4.978977e-05
[10]  7.482903e-14 -5.014362e-05 -4.804637e-05 -1.836753e-11  6.714629e-13 -8.126086e-05 -1.823430e-12 -1.267253e-11 -1.749711e-13
[19]  6.743051e-12  1.731948e-13 -5.776357e-11 -2.247091e-13 -4.232951e-05 -1.195044e-12 -4.256151e-12 -3.446132e-13 -4.647838e-12
[28]  2.144951e-13 -9.968915e-11  5.329071e-14 -8.219914e-11  4.916956e-12 -1.794973e-10 -6.252776e-13  1.289663e-09

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]          [,7]          [,8]          [,9]
   3.514578e+00  1.199872e-02  8.078218e-02  2.060962e-02 -8.069430e-02  2.692505e-09  5.347152e-07  1.793837e-09  1.713211e-07
   1.199872e-02  2.713252e-01 -3.028790e-03 -1.759066e-02  7.782067e-03  6.629533e-09  8.576933e-06  2.411988e-08 -3.135409e-08
   8.078218e-02 -3.028790e-03  2.322656e+00 -2.659205e-02  2.079923e-02 -4.780141e-09 -5.271237e-07  1.432835e-09  6.679834e-06
   2.060962e-02 -1.759066e-02 -2.659205e-02  8.191930e-01  1.576916e-02 -1.611386e-08 -8.931354e-07 -1.034232e-09  7.662352e-08
  -8.069430e-02  7.782067e-03  2.079923e-02  1.576916e-02  2.209977e+01 -1.408603e-07 -1.831717e-05 -9.465974e-08 -3.547565e-05
   2.692505e-09  6.629533e-09 -4.780141e-09 -1.611386e-08 -1.408603e-07  5.341514e-05  7.537970e-12 -6.838703e-11  5.372229e-12
   5.347152e-07  8.576933e-06 -5.271237e-07 -8.931354e-07 -1.831717e-05  7.537970e-12  9.063017e-05  9.596475e-10 -8.123521e-11
   1.793837e-09  2.411988e-08  1.432835e-09 -1.034232e-09 -9.465974e-08 -6.838703e-11  9.596475e-10  9.884227e-05 -8.657339e-12
   1.713211e-07 -3.135409e-08  6.679834e-06  7.662352e-08 -3.547565e-05  5.372229e-12 -8.123521e-11 -8.657339e-12  4.979570e-05
  -1.054696e-05  3.792651e-05 -3.034532e-05 -2.861504e-05 -8.427618e-04 -8.602667e-07 -1.367857e-08  6.156962e-07 -1.386123e-06
   2.003969e-07 -1.425964e-07 -8.370741e-07  7.600645e-06  1.341364e-06 -4.393243e-12  5.194236e-11 -4.252236e-12  4.671743e-11
  -1.499274e-11  7.854857e-10  2.339292e-09 -9.217518e-09 -1.114732e-07 -3.106779e-11 -4.921463e-12 -4.093247e-11  5.719719e-13
   3.509820e-03  6.288655e-04  1.495065e-02  3.125218e-02  1.127237e+00  1.453673e-07  2.249040e-05 -1.509466e-08  4.368891e-07
  -9.707860e-06 -5.556780e-04 -6.544468e-04 -1.300243e-03 -1.041608e-02 -1.311536e-05  5.012977e-07  2.672512e-07 -9.658215e-08
  -7.300525e-08  5.146078e-07  4.291269e-08 -1.227322e-07 -4.768276e-06  4.820314e-13  5.453332e-09  2.550769e-10 -2.610739e-11
  -5.932053e-06 -1.614580e-04  4.020952e-05  4.633752e-05 -6.933968e-05 -7.668407e-07  8.834278e-06  2.356940e-05 -4.253895e-08
  -7.077476e-04  1.558477e-03  1.444831e-03  1.320263e-03 -4.555168e-01 -3.500834e-08  9.356883e-07 -1.003001e-07  3.971857e-05
  -8.923597e-05  2.756093e-04 -7.109094e-04 -1.102395e-04  4.779052e-03 -3.076337e-07 -6.528338e-08 -4.735573e-07 -8.086701e-07
   2.574902e-03 -4.581377e-03 -2.346068e-02  1.549201e-01  2.718140e-03 -3.362726e-08 -9.790871e-07 -1.622065e-07  1.520009e-06
   3.431112e-05 -5.316147e-05 -1.396779e-04  4.920129e-04 -4.287208e-03 -4.068778e-07 -4.541917e-08  5.998016e-07  3.411355e-08
   9.390624e-03 -6.615195e-03  3.618671e-03  7.266066e-03  1.177138e+00  5.964580e-08 -1.210774e-05 -5.177681e-09  7.990606e-07
   2.434248e-05  6.609656e-04 -3.915952e-04 -7.499049e-04 -3.760280e-03 -1.291120e-05  5.432571e-07  5.372020e-07  1.289701e-07
  -7.062227e-09  5.564182e-07  1.033234e-08 -5.792939e-08 -8.249509e-07  2.345140e-14  1.139855e-09  4.205959e-11 -3.116915e-13
   3.903213e-06 -6.477310e-04 -1.815440e-05 -6.088381e-06 -4.884515e-04  9.593307e-08  1.493096e-06  4.818068e-08 -9.992954e-09
   3.115348e-03  2.132111e-03  1.352156e-01 -1.175406e-03 -5.057107e-01  5.385678e-08  4.783646e-07  3.819546e-08  1.006639e-04
  -4.604464e-05  1.139803e-04 -1.282560e-04 -6.860115e-05 -7.964329e-04 -2.304576e-08  8.222316e-08  1.779671e-06 -1.002472e-06
   1.558984e-03 -1.003144e-03 -5.995985e-03  3.570878e-02  1.423375e-02 -3.193661e-08 -1.638009e-07 -7.021900e-08  1.523949e-07
   5.134865e-06  6.069936e-05  2.647251e-06  7.234074e-05 -5.333258e-04 -2.069499e-07  2.231097e-08 -2.755798e-07 -5.477091e-09
          [,10]         [,11]         [,12]         [,13]         [,14]         [,15]         [,16]         [,17]         [,18]
  -1.054696e-05  2.003969e-07 -1.499274e-11  3.509820e-03 -9.707860e-06 -7.300525e-08 -5.932053e-06 -7.077476e-04 -8.923597e-05
   3.792651e-05 -1.425964e-07  7.854857e-10  6.288655e-04 -5.556780e-04  5.146078e-07 -1.614580e-04  1.558477e-03  2.756093e-04
  -3.034532e-05 -8.370741e-07  2.339292e-09  1.495065e-02 -6.544468e-04  4.291269e-08  4.020952e-05  1.444831e-03 -7.109094e-04
  -2.861504e-05  7.600645e-06 -9.217518e-09  3.125218e-02 -1.300243e-03 -1.227322e-07  4.633752e-05  1.320263e-03 -1.102395e-04
  -8.427618e-04  1.341364e-06 -1.114732e-07  1.127237e+00 -1.041608e-02 -4.768276e-06 -6.933968e-05 -4.555168e-01  4.779052e-03
  -8.602667e-07 -4.393243e-12 -3.106779e-11  1.453673e-07 -1.311536e-05  4.820314e-13 -7.668407e-07 -3.500834e-08 -3.076337e-07
  -1.367857e-08  5.194236e-11 -4.921463e-12  2.249040e-05  5.012977e-07  5.453332e-09  8.834278e-06  9.356883e-07 -6.528338e-08
   6.156962e-07 -4.252236e-12 -4.093247e-11 -1.509466e-08  2.672512e-07  2.550769e-10  2.356940e-05 -1.003001e-07 -4.735573e-07
  -1.386123e-06  4.671743e-11  5.719719e-13  4.368891e-07 -9.658215e-08 -2.610739e-11 -4.253895e-08  3.971857e-05 -8.086701e-07
   5.760482e-01  1.437690e-09  5.069660e-07 -2.421134e-04  3.062472e-02  2.906488e-10 -1.953441e-03 -1.307026e-02  1.178416e-01
   1.437690e-09  5.014721e-05 -4.704187e-11  1.030611e-06 -1.009065e-07  2.989235e-11 -2.788878e-08  1.612004e-07 -3.554663e-08
   5.069660e-07 -4.704187e-11  4.804656e-05 -9.409657e-08 -3.151384e-06 -1.566416e-12 -4.682400e-07  1.223735e-08 -6.081620e-07
  -2.421134e-04  1.030611e-06 -9.409657e-08  6.794266e+00 -6.291566e-02  6.258204e-06 -8.587898e-04  3.271116e-01 -2.506704e-03
   3.062472e-02 -1.009065e-07 -3.151384e-06 -6.291566e-02  3.076708e+00 -2.134762e-07 -1.080663e-01  1.051239e-03  5.651103e-01
   2.906488e-10  2.989235e-11 -1.566416e-12  6.258204e-06 -2.134762e-07  8.126588e-05  2.811071e-06 -6.707074e-07 -2.549178e-08
  -1.953441e-03 -2.788878e-08 -4.682400e-07 -8.587898e-04 -1.080663e-01  2.811071e-06  1.944245e+00 -1.078956e-03 -2.320891e-02
  -1.307026e-02  1.612004e-07  1.223735e-08  3.271116e-01  1.051239e-03 -6.707074e-07 -1.078956e-03  4.128406e+00 -2.873579e-02
   1.178416e-01 -3.554663e-08 -6.081620e-07 -2.506704e-03  5.651103e-01 -2.549178e-08 -2.320891e-02 -2.873579e-02  1.728153e+00
   1.263586e-04  8.024275e-05 -1.211157e-06  6.461461e-02  5.772070e-03  1.180867e-06 -3.104182e-03  9.241038e-03  1.399384e-04
   1.718503e-02  3.268509e-07  1.623763e-05  1.177054e-03 -2.948569e-01 -2.358916e-08  7.017461e-04 -1.652604e-03 -2.466149e-02
  -1.121160e-04  1.324575e-06 -2.505665e-08  5.183900e-01  2.299418e-03 -9.767059e-06  5.922714e-03 -6.524077e-02 -2.211722e-03
  -2.384250e-02 -9.721940e-09 -1.089392e-06  1.807326e-04 -5.062277e-01  1.489871e-07 -7.590568e-02 -4.373616e-03 -4.438168e-02
  -1.220245e-09  4.728952e-12 -2.513248e-13  1.761597e-06 -2.740813e-08  5.643390e-10  8.199244e-07 -1.316959e-07  3.095109e-10
   1.731180e-03 -3.290458e-08  1.621072e-07  1.384428e-03  7.006297e-03  6.870456e-07  2.411514e-01 -7.747128e-04 -1.822861e-03
  -2.358396e-02  7.891941e-09  2.561801e-08 -8.523358e-02 -3.331782e-03  5.283543e-07 -1.996321e-04  7.346558e-01 -2.621675e-02
   4.292356e-01  1.005476e-07  9.305561e-07  2.052212e-03  5.520382e-02  6.316423e-08  1.110856e-02 -1.591250e-02  4.165585e-02
   1.783067e-04  1.861471e-05 -6.765457e-08  4.274393e-02 -1.099702e-03  3.508441e-07 -1.096266e-03  1.273165e-02 -1.664953e-04
  -2.481815e-03 -5.075595e-07 -9.644422e-06 -1.381915e-04 -3.439098e-02 -5.187161e-09  9.322316e-03  8.798651e-04 -4.028499e-03
          [,19]         [,20]         [,21]         [,22]         [,23]         [,24]         [,25]         [,26]         [,27]
   2.574902e-03  3.431112e-05  9.390624e-03  2.434248e-05 -7.062227e-09  3.903213e-06  3.115348e-03 -4.604464e-05  1.558984e-03
  -4.581377e-03 -5.316147e-05 -6.615195e-03  6.609656e-04  5.564182e-07 -6.477310e-04  2.132111e-03  1.139803e-04 -1.003144e-03
  -2.346068e-02 -1.396779e-04  3.618671e-03 -3.915952e-04  1.033234e-08 -1.815440e-05  1.352156e-01 -1.282560e-04 -5.995985e-03
   1.549201e-01  4.920129e-04  7.266066e-03 -7.499049e-04 -5.792939e-08 -6.088381e-06 -1.175406e-03 -6.860115e-05  3.570878e-02
   2.718140e-03 -4.287208e-03  1.177138e+00 -3.760280e-03 -8.249509e-07 -4.884515e-04 -5.057107e-01 -7.964329e-04  1.423375e-02
  -3.362726e-08 -4.068778e-07  5.964580e-08 -1.291120e-05  2.345140e-14  9.593307e-08  5.385678e-08 -2.304576e-08 -3.193661e-08
  -9.790871e-07 -4.541917e-08 -1.210774e-05  5.432571e-07  1.139855e-09  1.493096e-06  4.783646e-07  8.222316e-08 -1.638009e-07
  -1.622065e-07  5.998016e-07 -5.177681e-09  5.372020e-07  4.205959e-11  4.818068e-08  3.819546e-08  1.779671e-06 -7.021900e-08
   1.520009e-06  3.411355e-08  7.990606e-07  1.289701e-07 -3.116915e-13 -9.992954e-09  1.006639e-04 -1.002472e-06  1.523949e-07
   1.263586e-04  1.718503e-02 -1.121160e-04 -2.384250e-02 -1.220245e-09  1.731180e-03 -2.358396e-02  4.292356e-01  1.783067e-04
   8.024275e-05  3.268509e-07  1.324575e-06 -9.721940e-09  4.728952e-12 -3.290458e-08  7.891941e-09  1.005476e-07  1.861471e-05
  -1.211157e-06  1.623763e-05 -2.505665e-08 -1.089392e-06 -2.513248e-13  1.621072e-07  2.561801e-08  9.305561e-07 -6.765457e-08
   6.461461e-02  1.177054e-03  5.183900e-01  1.807326e-04  1.761597e-06  1.384428e-03 -8.523358e-02  2.052212e-03  4.274393e-02
   5.772070e-03 -2.948569e-01  2.299418e-03 -5.062277e-01 -2.740813e-08  7.006297e-03 -3.331782e-03  5.520382e-02 -1.099702e-03
   1.180867e-06 -2.358916e-08 -9.767059e-06  1.489871e-07  5.643390e-10  6.870456e-07  5.283543e-07  6.316423e-08  3.508441e-07
  -3.104182e-03  7.017461e-04  5.922714e-03 -7.590568e-02  8.199244e-07  2.411514e-01 -1.996321e-04  1.110856e-02 -1.096266e-03
   9.241038e-03 -1.652604e-03 -6.524077e-02 -4.373616e-03 -1.316959e-07 -7.747128e-04  7.346558e-01 -1.591250e-02  1.273165e-02
   1.399384e-04 -2.466149e-02 -2.211722e-03 -4.438168e-02  3.095109e-10 -1.822861e-03 -2.621675e-02  4.165585e-02 -1.664953e-04
   1.204879e+01  5.075651e-02  2.047897e-03 -5.124266e-04 -9.542007e-08 -1.342538e-03  1.415988e-02  4.306628e-03  6.073223e-01
   5.075651e-02  3.927953e+00  2.938385e-03 -5.482496e-03 -8.474216e-10  8.302022e-03  3.622568e-03  6.036037e-02  5.459726e-04
   2.047897e-03  2.938385e-03  5.253549e+00 -9.446540e-02 -2.770429e-06  4.655369e-03  3.543724e-01 -2.601057e-04  1.486508e-02
  -5.124266e-04 -5.482496e-03 -9.446540e-02  5.228505e+00  4.117630e-08 -2.338422e-02  7.998041e-03 -2.825450e-01  2.825477e-03
  -9.542007e-08 -8.474216e-10 -2.770429e-06  4.117630e-08  4.232964e-05  3.791556e-07  1.429038e-07 -5.143331e-09  2.612542e-08
  -1.342538e-03  8.302022e-03  4.655369e-03 -2.338422e-02  3.791556e-07  3.303829e-01 -2.757107e-05 -1.592641e-02 -6.388198e-04
   1.415988e-02  3.622568e-03  3.543724e-01  7.998041e-03  1.429038e-07 -2.757107e-05  7.047789e+00  3.920881e-02 -2.015045e-02
   4.306628e-03  6.036037e-02 -2.601057e-04 -2.825450e-01 -5.143331e-09 -1.592641e-02  3.920881e-02  4.157009e+00  3.170395e-03
   6.073223e-01  5.459726e-04  1.486508e-02  2.825477e-03  2.612542e-08 -6.388198e-04 -2.015045e-02  3.170395e-03  1.052083e+00
  -1.372430e-02 -1.379502e-01 -3.114564e-03 -1.439501e-01  5.252809e-09  1.533555e-03 -1.316348e-04 -4.642684e-02 -3.354339e-02
          [,28]         [,29]         [,30]         [,31]         [,32]         [,33]         [,34]         [,35]
   5.134865e-06  6.397193e-03 -3.881823e-04 -7.318165e-04 -2.462069e-04  1.101810e-02 -1.270744e-03 -3.402498e+00
   6.069936e-05  6.556140e-02 -1.092968e-03  5.447388e-04 -2.672326e-04  4.562983e-02 -8.177297e-04 -5.465188e-01
   2.647251e-06  2.031523e-02 -1.859782e-03  8.025038e-04 -1.340330e-03 -1.486732e-02 -2.903254e-03 -3.007914e+00
   7.234074e-05 -1.722543e-02  2.073071e-04  4.126243e-04  1.019301e-04 -4.213763e-02  5.020988e-04 -1.406375e+00
  -5.333258e-04  1.660567e-01  1.649776e-03  7.112889e-03  1.032062e-04  1.149102e-01  6.970067e-03 -2.908826e+01
  -2.069499e-07 -8.734538e-08 -4.167430e-07 -5.639110e-09 -1.883950e-06 -9.756557e-08 -1.763993e-06 -1.681312e-05
   2.231097e-08 -2.474486e-06  1.021627e-07  2.333183e-06 -2.563879e-06 -6.837531e-06  2.960311e-07 -6.723084e-04
  -2.755798e-07 -5.942942e-07  2.578692e-06  5.444024e-08 -2.703685e-05 -4.243503e-07  5.526711e-06 -1.497752e-04
  -5.477091e-09 -4.143716e-07  1.482318e-07 -3.058104e-07 -1.557605e-07 -1.681420e-05  1.573426e-07 -4.019202e-04
  -2.481815e-03  1.241285e-03  2.619755e-02  5.854083e-05 -3.492073e-02 -1.735037e-03 -9.700632e-02 -1.658026e+00
  -5.075595e-07 -3.665525e-06 -1.005309e-07 -8.478177e-08  5.576537e-08  8.478240e-06 -2.991636e-07 -3.618042e-04
  -9.644422e-06 -1.880848e-07  8.482525e-07 -1.105431e-08  1.398607e-06 -8.618280e-08 -1.857649e-06 -5.606233e-05
  -1.381915e-04  8.254296e-01  4.601638e-03 -2.692902e-03 -1.434962e-03  3.365676e+00  1.492851e-02 -3.346585e+01
  -3.439098e-02 -4.176978e-03  5.980169e-01 -1.145863e-03  9.740293e-01 -1.359460e-02  5.023445e+00 -1.407590e+01
  -5.187161e-09  1.239965e-06  6.664766e-08  2.802890e-06 -7.163280e-07 -1.134036e-06  4.977103e-08 -4.154677e-04
   9.322316e-03 -3.243691e-03  2.762248e-02 -3.788045e-04  1.269557e-01 -1.260627e-03 -6.142758e-02 -4.671427e+00
   8.798651e-04  4.186766e-01  1.684687e-03  1.657153e-02 -9.174442e-05  7.222583e-01 -7.916400e-03 -2.320523e+01
  -4.028499e-03 -9.943348e-03  9.112610e-02  4.422773e-04 -6.022639e-02 -1.566132e-02  1.051310e+00 -7.523286e+00
  -1.372430e-02 -2.586328e-02 -1.853680e-03 -2.111150e-02 -4.733460e-03  3.344158e-01  1.086730e-02 -3.682817e+01
  -1.379502e-01 -1.376107e-02  6.899110e-02 -5.329938e-04  3.404328e-01 -3.567675e-02 -2.515323e-01 -6.715082e+00
  -3.114564e-03  1.872148e-01 -5.416453e-03  1.451644e-01 -2.333628e-02  2.134095e-01 -2.663004e-02 -1.869814e+01
  -1.439501e-01 -4.117005e-03 -4.954632e-02  1.360726e-03 -4.579150e-03  5.629381e-03  2.531043e-02 -7.720738e+00
   5.252809e-09 -1.823139e-07  1.215848e-08  4.940700e-07 -2.520812e-07 -2.782813e-06  2.810575e-08 -8.234459e-05
   1.533555e-03 -2.622506e-04  5.478100e-02  2.969339e-04  1.417136e-01  1.052615e-03  1.003159e-01 -1.715349e+00
  -1.316348e-04  1.381253e-01  8.494358e-04  8.871161e-03 -2.250868e-02  6.198031e-02 -2.767862e-03 -2.469630e+01
  -4.642684e-02 -2.446288e-03 -1.446948e-02  7.373763e-04  4.650351e-02 -5.211658e-03 -1.255930e-01 -7.074164e+00
  -3.354339e-02 -8.240811e-02 -4.419511e-03  1.417983e-02 -2.291816e-02  6.337225e-02 -1.076768e-02 -7.568868e+00
   2.619163e-01 -1.003260e-03  5.591196e-02 -4.582528e-04  3.074007e-01 -3.332089e-03  2.035330e-01 -1.713075e+00
 [ getOption("max.print") est atteint -- 7 lignes omises ]

Model rank =  6565 / 6565 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                          k'      edf k-index p-value
s(measurement.no)                                   9.00e+00 7.80e+00    0.99    0.32
s(measurement.no):toneBis.ord1                      9.00e+00 2.09e+00    0.99    0.27
s(measurement.no):toneBis.ord2                      9.00e+00 7.02e+00    0.99    0.32
s(measurement.no):toneBis.ord3                      9.00e+00 3.81e+00    0.99    0.26
s(measurement.no,speaker)                           1.00e+02 5.82e+01    0.99    0.27
s(measurement.no,speaker):toneBis.ord1              1.00e+02 2.02e-03    0.99    0.28
s(measurement.no,speaker):toneBis.ord2              1.00e+02 3.32e+00    0.99    0.34
s(measurement.no,speaker):toneBis.ord3              1.00e+02 1.03e-03    0.99    0.29
s(measurement.no,speakerLeftRightTone)              5.90e+02 9.51e+01    0.99    0.35
s(measurement.no,speakerLeftRightTone):toneBis.ord1 5.90e+02 9.34e+00    0.99    0.28
s(measurement.no,speakerLeftRightTone):toneBis.ord2 5.90e+02 6.15e+01    0.99    0.26
s(measurement.no,speakerLeftRightTone):toneBis.ord3 5.90e+02 8.71e+01    0.99    0.31
s(measurement.no,speakerPos)                        3.00e+02 5.28e+01    0.99    0.30
s(measurement.no,speakerPos):toneBis.ord1           3.00e+02 3.43e+00    0.99    0.26
s(measurement.no,speakerPos):toneBis.ord2           3.00e+02 6.35e+01    0.99    0.30
s(measurement.no,speakerPos):toneBis.ord3           3.00e+02 1.86e+01    0.99    0.34
s(measurement.no,word)                              6.30e+02 1.55e+02    0.99    0.33
s(measurement.no,wordPos)                           9.99e+02 9.50e+01    0.99    0.31
s(measurement.no,wordLeftRightTone)                 9.36e+02 4.16e+02    0.99    0.28

# Plotting
# Normalized scale

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1a, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", ylim = c(-1, 1), lwd = 4, xlab = "Time (normalized)", ylab = "F1 (Z)", xaxt = "n", font.lab = 2)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1a, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1a, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1a, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
legend("topright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

# Plotting
# Resconstructed scale

# output: 1000 dpi png
# png("pred1-1t.png", width = 6, height = 4, units = "in", res = 1000)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1a, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", ylim = c(500, 800), xlab = "Time (ms)", ylab = "F1 (Hz)", xaxt = "n", font.lab = 2, add = F, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT1 * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1, hide.label = TRUE)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1a, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT2 * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1a, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT3 * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1a, view="measurement.no",
             rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", lwd = 4, add = T, transform.view = function(measurement.no) measurement.no * durationT4 * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
legend("topright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)


# dev.off()
# Plotting
# Diffrence plot between tones
par(mfcol = c(2, 3), mar = c(2, 2, 2, 1), oma = c(4, 4, 2, 1)) 
plot_diff(gamm.model1a, view="measurement.no", comp=list(toneBis.ord = c("1","2")), rm.ranef=TRUE, main = "1-2", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.000000 - 7.474747
plot_diff(gamm.model1a, view="measurement.no",comp=list(toneBis.ord = c("1","3")),rm.ranef=TRUE, main = "1-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.505051 - 6.666667
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1a, view="measurement.no",comp=list(toneBis.ord = c("1","4")),rm.ranef=TRUE, main = "1-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.000000 - 10.000000
plot_diff(gamm.model1a, view="measurement.no",comp=list(toneBis.ord = c("2","3")),rm.ranef=TRUE, main = "2-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1a, view="measurement.no",comp=list(toneBis.ord = c("2","4")),rm.ranef=TRUE, main = "2-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.505051 - 4.141414
    9.393939 - 10.000000
plot_diff(gamm.model1a, view="measurement.no",comp=list(toneBis.ord = c("3","4")),rm.ranef=TRUE, main = "3-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
mtext("Difference in F1 (Z)", side = 2, outer = TRUE, line = 2.5, cex = 1.2, font = 2)
mtext("Time (normalized)", side = 1, outer = TRUE, line = 2.5, cex = 1.2, font = 2)

plot_parametric(gamm.model1a, pred = list(toneBis.ord=c("1", "2", "3", "4")), main = "Tone", xlab = "F1 (Z)")
Summary:
    * toneBis.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; set to the value(s): 5. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Model 1B: /ai/ female, F1 as output


gamm.model1b.noAR <- bam(f1Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                          
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                        
                      data=data.ai.fem, method="fREML", discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1b.noAR, paste("Gamm_model1b_noAR.rds"))
gamm.model1b.noAR <- 
  readRDS("Gamm_model1b_noAR.rds")
r.gamm.model1b <- start_value_rho(gamm.model1b.noAR)
# Auto-regressive model
gamm.model1b <- bam(f1Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                      
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                    
                      data=data.ai.fem, method="fREML", rho = r.gamm.model1b, AR.start = data.ai.fem$start, discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1b, paste("Gamm_model1b.rds"))
gamm.model1b <- 
  readRDS("Gamm_model1b.rds")
summary(gamm.model1b, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f1Zscore2 ~ toneBis.ord + s(measurement.no, bs = "cr") + s(measurement.no, 
    by = toneBis.ord, bs = "cr") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1, by = toneBis.ord) + s(measurement.no, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerPos, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, word, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordPos, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 3, m = 1)

Parametric coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)   0.26984    0.05890   4.581 4.68e-06 ***
toneBis.ord1 -0.48869    0.17880  -2.733  0.00628 ** 
toneBis.ord2  0.04083    0.09876   0.413  0.67933    
toneBis.ord3  0.04743    0.10469   0.453  0.65050    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
                                 edf Ref.df      F p-value    
s(measurement.no)              7.797  7.971 89.711 < 2e-16 ***
s(measurement.no):toneBis.ord1 1.001  1.001  0.028 0.86825    
s(measurement.no):toneBis.ord2 7.300  7.841  6.282 < 2e-16 ***
s(measurement.no):toneBis.ord3 4.857  5.606  3.375 0.00424 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.771   Deviance explained = 79.7%
fREML = 6300.4  Scale est. = 0.19144   n = 11198
gam.check(gamm.model1b)


Method: fREML   Optimizer: perf chol
$grad
 [1]  2.355005e-12 -8.137698e-05 -1.851852e-13  3.777201e-12 -4.923351e-11 -4.879585e-05 -4.059321e-05 -1.375344e-12 -1.144684e-11
[10]  4.327649e-13 -1.660183e-11 -8.174095e-05 -2.022915e-10 -9.237056e-14 -4.430824e-09  6.265921e-11  1.762146e-11  8.757439e-13
[19] -1.168843e-12 -4.153122e-12  1.362466e-11  2.014389e-12 -4.909594e-05 -7.184224e-05 -5.618617e-12 -4.156675e-13 -2.515321e-12
[28] -9.318935e-14 -1.172111e-10 -1.527667e-12 -1.002221e-10 -3.694822e-13 -8.341772e-11  2.131628e-12  7.228664e-09

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]          [,7]          [,8]          [,9]
   3.601137e+00 -1.658270e-06 -1.500839e-02  1.716137e-02 -1.741485e-01  3.548981e-09 -5.321124e-08  3.473436e-06  1.643944e-03
  -1.658270e-06  8.136709e-05 -1.838063e-07 -1.714651e-06 -1.636336e-05  6.046390e-13  6.116640e-10 -1.011945e-08  1.495573e-06
  -1.500839e-02 -1.838063e-07  2.403274e+00 -5.053821e-02  5.070324e-03  7.838185e-10  2.182950e-07 -2.199431e-05  2.457410e-01
   1.716137e-02 -1.714651e-06 -5.053821e-02  1.327189e+00  3.962985e-02  3.034273e-09 -2.925270e-07  2.361555e-05 -1.432663e-02
  -1.741485e-01 -1.636336e-05  5.070324e-03  3.962985e-02  2.792433e+01 -3.353338e-07  4.282282e-06  4.672041e-04 -1.212472e+00
   3.548981e-09  6.046390e-13  7.838185e-10  3.034273e-09 -3.353338e-07  4.879533e-05  2.739949e-12  2.360583e-07 -4.942857e-08
  -5.321124e-08  6.116640e-10  2.182950e-07 -2.925270e-07  4.282282e-06  2.739949e-12  4.059652e-05 -7.128441e-07  1.022340e-06
   3.473436e-06 -1.011945e-08 -2.199431e-05  2.361555e-05  4.672041e-04  2.360583e-07 -7.128441e-07  5.008349e-01  1.227562e-04
   1.643944e-03  1.495573e-06  2.457410e-01 -1.432663e-02 -1.212472e+00 -4.942857e-08  1.022340e-06  1.227562e-04  6.917649e+00
   9.266282e-05  2.602601e-08  2.938147e-06 -7.657451e-05 -9.745880e-03 -7.342619e-07 -3.708387e-09  5.635391e-03 -6.004610e-02
  -1.245482e-03  1.984711e-06 -1.753096e-02  7.855268e-02 -3.367306e-01  6.080004e-08  1.891240e-06  1.075790e-03 -2.398628e-01
  -3.946488e-09  9.956430e-12  5.023396e-08  1.086675e-07 -2.999885e-08 -1.065017e-10  5.175128e-12  6.647325e-07 -4.387100e-07
  -1.033129e-02  6.355302e-06  2.184217e-02 -9.237799e-03  1.315280e+00 -8.662127e-08 -3.163345e-06  8.143635e-04  9.635374e-02
  -6.065313e-04 -8.329858e-08  7.077922e-05  3.046692e-04 -1.218111e-02 -3.209553e-05  1.880704e-07 -1.875265e-02  1.082522e-03
  -1.499136e-03  1.307646e-05  2.590818e-05 -4.003726e-03  6.238301e-02  3.145407e-08  3.529904e-05 -4.962326e-03  1.221641e-02
   6.947661e-05  1.565759e-08  5.900104e-05  8.612800e-05 -2.437264e-03  4.886513e-08 -9.529832e-07  6.279609e-01 -1.414936e-03
  -2.059964e-03 -5.084830e-07  8.499699e-02 -2.962121e-03 -3.273709e-01 -7.513308e-08  3.511674e-07  1.090234e-03  1.247745e+00
  -1.448993e-04  7.859647e-08 -2.043263e-03 -3.757041e-05 -7.333375e-03 -8.696236e-07 -4.478908e-08 -2.364637e-02 -2.725987e-02
  -1.499063e-03  1.138373e-06  3.838135e-03 -7.183592e-02 -2.630463e-01  5.971007e-08  9.437760e-07  3.745483e-04 -6.939689e-02
   5.211523e-05  4.511044e-08 -2.021804e-04  2.152288e-03  1.353023e-06 -7.000572e-07  1.211288e-07  1.085302e-03 -4.970429e-03
  -2.301350e-02 -1.126469e-05  3.727947e-02  3.243855e-02  1.683618e+00 -2.668195e-08 -2.136182e-06 -1.819414e-03  7.800961e-03
   3.503530e-05  1.079398e-07  6.413040e-04  7.873861e-05  2.473793e-03 -4.365781e-06 -6.354947e-08 -5.576388e-02  1.063948e-04
  -1.247481e-07  2.822664e-10  1.996593e-09 -1.003524e-07  4.967523e-06  9.589899e-13  1.906920e-09 -2.507796e-07  2.899235e-07
   1.996622e-08  3.467387e-11  9.869884e-08  8.543162e-08  4.775805e-07 -8.137000e-13 -2.562308e-10  1.410154e-04  4.417038e-07
   1.076177e-03  1.410646e-06 -1.929480e-03  3.076541e-04 -1.363309e-01  2.090586e-09 -3.721350e-08  4.557519e-05  8.622472e-01
  -7.351581e-05  2.359124e-08 -2.959133e-04 -3.928286e-04 -4.541395e-03 -3.524666e-07 -8.837160e-09 -8.707878e-03 -2.388133e-02
   3.603762e-04  2.021176e-07 -1.234630e-02  5.645724e-02 -6.557462e-02  1.373248e-08  1.094486e-06 -1.760750e-05 -1.054830e-01
   1.862056e-06  4.629065e-10  7.085197e-06  2.393356e-05 -5.865257e-05 -6.675688e-09  1.568708e-09  1.067505e-04 -1.171516e-04
          [,10]         [,11]         [,12]         [,13]         [,14]         [,15]         [,16]         [,17]         [,18]
   9.266282e-05 -1.245482e-03 -3.946488e-09 -1.033129e-02 -6.065313e-04 -1.499136e-03  6.947661e-05 -2.059964e-03 -1.448993e-04
   2.602601e-08  1.984711e-06  9.956430e-12  6.355302e-06 -8.329858e-08  1.307646e-05  1.565759e-08 -5.084830e-07  7.859647e-08
   2.938147e-06 -1.753096e-02  5.023396e-08  2.184217e-02  7.077922e-05  2.590818e-05  5.900104e-05  8.499699e-02 -2.043263e-03
  -7.657451e-05  7.855268e-02  1.086675e-07 -9.237799e-03  3.046692e-04 -4.003726e-03  8.612800e-05 -2.962121e-03 -3.757041e-05
  -9.745880e-03 -3.367306e-01 -2.999885e-08  1.315280e+00 -1.218111e-02  6.238301e-02 -2.437264e-03 -3.273709e-01 -7.333375e-03
  -7.342619e-07  6.080004e-08 -1.065017e-10 -8.662127e-08 -3.209553e-05  3.145407e-08  4.886513e-08 -7.513308e-08 -8.696236e-07
  -3.708387e-09  1.891240e-06  5.175128e-12 -3.163345e-06  1.880704e-07  3.529904e-05 -9.529832e-07  3.511674e-07 -4.478908e-08
   5.635391e-03  1.075790e-03  6.647325e-07  8.143635e-04 -1.875265e-02 -4.962326e-03  6.279609e-01  1.090234e-03 -2.364637e-02
  -6.004610e-02 -2.398628e-01 -4.387100e-07  9.635374e-02  1.082522e-03  1.221641e-02 -1.414936e-03  1.247745e+00 -2.725987e-02
   8.126747e-01 -7.606616e-04 -6.675646e-06  1.379214e-04  9.499431e-02 -2.970089e-04  6.543495e-03 -1.462481e-02  3.983100e-01
  -7.606616e-04  2.283679e+00 -2.873409e-07 -1.081056e-01  8.082037e-03  2.508995e-02  1.768535e-03 -7.271369e-02 -8.990342e-04
  -6.675646e-06 -2.873409e-07  8.175851e-05 -1.262544e-07 -1.508594e-05  2.400389e-07 -2.629687e-06 -4.197506e-07 -1.503728e-05
   1.379214e-04 -1.081056e-01 -1.262544e-07  8.527338e+00 -8.190319e-02  3.099895e-01 -4.756327e-03  9.156217e-01  1.364860e-02
   9.499431e-02  8.082037e-03 -1.508594e-05 -8.190319e-02  6.810330e+00 -6.597013e-05 -1.737594e-01 -1.576030e-03  1.701012e+00
  -2.970089e-04  2.508995e-02  2.400389e-07  3.099895e-01 -6.597013e-05  1.711563e+00 -7.959894e-02 -3.956474e-02 -1.094120e-03
   6.543495e-03  1.768535e-03 -2.629687e-06 -4.756327e-03 -1.737594e-01 -7.959894e-02  3.001638e+00  2.267123e-03 -7.995519e-03
  -1.462481e-02 -7.271369e-02 -4.197506e-07  9.156217e-01 -1.576030e-03 -3.956474e-02  2.267123e-03  8.978132e+00 -1.249457e-01
   3.983100e-01 -8.990342e-04 -1.503728e-05  1.364860e-02  1.701012e+00 -1.094120e-03 -7.995519e-03 -1.249457e-01  5.481277e+00
  -5.167945e-04  1.058850e+00 -6.593845e-07 -2.320689e-01  3.083562e-03 -2.078027e-03 -1.177973e-04  1.202266e-01 -4.466178e-03
  -2.516821e-03  1.315711e-02  1.572683e-04  2.300866e-03 -3.890745e-01  5.075512e-03 -4.160621e-02 -3.156635e-03 -3.805164e-02
   3.228192e-03  9.070257e-02  4.847512e-07  5.198314e-01 -1.976906e-02  3.254096e-03 -5.663102e-03  1.563297e-01  1.833771e-03
  -2.204157e-02 -1.770631e-03  1.006857e-06 -1.535049e-02 -3.201078e-01 -1.873451e-03 -3.014200e-02 -2.601196e-03  1.484434e-01
  -9.378718e-09  9.070615e-07  4.952687e-12  4.974743e-06 -8.814002e-09  4.812767e-05 -1.516241e-06 -5.506462e-07 -7.372308e-08
  -5.549307e-08  3.236098e-07  3.137854e-10  4.611403e-07 -3.508587e-05 -6.267245e-06  2.206592e-04  4.656689e-07  5.278224e-07
  -9.744508e-03 -3.928118e-02 -1.773240e-07  9.325692e-02  4.847993e-03  4.869862e-05  2.720506e-04  1.107136e+00 -2.082365e-03
   2.941717e-01  1.252069e-04 -1.045957e-06 -2.191842e-04 -4.032050e-02  7.991828e-04 -3.501802e-02 -1.646201e-02 -3.063455e-02
  -3.146631e-04  1.013963e+00  5.164392e-07  4.364294e-02  7.812063e-04  5.944861e-03  3.862983e-04 -3.819058e-02 -1.699113e-03
  -4.770183e-04 -2.733978e-04  2.080351e-06 -3.624303e-05  4.232058e-03  7.185098e-05 -1.942619e-04 -8.952064e-05 -1.754698e-03
          [,19]         [,20]         [,21]         [,22]         [,23]         [,24]         [,25]         [,26]         [,27]
  -1.499063e-03  5.211523e-05 -2.301350e-02  3.503530e-05 -1.247481e-07  1.996622e-08  1.076177e-03 -7.351581e-05  3.603762e-04
   1.138373e-06  4.511044e-08 -1.126469e-05  1.079398e-07  2.822664e-10  3.467387e-11  1.410646e-06  2.359124e-08  2.021176e-07
   3.838135e-03 -2.021804e-04  3.727947e-02  6.413040e-04  1.996593e-09  9.869884e-08 -1.929480e-03 -2.959133e-04 -1.234630e-02
  -7.183592e-02  2.152288e-03  3.243855e-02  7.873861e-05 -1.003524e-07  8.543162e-08  3.076541e-04 -3.928286e-04  5.645724e-02
  -2.630463e-01  1.353023e-06  1.683618e+00  2.473793e-03  4.967523e-06  4.775805e-07 -1.363309e-01 -4.541395e-03 -6.557462e-02
   5.971007e-08 -7.000572e-07 -2.668195e-08 -4.365781e-06  9.589899e-13 -8.137000e-13  2.090586e-09 -3.524666e-07  1.373248e-08
   9.437760e-07  1.211288e-07 -2.136182e-06 -6.354947e-08  1.906920e-09 -2.562308e-10 -3.721350e-08 -8.837160e-09  1.094486e-06
   3.745483e-04  1.085302e-03 -1.819414e-03 -5.576388e-02 -2.507796e-07  1.410154e-04  4.557519e-05 -8.707878e-03 -1.760750e-05
  -6.939689e-02 -4.970429e-03  7.800961e-03  1.063948e-04  2.899235e-07  4.417038e-07  8.622472e-01 -2.388133e-02 -1.054830e-01
  -5.167945e-04 -2.516821e-03  3.228192e-03 -2.204157e-02 -9.378718e-09 -5.549307e-08 -9.744508e-03  2.941717e-01 -3.146631e-04
   1.058850e+00  1.315711e-02  9.070257e-02 -1.770631e-03  9.070615e-07  3.236098e-07 -3.928118e-02  1.252069e-04  1.013963e+00
  -6.593845e-07  1.572683e-04  4.847512e-07  1.006857e-06  4.952687e-12  3.137854e-10 -1.773240e-07 -1.045957e-06  5.164392e-07
  -2.320689e-01  2.300866e-03  5.198314e-01 -1.535049e-02  4.974743e-06  4.611403e-07  9.325692e-02 -2.191842e-04  4.364294e-02
   3.083562e-03 -3.890745e-01 -1.976906e-02 -3.201078e-01 -8.814002e-09 -3.508587e-05  4.847993e-03 -4.032050e-02  7.812063e-04
  -2.078027e-03  5.075512e-03  3.254096e-03 -1.873451e-03  4.812767e-05 -6.267245e-06  4.869862e-05  7.991828e-04  5.944861e-03
  -1.177973e-04 -4.160621e-02 -5.663102e-03 -3.014200e-02 -1.516241e-06  2.206592e-04  2.720506e-04 -3.501802e-02  3.862983e-04
   1.202266e-01 -3.156635e-03  1.563297e-01 -2.601196e-03 -5.506462e-07  4.656689e-07  1.107136e+00 -1.646201e-02 -3.819058e-02
  -4.466178e-03 -3.805164e-02  1.833771e-03  1.484434e-01 -7.372308e-08  5.278224e-07 -2.082365e-03 -3.063455e-02 -1.699113e-03
   3.050479e+00  8.247993e-02 -2.082275e-02  1.275849e-03 -5.567415e-07  2.037004e-07 -4.574614e-03  1.482445e-03  3.809748e-01
   8.247993e-02  6.647249e+00 -2.112107e-03  3.854187e-02  4.188705e-08  1.618703e-05 -2.676884e-04  7.951103e-04 -7.995715e-03
  -2.082275e-02 -2.112107e-03  1.304513e+01  1.916612e-02  4.560937e-06  5.387971e-06  3.823348e-01 -1.507341e-03  4.830968e-01
   1.275849e-03  3.854187e-02  1.916612e-02  4.109909e+00  4.683115e-07 -5.331128e-05 -1.366595e-04 -3.264444e-01 -1.391543e-03
  -5.567415e-07  4.188705e-08  4.560937e-06  4.683115e-07  4.909899e-05 -6.918195e-10 -4.324559e-07  2.538614e-08 -4.871085e-08
   2.037004e-07  1.618703e-05  5.387971e-06 -5.331128e-05 -6.918195e-10  7.201659e-05  4.082391e-07 -1.800783e-05 -5.573377e-07
  -4.574614e-03 -2.676884e-04  3.823348e-01 -1.366595e-04 -4.324559e-07  4.082391e-07  1.542742e+00 -7.014322e-02 -7.428371e-02
   1.482445e-03  7.951103e-04 -1.507341e-03 -3.264444e-01  2.538614e-08 -1.800783e-05 -7.014322e-02  1.942995e+00  4.301125e-04
   3.809748e-01 -7.995715e-03  4.830968e-01 -1.391543e-03 -4.871085e-08 -5.573377e-07 -7.428371e-02  4.301125e-04  1.932947e+00
   6.335997e-05  1.730895e-02  2.780325e-04  3.992384e-03  2.957308e-09  1.889700e-07 -2.844252e-05 -3.138603e-04  1.387570e-03
          [,28]         [,29]         [,30]         [,31]         [,32]         [,33]         [,34]         [,35]
   1.862056e-06  1.224010e-02 -1.534033e-03 -1.034786e-03 -2.553204e-04  1.583492e-02 -5.814198e-04 -3.398287e+00
   4.629065e-10 -1.408013e-05  4.747407e-07 -3.288173e-06  2.103919e-07 -6.468130e-06  2.184187e-07 -1.770537e-04
   7.085197e-06 -4.184055e-03 -4.935098e-03 -4.154366e-03 -5.556190e-04 -7.116186e-03 -2.383510e-04 -3.149811e+00
   2.393356e-05 -2.630989e-02 -2.349461e-03 -9.347061e-03 -1.662483e-03  2.355889e-02 -6.160756e-04 -1.928526e+00
  -5.865257e-05  1.106368e-01 -2.181461e-02  3.241771e-02 -2.806085e-03 -3.091672e-02 -1.624398e-03 -3.279171e+01
  -6.675688e-09 -3.967256e-08  1.452411e-06  4.751684e-08 -9.941705e-08 -9.451054e-08 -2.870830e-09 -1.216870e-05
   1.568708e-09 -7.555576e-06  4.712337e-08  3.644105e-06 -8.158573e-08 -1.148077e-06 -3.064838e-08 -2.522826e-04
   1.067505e-04 -7.463498e-04  3.216701e-02  1.180157e-03 -1.304944e-02 -1.377268e-03 -6.056157e-02 -1.383545e+00
  -1.171516e-04  3.327595e-01 -9.691961e-03  6.433185e-02  1.126673e-03  3.686700e-01 -1.606973e-02 -1.566177e+01
  -4.770183e-04  6.047906e-03 -2.688093e-02  1.954468e-03 -1.923574e-03  6.194074e-03  7.054727e-02 -1.959279e+00
  -2.733978e-04 -8.459636e-02  1.046164e-02  1.196766e-01 -1.404408e-02 -6.377852e-02  6.315453e-03 -8.971754e+00
   2.080351e-06  4.401494e-07 -5.520421e-05 -7.427578e-07  2.978219e-05  8.652885e-07 -6.137451e-06 -2.826292e-04
  -3.624303e-05  9.323632e-01  4.698917e-03  5.625916e-01  4.619305e-03  3.012858e+00 -6.138344e-03 -3.764725e+01
   4.232058e-03  4.373885e-02  3.747390e+00  1.127466e-02  1.083238e+00  4.967543e-02  5.568526e+00 -2.271341e+01
   7.185098e-05  1.289479e-01  3.037234e-03  1.433014e-01  3.544926e-04  6.865017e-02 -1.403029e-03 -8.711404e+00
  -1.942619e-04 -3.758715e-04 -4.129769e-02 -9.751264e-04 -9.994131e-02  5.227153e-03  2.487336e-02 -5.281231e+00
  -8.952064e-05  5.665497e-01 -5.547123e-03  3.485268e-02  2.457342e-03  1.102789e+00 -1.143414e-04 -3.549148e+01
  -1.754698e-03  8.422340e-04 -5.197211e-01 -6.649523e-03 -5.139187e-01 -3.612642e-02 -4.957946e-01 -1.203109e+01
   6.335997e-05  1.111576e-01  9.646000e-03  3.378472e-01 -5.855717e-03 -2.432590e-02  3.665522e-03 -1.662720e+01
   1.730895e-02  9.250286e-03 -6.560844e-01 -1.824690e-04  9.562812e-03 -1.831421e-02 -6.251386e-01 -9.175892e+00
   2.780325e-04  9.945617e-02  9.242423e-03  3.256043e-02 -1.061381e-02  3.016209e-01 -9.741670e-03 -3.164751e+01
   3.992384e-03  2.645248e-03  1.127626e-01  5.492350e-03 -5.203557e-01 -4.624418e-03  2.827055e-02 -6.367651e+00
   2.957308e-09  6.934881e-06  9.372916e-08  1.130848e-05 -1.215490e-07  4.211097e-06 -7.804410e-08 -3.477411e-04
   1.889700e-07 -1.149069e-06  2.028897e-05  3.436174e-07  3.525361e-06 -6.453213e-06  1.122015e-04 -1.092900e-03
  -2.844252e-05  1.292142e-01  2.840407e-03  4.025624e-02 -3.553123e-03  2.960472e-01 -1.347774e-02 -1.136728e+01
  -3.138603e-04  4.838612e-03  1.321379e-02 -5.882335e-03  1.735786e-02  1.155861e-02 -9.853477e-02 -5.040649e+00
   1.387570e-03  2.223193e-01  1.340519e-03  1.920210e-01  1.640177e-02  2.777977e-01 -6.187345e-03 -1.184315e+01
   2.078162e-03 -3.044769e-05 -1.032302e-03  7.814940e-04  1.162611e-02  3.874255e-04  8.491506e-03 -1.115762e-01
 [ getOption("max.print") est atteint -- 7 lignes omises ]

Model rank =  6427 / 6427 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                          k'      edf k-index p-value
s(measurement.no)                                   9.00e+00 7.80e+00    1.01    0.77
s(measurement.no):toneBis.ord1                      9.00e+00 1.00e+00    1.01    0.71
s(measurement.no):toneBis.ord2                      9.00e+00 7.30e+00    1.01    0.72
s(measurement.no):toneBis.ord3                      9.00e+00 4.86e+00    1.01    0.71
s(measurement.no,speaker)                           1.00e+02 6.56e+01    1.01    0.74
s(measurement.no,speaker):toneBis.ord1              1.00e+02 2.77e+00    1.01    0.78
s(measurement.no,speaker):toneBis.ord2              1.00e+02 3.52e+01    1.01    0.73
s(measurement.no,speaker):toneBis.ord3              1.00e+02 1.79e+01    1.01    0.69
s(measurement.no,speakerLeftRightTone)              5.90e+02 1.21e+02    1.01    0.69
s(measurement.no,speakerLeftRightTone):toneBis.ord1 5.90e+02 2.80e+01    1.01    0.68
s(measurement.no,speakerLeftRightTone):toneBis.ord2 5.90e+02 9.50e+01    1.01    0.73
s(measurement.no,speakerLeftRightTone):toneBis.ord3 5.90e+02 5.16e+01    1.01    0.74
s(measurement.no,speakerPos)                        3.00e+02 7.60e+01    1.01    0.78
s(measurement.no,speakerPos):toneBis.ord1           3.00e+02 3.12e-03    1.01    0.70
s(measurement.no,speakerPos):toneBis.ord2           3.00e+02 3.28e+01    1.01    0.78
s(measurement.no,speakerPos):toneBis.ord3           3.00e+02 2.39e+01    1.01    0.72
s(measurement.no,word)                              6.15e+02 2.59e+02    1.01    0.75
s(measurement.no,wordPos)                           9.33e+02 1.71e+02    1.01    0.76
s(measurement.no,wordLeftRightTone)                 8.79e+02 2.80e+02    1.01    0.76

# Plotting
# Normalized scale

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1b, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", ylim = c(-1, 1), lwd = 4, xlab = "Time (normalized)", ylab = "F1 (Z)", xaxt = "n", font.lab = 2)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1b, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1b, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1b, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
legend("topright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

# Plotting
# Resconstructed scale
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1b, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", ylim = c(500, 1000), xlab = "Time (ms)", ylab = "F1 (Hz)", xaxt = "n", font.lab = 2, add = F, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT2f * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1f + global_mean1f, hide.label = TRUE)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1b, view="measurement.no",
             rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", lwd = 4, add = T, transform.view = function(measurement.no) measurement.no * durationT1f * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1f + global_mean1f)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1b, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT4f * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1f + global_mean1f)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1b, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT3f * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1f + global_mean1f)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
legend("topright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

# Plotting
# Diffrence plot between tones
par(mfcol = c(2, 3), mar = c(2, 2, 2, 1), oma = c(4, 4, 2, 1)) 
plot_diff(gamm.model1b, view="measurement.no", comp=list(toneBis.ord = c("1","2")),rm.ranef=TRUE, main = "1-2", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.000000 - 7.575758
#axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1b, view="measurement.no",comp=list(toneBis.ord = c("1","3")),rm.ranef=TRUE, main = "1-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    1.010101 - 9.494949
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1b, view="measurement.no",comp=list(toneBis.ord = c("1","4")),rm.ranef=TRUE, main = "1-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.000000 - 10.000000
#axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1b, view="measurement.no",comp=list(toneBis.ord = c("2","3")),rm.ranef=TRUE, main = "2-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.707071 - 1.111111
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1b, view="measurement.no",comp=list(toneBis.ord = c("2","4")),rm.ranef=TRUE, main = "2-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.505051 - 2.222222
#axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1b, view="measurement.no",comp=list(toneBis.ord = c("3","4")),rm.ranef=TRUE, main = "3-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
mtext("Difference in F1 (Z)", side = 2, outer = TRUE, line = 2.5, cex = 1.2, font = 2)
mtext("Time (normalized)", side = 1, outer = TRUE, line = 2.5, cex = 1.2, font = 2)

plot_parametric(gamm.model1b, pred = list(toneBis.ord=c("1", "2", "3", "4")), main = "Tone", xlab = "F1 (Z)")
Summary:
    * toneBis.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; set to the value(s): 5. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Model 1C: /au/ male, F1 as output


gamm.model1c.noAR <- bam(f1Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                          
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                        
                      data=data.au.mas, method="fREML", discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1c.noAR, paste("Gamm_model1c_noAR.rds"))
gamm.model1c.noAR <- 
  readRDS("Gamm_model1c_noAR.rds")
r.gamm.model1c <- start_value_rho(gamm.model1c.noAR)
# Auto-regressive model

gamm.model1c <- bam(f1Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                        
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                        
                      data=data.au.mas, method="fREML", rho = r.gamm.model1c, AR.start = data.au.mas$start, discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1c, paste("Gamm_model1c.rds"))
gamm.model1c <- 
  readRDS("Gamm_model1c.rds")
summary(gamm.model1c, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f1Zscore2 ~ toneBis.ord + s(measurement.no, bs = "cr") + s(measurement.no, 
    by = toneBis.ord, bs = "cr") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1, by = toneBis.ord) + s(measurement.no, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerPos, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, word, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordPos, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 3, m = 1)

Parametric coefficients:
              Estimate Std. Error t value Pr(>|t|)    
(Intercept)   0.060211   0.055331   1.088 0.276537    
toneBis.ord1 -0.442326   0.091890  -4.814 1.51e-06 ***
toneBis.ord2  0.006794   0.091474   0.074 0.940793    
toneBis.ord3  0.312667   0.081333   3.844 0.000122 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
                                 edf Ref.df      F p-value    
s(measurement.no)              7.670  8.032 64.474  <2e-16 ***
s(measurement.no):toneBis.ord1 3.091  3.802  2.286  0.0513 .  
s(measurement.no):toneBis.ord2 1.000  1.000  2.899  0.0887 .  
s(measurement.no):toneBis.ord3 3.533  4.096  2.729  0.0266 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.657   Deviance explained = 70.9%
fREML =  10543  Scale est. = 0.32426   n = 10857
gam.check(gamm.model1c)


Method: fREML   Optimizer: perf chol
$grad
 [1]  9.681145e-14 -1.776357e-14 -5.014119e-05 -1.232348e-13  0.000000e+00
 [6] -4.773879e-05 -9.651113e-05 -4.919213e-05 -7.603781e-05 -9.746363e-05
[11] -9.508623e-05 -9.405792e-05 -3.765876e-13 -2.202682e-13  3.046452e-13
[16] -1.048051e-13  1.376677e-13 -9.797667e-05  1.705303e-13 -2.309264e-14
[21]  6.750156e-14 -5.329071e-14  4.618528e-14  4.973799e-14  7.105427e-15
[26] -4.810617e-05  1.456613e-13  1.127987e-13  7.105427e-14  1.037392e-12
[31]  3.410605e-13  4.263256e-13  3.694822e-13 -1.989520e-13  4.547474e-12

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]
   3.462193e+00 -1.137325e-02  2.190058e-06  4.961225e-02 -3.299671e-02
  -1.137325e-02  7.165497e-01  8.770145e-06 -8.565477e-03 -3.409280e-02
   2.190058e-06  8.770145e-06  5.015151e-05 -1.162515e-06  6.877865e-06
   4.961225e-02 -8.565477e-03 -1.162515e-06  5.975867e-01 -1.085729e-02
  -3.299671e-02 -3.409280e-02  6.877865e-06 -1.085729e-02  1.136755e+01
   3.034639e-10  3.928110e-09 -8.786020e-12 -1.070045e-08 -1.040605e-07
  -1.601364e-06  4.405821e-06 -1.388045e-10  9.489704e-07  1.266081e-05
  -1.059766e-07  2.557979e-07  3.015069e-11 -2.866613e-08 -4.021332e-06
  -1.905974e-07  6.709955e-07  3.691683e-10  6.375498e-07  1.595450e-05
  -6.461417e-09 -3.339083e-09 -3.010039e-11  7.812958e-09  4.948893e-08
   1.658825e-06  2.316011e-07  1.950866e-10  1.054927e-05 -3.005954e-05
  -1.185780e-08  8.986651e-08 -2.662848e-11 -1.803007e-07  2.231221e-06
  -3.902424e-02  3.928589e-02 -1.283390e-05  1.435327e-03  2.311166e+00
  -1.084292e-03  7.067769e-05  9.671237e-09 -6.501510e-04 -1.721403e-03
  -2.301347e-03  2.187482e-02 -4.970189e-08  2.126738e-03  1.201095e-02
  -8.358042e-05  1.642326e-04  1.237021e-08 -9.268128e-06  1.168928e-03
  -6.800272e-03  1.899594e-03 -4.565243e-06  1.394357e-02  1.095966e-01
  -2.752269e-11  2.697647e-09 -2.787166e-12  4.287188e-09  4.705936e-08
   4.770773e-02  1.085158e-02 -2.860897e-07  1.282609e-01 -6.229080e-01
  -1.977190e-04  2.066826e-04 -3.862087e-08 -7.248829e-04  3.348742e-03
  -1.343996e-02 -1.933901e-03  2.930288e-06  7.188260e-03  1.661145e+00
  -4.175626e-05 -2.101576e-04 -8.880872e-09  2.622473e-05  7.348834e-04
  -9.111643e-03  6.695449e-02 -1.554034e-06  5.871734e-03  3.604937e-02
  -6.853272e-05  2.821799e-04 -1.037149e-08  9.065814e-07 -3.353190e-04
  -7.935187e-03  1.563530e-02 -2.224423e-06  2.513018e-02  3.115543e-01
   2.606433e-10  1.204878e-09  6.592714e-13  1.075133e-09 -1.999768e-09
   6.499681e-03 -4.337589e-03  2.201209e-06  1.410892e-02 -6.364897e-02
  -1.745212e-05  1.488390e-04 -1.441488e-07  1.126533e-04  1.484850e-03
           [,6]          [,7]          [,8]          [,9]         [,10]
   3.034639e-10 -1.601364e-06 -1.059766e-07 -1.905974e-07 -6.461417e-09
   3.928110e-09  4.405821e-06  2.557979e-07  6.709955e-07 -3.339083e-09
  -8.786020e-12 -1.388045e-10  3.015069e-11  3.691683e-10 -3.010039e-11
  -1.070045e-08  9.489704e-07 -2.866613e-08  6.375498e-07  7.812958e-09
  -1.040605e-07  1.266081e-05 -4.021332e-06  1.595450e-05  4.948893e-08
   4.774418e-05 -9.201469e-12 -2.021643e-08 -4.675430e-12 -2.882737e-10
  -9.201469e-12  9.652650e-05  2.090843e-09 -1.368250e-10 -2.544260e-12
  -2.021643e-08  2.090843e-09  6.114258e-05 -2.836031e-10 -5.151366e-09
  -4.675430e-12 -1.368250e-10 -2.836031e-10  7.604259e-05 -2.826756e-11
  -2.882737e-10 -2.544260e-12 -5.151366e-09 -2.826756e-11  9.746247e-05
  -4.152255e-12  2.043134e-10  2.765375e-11  6.381021e-11  4.434396e-13
  -1.277243e-08 -5.635538e-11  2.693756e-08  1.804706e-11  1.665822e-09
  -3.138625e-07  2.727351e-06 -1.025585e-05  5.034014e-06 -8.896769e-09
   5.485718e-05 -1.151871e-07 -6.720659e-04  2.549189e-07 -5.043191e-06
   9.626930e-09  2.978077e-05  1.308316e-06 -1.200650e-07 -1.296528e-08
  -4.752375e-06  5.296669e-07  2.028409e-03  1.479344e-07  1.014107e-06
  -3.464066e-08 -1.244823e-07 -1.655263e-06  3.196528e-05 -5.554128e-08
  -1.709127e-10 -6.774337e-13  1.289242e-10 -2.199913e-12 -5.180392e-10
  -3.956074e-08  1.627322e-06 -7.930093e-07  2.448632e-06  2.185791e-07
  -9.762976e-06 -5.757055e-08  2.384311e-04 -4.479960e-07  3.398476e-07
  -3.937988e-08  7.578434e-06  2.148657e-06  4.615502e-06 -4.308363e-08
   2.890917e-05 -1.242873e-07  2.482589e-05 -2.224812e-07  3.752938e-06
  -6.445434e-08  1.026974e-04  4.622120e-06 -1.045842e-06 -4.062828e-08
  -4.377071e-06  2.009601e-07  4.006969e-03 -1.215765e-08 -2.975014e-06
   1.865849e-07 -4.243435e-06 -6.480917e-06  1.123289e-04  3.419304e-07
  -4.865325e-11  7.665352e-14 -1.229003e-09 -4.183841e-12 -4.160150e-10
  -3.788359e-08  1.781038e-06 -5.354775e-07  1.069530e-06  3.881944e-08
  -3.247099e-06 -5.826576e-08  6.727364e-06  1.530749e-07  2.737885e-06
          [,11]         [,12]         [,13]         [,14]         [,15]
   1.658825e-06 -1.185780e-08 -3.902424e-02 -1.084292e-03 -2.301347e-03
   2.316011e-07  8.986651e-08  3.928589e-02  7.067769e-05  2.187482e-02
   1.950866e-10 -2.662848e-11 -1.283390e-05  9.671237e-09 -4.970189e-08
   1.054927e-05 -1.803007e-07  1.435327e-03 -6.501510e-04  2.126738e-03
  -3.005954e-05  2.231221e-06  2.311166e+00 -1.721403e-03  1.201095e-02
  -4.152255e-12 -1.277243e-08 -3.138625e-07  5.485718e-05  9.626930e-09
   2.043134e-10 -5.635538e-11  2.727351e-06 -1.151871e-07  2.978077e-05
   2.765375e-11  2.693756e-08 -1.025585e-05 -6.720659e-04  1.308316e-06
   6.381021e-11  1.804706e-11  5.034014e-06  2.549189e-07 -1.200650e-07
   4.434396e-13  1.665822e-09 -8.896769e-09 -5.043191e-06 -1.296528e-08
   9.509938e-05 -3.973733e-10  2.038503e-06 -1.961299e-07  1.149578e-07
  -3.973733e-10  9.524929e-05  3.431335e-06 -1.703278e-04 -2.878891e-08
   2.038503e-06  3.431335e-06  2.001702e+01  1.743489e-02 -4.870241e-02
  -1.961299e-07 -1.703278e-04  1.743489e-02  9.366168e+00  5.405320e-04
   1.149578e-07 -2.878891e-08 -4.870241e-02  5.405320e-04  6.505597e-01
   4.186410e-08  1.575130e-05 -1.206872e-03 -6.586277e-01 -1.409563e-03
   1.077729e-06 -1.290375e-06  5.231005e-02 -1.088053e-03  5.937920e-03
   6.584054e-13  1.675771e-10  2.583869e-08 -6.508741e-06 -1.546145e-09
   1.977680e-04 -1.017408e-05  6.595814e-01 -7.083191e-03 -3.142783e-02
  -5.695386e-07  1.129604e-03 -3.413994e-03  3.122517e-01 -1.108743e-04
  -1.531934e-06 -7.510140e-08  1.163879e+00  2.002509e-03  7.062957e-02
  -6.565319e-08 -8.537799e-05 -7.451213e-03  2.989293e-01  3.930083e-04
   1.311150e-07 -2.898343e-07  3.627772e-01 -2.117975e-03  4.955032e-01
   1.571743e-08  2.503284e-05 -2.175810e-03 -1.405529e-01  1.248606e-03
   2.935498e-06  8.654007e-08  8.892519e-02  7.448568e-03  1.048710e-03
   2.721495e-13  3.098299e-10  3.447925e-08 -2.874961e-06  1.095669e-09
   4.176235e-05 -3.425326e-07 -9.770851e-02 -2.060665e-04 -9.758117e-03
  -9.798108e-08  3.428581e-04  1.557291e-03  4.989887e-02 -1.606503e-04
          [,16]         [,17]         [,18]         [,19]         [,20]
  -8.358042e-05 -6.800272e-03 -2.752269e-11  4.770773e-02 -1.977190e-04
   1.642326e-04  1.899594e-03  2.697647e-09  1.085158e-02  2.066826e-04
   1.237021e-08 -4.565243e-06 -2.787166e-12 -2.860897e-07 -3.862087e-08
  -9.268128e-06  1.394357e-02  4.287188e-09  1.282609e-01 -7.248829e-04
   1.168928e-03  1.095966e-01  4.705936e-08 -6.229080e-01  3.348742e-03
  -4.752375e-06 -3.464066e-08 -1.709127e-10 -3.956074e-08 -9.762976e-06
   5.296669e-07 -1.244823e-07 -6.774337e-13  1.627322e-06 -5.757055e-08
   2.028409e-03 -1.655263e-06  1.289242e-10 -7.930093e-07  2.384311e-04
   1.479344e-07  3.196528e-05 -2.199913e-12  2.448632e-06 -4.479960e-07
   1.014107e-06 -5.554128e-08 -5.180392e-10  2.185791e-07  3.398476e-07
   4.186410e-08  1.077729e-06  6.584054e-13  1.977680e-04 -5.695386e-07
   1.575130e-05 -1.290375e-06  1.675771e-10 -1.017408e-05  1.129604e-03
  -1.206872e-03  5.231005e-02  2.583869e-08  6.595814e-01 -3.413994e-03
  -6.586277e-01 -1.088053e-03 -6.508741e-06 -7.083191e-03  3.122517e-01
  -1.409563e-03  5.937920e-03 -1.546145e-09 -3.142783e-02 -1.108743e-04
   4.192710e+00  6.599362e-04  2.120674e-06  1.157587e-03  1.268524e-02
   6.599362e-04  8.007949e-01  2.794845e-07  1.022589e-01 -5.110197e-03
   2.120674e-06  2.794845e-07  9.797595e-05  1.679006e-07 -3.336018e-06
   1.157587e-03  1.022589e-01  1.679006e-07  2.964601e+01 -1.000070e-01
   1.268524e-02 -5.110197e-03 -3.336018e-06 -1.000070e-01  6.707622e+00
   1.162798e-03  4.974677e-02 -5.655830e-08  3.990149e-02  1.852905e-03
   9.161272e-02 -2.647663e-04  1.672484e-06 -5.343230e-04 -1.718423e-01
   3.697365e-03 -8.676228e-04 -2.151922e-08  4.815307e-02 -8.109850e-04
   9.639966e-01 -2.523207e-04 -1.551930e-06 -1.788876e-03  1.798271e-01
   2.689088e-03  1.339327e+00  3.882685e-07  3.013415e-01 -1.339314e-02
   2.781406e-07  9.935389e-08 -3.532816e-10  4.373562e-08  8.008443e-08
   6.341571e-04  1.611548e-02 -1.690358e-08  1.243523e+00 -1.617912e-03
   5.026723e-02  1.216896e-03  1.071718e-06 -3.335378e-03  8.666964e-01
          [,21]         [,22]         [,23]         [,24]         [,25]
  -1.343996e-02 -4.175626e-05 -9.111643e-03 -6.853272e-05 -7.935187e-03
  -1.933901e-03 -2.101576e-04  6.695449e-02  2.821799e-04  1.563530e-02
   2.930288e-06 -8.880872e-09 -1.554034e-06 -1.037149e-08 -2.224423e-06
   7.188260e-03  2.622473e-05  5.871734e-03  9.065814e-07  2.513018e-02
   1.661145e+00  7.348834e-04  3.604937e-02 -3.353190e-04  3.115543e-01
  -3.937988e-08  2.890917e-05 -6.445434e-08 -4.377071e-06  1.865849e-07
   7.578434e-06 -1.242873e-07  1.026974e-04  2.009601e-07 -4.243435e-06
   2.148657e-06  2.482589e-05  4.622120e-06  4.006969e-03 -6.480917e-06
   4.615502e-06 -2.224812e-07 -1.045842e-06 -1.215765e-08  1.123289e-04
  -4.308363e-08  3.752938e-06 -4.062828e-08 -2.975014e-06  3.419304e-07
  -1.531934e-06 -6.565319e-08  1.311150e-07  1.571743e-08  2.935498e-06
  -7.510140e-08 -8.537799e-05 -2.898343e-07  2.503284e-05  8.654007e-08
   1.163879e+00 -7.451213e-03  3.627772e-01 -2.175810e-03  8.892519e-02
   2.002509e-03  2.989293e-01 -2.117975e-03 -1.405529e-01  7.448568e-03
   7.062957e-02  3.930083e-04  4.955032e-01  1.248606e-03  1.048710e-03
   1.162798e-03  9.161272e-02  3.697365e-03  9.639966e-01  2.689088e-03
   4.974677e-02 -2.647663e-04 -8.676228e-04 -2.523207e-04  1.339327e+00
  -5.655830e-08  1.672484e-06 -2.151922e-08 -1.551930e-06  3.882685e-07
   3.990149e-02 -5.343230e-04  4.815307e-02 -1.788876e-03  3.013415e-01
   1.852905e-03 -1.718423e-01 -8.109850e-04  1.798271e-01 -1.339314e-02
   5.918355e+00  1.942569e-03  3.829888e-01  1.545561e-03  7.380914e-03
   1.942569e-03  6.570015e+00  1.604866e-03 -4.767542e-02  1.001515e-02
   3.829888e-01  1.604866e-03  3.092613e+00 -1.530331e-02 -2.120323e-02
   1.545561e-03 -4.767542e-02 -1.530331e-02  4.062483e+00 -3.936288e-03
   7.380914e-03  1.001515e-02 -2.120323e-02 -3.936288e-03  1.052413e+01
  -1.491648e-08 -1.523000e-06 -9.188110e-10 -2.616709e-07  7.457004e-08
   1.600251e-02 -1.859622e-03 -2.002501e-02 -4.062657e-07  5.812132e-02
   1.443970e-03  3.468851e-02 -1.473467e-03  1.383896e-01  7.312562e-03
          [,26]         [,27]         [,28]         [,29]         [,30]
   2.606433e-10  6.499681e-03 -1.745212e-05 -1.669524e-02 -6.842249e-05
   1.204878e-09 -4.337589e-03  1.488390e-04  4.834621e-02  2.880422e-04
   6.592714e-13  2.201209e-06 -1.441488e-07 -7.018557e-06 -1.224287e-07
   1.075133e-09  1.410892e-02  1.126533e-04  5.311030e-03 -1.395670e-04
  -1.999768e-09 -6.364897e-02  1.484850e-03 -3.492194e-02 -1.918000e-04
  -4.865325e-11 -3.788359e-08 -3.247099e-06  2.241967e-10 -2.302079e-06
   7.665352e-14  1.781038e-06 -5.826576e-08  1.978920e-05 -9.588048e-09
  -1.229003e-09 -5.354775e-07  6.727364e-06  6.768032e-06 -2.782608e-04
  -4.183841e-12  1.069530e-06  1.530749e-07 -2.616508e-06  1.061744e-07
  -4.160150e-10  3.881944e-08  2.737885e-06 -2.672274e-08  1.133633e-06
   2.721495e-13  4.176235e-05 -9.798108e-08 -1.711964e-06 -8.437386e-08
   3.098299e-10 -3.425326e-07  3.428581e-04  8.893011e-07  5.857168e-05
   3.447925e-08 -9.770851e-02  1.557291e-03  1.586671e+00 -3.409431e-04
  -2.874961e-06 -2.060665e-04  4.989887e-02 -5.537058e-03  1.463651e-01
   1.095669e-09 -9.758117e-03 -1.606503e-04  6.908516e-02 -4.340261e-04
   2.781406e-07  6.341571e-04  5.026723e-02 -3.398816e-03 -4.013640e-02
   9.935389e-08  1.611548e-02  1.216896e-03  2.046038e-01 -1.286860e-04
  -3.532816e-10 -1.690358e-08  1.071718e-06 -2.787125e-08 -3.605416e-06
   4.373562e-08  1.243523e+00 -3.335378e-03  1.165285e+00  2.881074e-05
   8.008443e-08 -1.617912e-03  8.666964e-01  3.878495e-03 -5.850941e-03
  -1.491648e-08  1.600251e-02  1.443970e-03 -3.627841e-02 -1.818683e-05
  -1.523000e-06 -1.859622e-03  3.468851e-02  6.373469e-04 -1.267363e-01
  -9.188110e-10 -2.002501e-02 -1.473467e-03  1.934407e-01 -4.226946e-05
  -2.616709e-07 -4.062657e-07  1.383896e-01  5.182333e-04 -4.928362e-02
   7.457004e-08  5.812132e-02  7.312562e-03  3.106654e-01 -2.499850e-03
   4.810591e-05 -1.994496e-08 -2.579624e-08 -1.967350e-09 -1.210182e-06
  -1.994496e-08  2.421344e+00 -9.417563e-03  3.523924e-02 -8.187868e-04
  -2.579624e-08 -9.417563e-03  1.815132e+00  1.200168e-03  6.309525e-02
          [,31]         [,32]         [,33]         [,34]         [,35]
  -7.692942e-03  3.536344e-05 -7.395802e-03 -1.103745e-03 -3.334809e+00
   6.522554e-03  2.700369e-05  3.033396e-02  1.087881e-03 -1.045698e+00
  -4.522978e-06  6.144557e-08  1.476941e-05  5.821859e-08 -8.303867e-05
  -1.229322e-02  5.245256e-05 -2.802305e-02 -7.220352e-04 -1.266666e+00
  -9.375976e-02 -1.558337e-03 -5.439919e-02 -3.417869e-04 -1.923601e+01
   4.555519e-08 -9.834699e-06 -2.230898e-07 -2.020533e-05 -1.622524e-04
   1.279239e-05 -3.429814e-08  4.291544e-05  3.837361e-08 -6.159935e-04
   7.837338e-06  2.265946e-04  6.880751e-06 -1.052839e-03 -7.417941e-03
   6.628547e-06 -5.070010e-08  4.828187e-07  1.804501e-07 -4.386036e-04
  -1.171547e-07 -1.085175e-05 -1.680063e-07 -2.984472e-05 -7.142378e-05
   4.018060e-06  6.170792e-08 -8.677162e-06 -5.626829e-08 -6.636234e-04
   2.865924e-06  5.802056e-04  1.071035e-06 -2.763050e-04 -2.605385e-03
   1.224802e+00 -1.578324e-03  7.357650e+00 -8.204265e-03 -5.987854e+01
  -6.000875e-03 -1.844886e-01 -2.148919e-02  4.863955e+00 -2.140589e+01
   9.699562e-02 -1.316896e-03  2.688983e-01 -2.653502e-03 -6.857947e+00
  -1.580185e-03 -1.308629e-02 -7.266771e-03 -1.339855e-01 -8.612105e+00
   2.672029e-01 -4.576968e-04  3.382203e-01 -2.216111e-03 -6.115421e+00
  -4.352495e-08 -2.179201e-05 -3.075142e-08 -2.106535e-05 -6.610294e-05
   2.344594e+00  2.675007e-02  1.345475e+00  9.786980e-03 -7.893145e+01
  -4.293601e-03  1.477834e+00  1.449560e-02 -1.886093e-01 -1.404010e+01
  -1.630241e-01 -2.907367e-03 -3.827110e-01 -3.012385e-03 -2.082925e+01
   1.523656e-04 -8.546051e-01 -3.760326e-03 -8.728003e-01 -9.027570e+00
   2.078162e-01  1.718289e-03  6.697884e-01 -1.164509e-03 -1.339107e+01
  -1.290755e-03  1.153150e-01  1.040919e-03 -9.274989e-01 -6.860890e+00
   4.053729e-01 -1.459706e-02  1.086589e+00 -2.373529e-02 -2.832217e+01
  -4.161774e-09 -8.641286e-06 -6.208313e-08 -1.117334e-05 -3.064790e-05
  -2.319515e-01 -5.228767e-03  1.896648e-01  2.048313e-03 -1.435757e+01
   3.454065e-03 -9.499130e-02 -6.578861e-03  5.878848e-01 -5.296680e+00
 [ getOption("max.print") est atteint -- 7 lignes omises ]

Model rank =  7802 / 7802 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                          k'      edf
s(measurement.no)                                   9.00e+00 7.67e+00
s(measurement.no):toneBis.ord1                      9.00e+00 3.09e+00
s(measurement.no):toneBis.ord2                      9.00e+00 1.00e+00
s(measurement.no):toneBis.ord3                      9.00e+00 3.53e+00
s(measurement.no,speaker)                           1.00e+02 3.85e+01
s(measurement.no,speaker):toneBis.ord1              1.00e+02 1.64e-02
s(measurement.no,speaker):toneBis.ord2              1.00e+02 1.37e-03
s(measurement.no,speaker):toneBis.ord3              1.00e+02 6.92e-03
s(measurement.no,speakerLeftRightTone)              6.00e+02 1.63e+02
s(measurement.no,speakerLeftRightTone):toneBis.ord1 6.00e+02 3.09e+01
s(measurement.no,speakerLeftRightTone):toneBis.ord2 6.00e+02 1.22e+01
s(measurement.no,speakerLeftRightTone):toneBis.ord3 6.00e+02 1.86e+02
s(measurement.no,speakerPos)                        3.00e+02 5.97e+01
s(measurement.no,speakerPos):toneBis.ord1           3.00e+02 4.05e+01
s(measurement.no,speakerPos):toneBis.ord2           3.00e+02 5.66e+01
s(measurement.no,speakerPos):toneBis.ord3           3.00e+02 3.93e+01
s(measurement.no,word)                              9.75e+02 1.52e+02
s(measurement.no,wordPos)                           1.43e+03 3.31e+02
s(measurement.no,wordLeftRightTone)                 1.36e+03 5.31e+02
                                                    k-index p-value
s(measurement.no)                                      0.99    0.23
s(measurement.no):toneBis.ord1                         0.99    0.17
s(measurement.no):toneBis.ord2                         0.99    0.18
s(measurement.no):toneBis.ord3                         0.99    0.20
s(measurement.no,speaker)                              0.99    0.20
s(measurement.no,speaker):toneBis.ord1                 0.99    0.26
s(measurement.no,speaker):toneBis.ord2                 0.99    0.24
s(measurement.no,speaker):toneBis.ord3                 0.99    0.24
s(measurement.no,speakerLeftRightTone)                 0.99    0.20
s(measurement.no,speakerLeftRightTone):toneBis.ord1    0.99    0.24
s(measurement.no,speakerLeftRightTone):toneBis.ord2    0.99    0.22
s(measurement.no,speakerLeftRightTone):toneBis.ord3    0.99    0.17
s(measurement.no,speakerPos)                           0.99    0.20
s(measurement.no,speakerPos):toneBis.ord1              0.99    0.23
s(measurement.no,speakerPos):toneBis.ord2              0.99    0.23
s(measurement.no,speakerPos):toneBis.ord3              0.99    0.20
s(measurement.no,word)                                 0.99    0.17
s(measurement.no,wordPos)                              0.99    0.19
s(measurement.no,wordLeftRightTone)                    0.99    0.16

#Plotting
# Normalized scale
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1c, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", ylim = c(-1, 1), lwd = 4, xlab = "Time (normalized)", ylab = "F1 (Z)", xaxt = "n", font.lab = 2, hide.label = TRUE)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1c, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1c, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1c, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
legend("topright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

# Plotting
# Reconstructed scale
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1c, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", ylim = c(500, 700), xlab = "Time (ms)", ylab = "F1 (Hz)", xaxt = "n", font.lab = 2, add = F, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT1au * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1au + global_mean1au, hide.label = TRUE)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1c, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT2au * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1au + global_mean1au)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1c, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT3au * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1au + global_mean1au)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1c, view="measurement.no",
             rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", lwd = 4, add = T, transform.view = function(measurement.no) measurement.no * durationT4au * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1au + global_mean1au)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
legend("topright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

# Plotting
# Diffrence plot between tones
par(mfcol = c(2, 3), mar = c(2, 2, 2, 1), oma = c(4, 4, 2, 1)) 
plot_diff(gamm.model1c, view="measurement.no", comp=list(toneBis.ord = c("1","2")),rm.ranef=TRUE, main = "1-2", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.000000 - 8.686869
plot_diff(gamm.model1c, view="measurement.no",comp=list(toneBis.ord = c("1","3")),rm.ranef=TRUE, main = "1-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.303030 - 10.000000
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1c, view="measurement.no",comp=list(toneBis.ord = c("1","4")),rm.ranef=TRUE, main = "1-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.404040 - 10.000000
plot_diff(gamm.model1c, view="measurement.no",comp=list(toneBis.ord = c("2","3")),rm.ranef=TRUE, main = "2-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    3.535354 - 10.000000
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1c, view="measurement.no",comp=list(toneBis.ord = c("2","4")),rm.ranef=TRUE, main = "2-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
plot_diff(gamm.model1c, view="measurement.no",comp=list(toneBis.ord = c("3","4")),rm.ranef=TRUE, main = "3-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    1.515152 - 10.000000
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
mtext("Difference in F1 (Z)", side = 2, outer = TRUE, line = 2.5, cex = 1.2, font = 2)
mtext("Time (normalized)", side = 1, outer = TRUE, line = 2.5, cex = 1.2, font = 2)

plot_parametric(gamm.model1c, pred = list(toneBis.ord=c("1", "2", "3", "4")), main = "Tone", xlab = "F1 (Z)")
Summary:
    * toneBis.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; set to the value(s): 5. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Model 1D: /au/ female, F1 as output


gamm.model1d.noAR <- bam(f1Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                          
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                        
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                        
                      data=data.au.fem, method="fREML", discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1d.noAR, paste("Gamm_model1d_noAR.rds"))
gamm.model1d.noAR <- 
  readRDS("Gamm_model1d_noAR.rds")
r.gamm.model1d <- start_value_rho(gamm.model1d.noAR)
# Auto-regressive model

gamm.model1d <- bam(f1Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                          
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                    
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                        
                      data=data.au.fem, method="fREML", rho = r.gamm.model1d, AR.start = data.au.fem$start, discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1d, paste("Gamm_model1d.rds"))
gamm.model1d <- 
  readRDS("Gamm_model1d.rds")
summary(gamm.model1d, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f1Zscore2 ~ toneBis.ord + s(measurement.no, bs = "cr") + s(measurement.no, 
    by = toneBis.ord, bs = "cr") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1, by = toneBis.ord) + s(measurement.no, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerPos, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, word, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordPos, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 3, m = 1)

Parametric coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)   0.16219    0.05724   2.834  0.00461 ** 
toneBis.ord1 -0.35416    0.08495  -4.169 3.09e-05 ***
toneBis.ord2 -0.17573    0.08834  -1.989  0.04671 *  
toneBis.ord3  0.06142    0.07753   0.792  0.42827    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
                                 edf Ref.df       F p-value    
s(measurement.no)              8.099  8.313 111.901 < 2e-16 ***
s(measurement.no):toneBis.ord1 4.538  5.432   3.894 0.00152 ** 
s(measurement.no):toneBis.ord2 3.468  4.286   3.950 0.00273 ** 
s(measurement.no):toneBis.ord3 4.246  5.069   2.037 0.07229 .  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.745   Deviance explained = 78.3%
fREML = 8460.7  Scale est. = 0.24131   n = 10252
gam.check(gamm.model1d)


Method: fREML   Optimizer: perf chol
$grad
 [1] -2.263432e-07 -1.976717e-07 -4.406521e-07  1.689388e-07  2.551381e-06 -5.279386e-05  8.773527e-07
 [8] -7.287982e-05 -5.097203e-05 -7.403346e-05  6.809239e-07 -6.501874e-05 -9.847376e-06  4.267025e-08
[15] -1.835476e-07  2.827569e-08 -9.938958e-06 -6.767732e-05  9.200066e-07 -4.559484e-08 -2.151888e-06
[22]  6.358038e-08 -1.777578e-07  3.117976e-08 -3.710818e-05 -5.833773e-07 -4.337288e-07  8.411823e-08
[29] -6.577230e-06 -2.895434e-08 -1.117279e-05  7.061571e-08 -3.450988e-06 -4.460145e-08  2.880854e-04

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]          [,7]
   3.719882e+00 -6.374096e-02  2.505414e-02  4.814090e-02 -9.631971e-02 -1.404865e-09 -9.373219e-03
  -6.374096e-02  1.001090e+00  3.017618e-02  6.985698e-02  8.837656e-03 -1.631016e-09  1.072949e-01
   2.505414e-02  3.017618e-02  7.325820e-01 -3.950766e-02 -4.589143e-02 -6.800776e-10 -4.114420e-04
   4.814090e-02  6.985698e-02 -3.950766e-02  7.254346e-01  7.524961e-03  2.660483e-09  1.330269e-02
  -9.631971e-02  8.837656e-03 -4.589143e-02  7.524961e-03  1.799996e+01 -1.061054e-07  5.166475e-02
  -1.404865e-09 -1.631016e-09 -6.800776e-10  2.660483e-09 -1.061054e-07  5.279333e-05 -2.978768e-08
  -9.373219e-03  1.072949e-01 -4.114420e-04  1.330269e-02  5.166475e-02 -2.978768e-08  1.812253e+00
   7.087722e-10 -6.796644e-09  2.781061e-09 -1.903899e-09 -1.132994e-07 -8.590446e-11 -1.346346e-06
   6.127760e-06  7.241832e-06  3.820560e-05 -4.622223e-06 -3.929350e-05  9.614664e-12 -3.033064e-05
   5.314193e-10 -9.257959e-10  2.879306e-08  5.552890e-09 -5.525486e-08 -8.369255e-11  2.143556e-08
   2.274547e-03  1.072763e-02  2.492812e-03  1.394692e-01 -1.988880e-01  1.916568e-08  4.792329e-02
  -1.111173e-09  5.897139e-10 -8.087530e-09  6.682677e-09 -2.392742e-07 -2.892540e-10  1.091549e-08
   2.620110e-02 -2.996804e-02 -4.894108e-03  3.055260e-02  2.013612e+00  6.695699e-08 -1.561834e-01
  -7.433868e-04 -6.750249e-04  8.054930e-04 -2.011274e-04 -1.837843e-03 -1.982588e-05 -4.529597e-03
  -1.248212e-03 -6.480229e-03 -4.324118e-05  1.239154e-03  2.181420e-02 -1.381198e-08  2.625696e-01
  -6.213140e-05 -4.387455e-05  2.414587e-05 -1.674730e-05 -2.742644e-03  1.894041e-06 -2.257622e-02
   1.267149e-03  2.323124e-05 -7.329733e-03 -1.533247e-03 -4.484158e-02  5.020462e-09  8.008529e-04
   4.857004e-10 -1.242279e-09  4.036157e-08 -3.248280e-09  4.243023e-08 -4.978105e-11 -2.582413e-08
   2.772011e-03  7.646099e-03  4.450527e-03  7.558802e-02 -1.870510e-02  1.731108e-08  1.813999e-02
  -3.504490e-05 -3.015488e-05  4.414684e-04  2.536289e-05  5.772426e-06 -9.965276e-07 -9.064633e-04
  -3.839964e-02  1.684916e-02  1.814193e-02  4.255589e-03  1.478484e+00 -9.265753e-08 -8.667577e-02
  -1.765703e-04 -8.811565e-05  7.446677e-04 -1.723752e-04 -2.138417e-03 -1.170593e-05 -4.021861e-04
  -1.731150e-03  3.933000e-02 -7.205234e-04  2.775706e-03  4.568702e-02 -6.025779e-09  4.641221e-01
   1.286741e-05 -1.463523e-04  5.967653e-05 -2.262872e-06  2.740310e-04 -4.034316e-07 -9.891064e-03
   2.264014e-07  1.977239e-07  4.407712e-07 -1.689810e-07 -2.552102e-06  1.736332e-13 -8.775873e-07
   1.750026e-05 -9.473915e-06  7.756894e-04  2.008073e-04  6.817781e-04 -1.007362e-06 -7.565601e-05
   1.574863e-03  3.081301e-03 -4.526982e-04  2.530293e-02 -5.200849e-02  1.500412e-10  9.609124e-03
  -7.483400e-06  4.348445e-05 -1.223848e-04  1.977409e-04 -1.580909e-03 -1.858509e-06 -3.897562e-04
           [,8]          [,9]         [,10]         [,11]         [,12]         [,13]         [,14]
   7.087722e-10  6.127760e-06  5.314193e-10  2.274547e-03 -1.111173e-09  2.620110e-02 -7.433868e-04
  -6.796644e-09  7.241832e-06 -9.257959e-10  1.072763e-02  5.897139e-10 -2.996804e-02 -6.750249e-04
   2.781061e-09  3.820560e-05  2.879306e-08  2.492812e-03 -8.087530e-09 -4.894108e-03  8.054930e-04
  -1.903899e-09 -4.622223e-06  5.552890e-09  1.394692e-01  6.682677e-09  3.055260e-02 -2.011274e-04
  -1.132994e-07 -3.929350e-05 -5.525486e-08 -1.988880e-01 -2.392742e-07  2.013612e+00 -1.837843e-03
  -8.590446e-11  9.614664e-12 -8.369255e-11  1.916568e-08 -2.892540e-10  6.695699e-08 -1.982588e-05
  -1.346346e-06 -3.033064e-05  2.143556e-08  4.792329e-02  1.091549e-08 -1.561834e-01 -4.529597e-03
   7.288428e-05  1.626612e-11 -1.518963e-11 -3.243844e-08 -3.465795e-10  2.447529e-08  6.760651e-06
   1.626612e-11  5.135041e-05  5.834618e-10  9.997226e-06 -2.007142e-11  1.162779e-04  5.967540e-08
  -1.518963e-11  5.834618e-10  7.403751e-05 -1.185690e-08 -3.068717e-10  4.826966e-08  8.830783e-06
  -3.243844e-08  9.997226e-06 -1.185690e-08  2.135689e+00 -2.420654e-07  5.300989e-02  1.048772e-03
  -3.465795e-10 -2.007142e-11 -3.068717e-10 -2.420654e-07  6.503692e-05 -1.660778e-08 -1.339911e-05
   2.447529e-08  1.162779e-04  4.826966e-08  5.300989e-02 -1.660778e-08  1.516154e+01 -7.181350e-03
   6.760651e-06  5.967540e-08  8.830783e-06  1.048772e-03 -1.339911e-05 -7.181350e-03  1.239728e+01
  -2.007985e-07 -7.033481e-06 -9.541884e-09 -3.625253e-04 -4.858821e-09  2.059961e-01 -1.401804e-03
   3.113919e-05  3.807825e-08  1.130280e-05 -1.022922e-03 -1.861709e-06 -6.485742e-05 -6.271258e-02
  -2.855147e-09  4.083725e-05  1.957801e-07 -1.140626e-02 -3.211166e-08  2.045591e-02 -2.017129e-03
   1.729028e-10  3.749629e-10  7.583647e-11 -2.321139e-08 -4.519375e-10 -2.628778e-08 -9.008563e-06
  -2.792952e-08 -8.344105e-06 -1.054305e-08  8.104957e-01  1.824848e-07  3.082562e-01  3.074863e-03
  -8.995492e-07  1.154059e-06  6.048768e-06 -2.728781e-03  7.251506e-05  6.604647e-04 -2.493408e-01
  -3.991575e-08 -2.529648e-06 -2.301120e-08  6.215264e-02 -1.453757e-07  1.510867e+00  4.552609e-04
  -4.545869e-06 -1.800377e-06 -8.193931e-06  7.033470e-04 -8.228853e-06  4.470595e-03 -5.669122e-01
  -2.727564e-07 -1.647334e-05 -4.023665e-09  1.100889e-02  1.804001e-08  4.340836e-02 -1.353649e-03
   4.191823e-05 -3.476107e-07  3.207942e-07 -1.957709e-04 -1.783666e-06 -2.705693e-03  6.245040e-03
   7.163725e-13  1.315749e-08  2.282393e-11 -6.811420e-07 -4.371616e-14  9.850672e-06 -4.268059e-08
   1.618769e-06  4.606361e-06  2.838289e-05  2.100485e-03  6.311043e-06  2.275647e-04  1.377342e-01
  -1.002926e-08 -2.884997e-06 -9.703763e-09  4.422858e-01 -5.698338e-08  4.916871e-02  4.320569e-04
  -1.014167e-06  5.155660e-07  3.033710e-06 -6.493487e-04  1.214390e-04 -1.308908e-03 -1.161469e-01
          [,15]         [,16]         [,17]         [,18]         [,19]         [,20]         [,21]
  -1.248212e-03 -6.213140e-05  1.267149e-03  4.857004e-10  2.772011e-03 -3.504490e-05 -3.839964e-02
  -6.480229e-03 -4.387455e-05  2.323124e-05 -1.242279e-09  7.646099e-03 -3.015488e-05  1.684916e-02
  -4.324118e-05  2.414587e-05 -7.329733e-03  4.036157e-08  4.450527e-03  4.414684e-04  1.814193e-02
   1.239154e-03 -1.674730e-05 -1.533247e-03 -3.248280e-09  7.558802e-02  2.536289e-05  4.255589e-03
   2.181420e-02 -2.742644e-03 -4.484158e-02  4.243023e-08 -1.870510e-02  5.772426e-06  1.478484e+00
  -1.381198e-08  1.894041e-06  5.020462e-09 -4.978105e-11  1.731108e-08 -9.965276e-07 -9.265753e-08
   2.625696e-01 -2.257622e-02  8.008529e-04 -2.582413e-08  1.813999e-02 -9.064633e-04 -8.667577e-02
  -2.007985e-07  3.113919e-05 -2.855147e-09  1.729028e-10 -2.792952e-08 -8.995492e-07 -3.991575e-08
  -7.033481e-06  3.807825e-08  4.083725e-05  3.749629e-10 -8.344105e-06  1.154059e-06 -2.529648e-06
  -9.541884e-09  1.130280e-05  1.957801e-07  7.583647e-11 -1.054305e-08  6.048768e-06 -2.301120e-08
  -3.625253e-04 -1.022922e-03 -1.140626e-02 -2.321139e-08  8.104957e-01 -2.728781e-03  6.215264e-02
  -4.858821e-09 -1.861709e-06 -3.211166e-08 -4.519375e-10  1.824848e-07  7.251506e-05 -1.453757e-07
   2.059961e-01 -6.485742e-05  2.045591e-02 -2.628778e-08  3.082562e-01  6.604647e-04  1.510867e+00
  -1.401804e-03 -6.271258e-02 -2.017129e-03 -9.008563e-06  3.074863e-03 -2.493408e-01  4.552609e-04
   3.348027e-01 -1.574907e-02  1.516012e-02 -4.376707e-09  3.464327e-04 -1.103673e-04 -5.803870e-02
  -1.574907e-02  8.692207e+00 -1.475071e-03  1.533469e-05  3.023401e-05 -1.810824e-01 -1.371764e-03
   1.516012e-02 -1.475071e-03  6.327256e-01  8.234094e-08  3.049563e-03  1.044739e-03 -1.040800e-01
  -4.376707e-09  1.533469e-05  8.234094e-08  6.767965e-05 -5.680324e-08  3.327389e-07 -6.639354e-09
   3.464327e-04  3.023401e-05  3.049563e-03 -5.680324e-08  1.521835e+00 -1.929429e-02  2.078064e-01
  -1.103673e-04 -1.810824e-01  1.044739e-03  3.327389e-07 -1.929429e-02  3.533783e+00 -1.414744e-04
  -5.803870e-02 -1.371764e-03 -1.040800e-01 -6.639354e-09  2.078064e-01 -1.414744e-04  1.100136e+01
  -6.944822e-05 -1.817126e-01 -1.233467e-03 -5.135050e-06  1.809842e-03 -7.177971e-02 -5.728799e-02
   1.172621e-01 -6.919525e-03  9.396136e-03 -1.780136e-08  1.806581e-02 -4.116702e-05 -6.189906e-02
  -1.742444e-03  4.578193e-01 -3.077189e-04  2.510749e-06 -5.484151e-05 -4.998375e-02 -1.717053e-03
   1.836178e-07 -2.828188e-08  9.942378e-06  2.054004e-11 -9.202683e-07  4.560778e-08  2.152876e-06
  -2.892137e-05  1.241461e-01  2.727595e-04  2.859461e-05  8.076768e-04  3.067298e-02  1.411978e-03
  -6.348153e-03 -5.537533e-04 -2.798626e-04  3.312658e-08  3.478483e-01 -9.397574e-04  1.084166e-01
   4.329828e-04 -1.067085e-01 -5.521842e-05  4.597474e-06  2.843962e-03  6.433080e-01  5.181299e-04
          [,22]         [,23]         [,24]         [,25]         [,26]         [,27]         [,28]
  -1.765703e-04 -1.731150e-03  1.286741e-05  2.264014e-07  1.750026e-05  1.574863e-03 -7.483400e-06
  -8.811565e-05  3.933000e-02 -1.463523e-04  1.977239e-07 -9.473915e-06  3.081301e-03  4.348445e-05
   7.446677e-04 -7.205234e-04  5.967653e-05  4.407712e-07  7.756894e-04 -4.526982e-04 -1.223848e-04
  -1.723752e-04  2.775706e-03 -2.262872e-06 -1.689810e-07  2.008073e-04  2.530293e-02  1.977409e-04
  -2.138417e-03  4.568702e-02  2.740310e-04 -2.552102e-06  6.817781e-04 -5.200849e-02 -1.580909e-03
  -1.170593e-05 -6.025779e-09 -4.034316e-07  1.736332e-13 -1.007362e-06  1.500412e-10 -1.858509e-06
  -4.021861e-04  4.641221e-01 -9.891064e-03 -8.775873e-07 -7.565601e-05  9.609124e-03 -3.897562e-04
  -4.545869e-06 -2.727564e-07  4.191823e-05  7.163725e-13  1.618769e-06 -1.002926e-08 -1.014167e-06
  -1.800377e-06 -1.647334e-05 -3.476107e-07  1.315749e-08  4.606361e-06 -2.884997e-06  5.155660e-07
  -8.193931e-06 -4.023665e-09  3.207942e-07  2.282393e-11  2.838289e-05 -9.703763e-09  3.033710e-06
   7.033470e-04  1.100889e-02 -1.957709e-04 -6.811420e-07  2.100485e-03  4.422858e-01 -6.493487e-04
  -8.228853e-06  1.804001e-08 -1.783666e-06 -4.371616e-14  6.311043e-06 -5.698338e-08  1.214390e-04
   4.470595e-03  4.340836e-02 -2.705693e-03  9.850672e-06  2.275647e-04  4.916871e-02 -1.308908e-03
  -5.669122e-01 -1.353649e-03  6.245040e-03 -4.268059e-08  1.377342e-01  4.320569e-04 -1.161469e-01
  -6.944822e-05  1.172621e-01 -1.742444e-03  1.836178e-07 -2.892137e-05 -6.348153e-03  4.329828e-04
  -1.817126e-01 -6.919525e-03  4.578193e-01 -2.828188e-08  1.241461e-01 -5.537533e-04 -1.067085e-01
  -1.233467e-03  9.396136e-03 -3.077189e-04  9.942378e-06  2.727595e-04 -2.798626e-04 -5.521842e-05
  -5.135050e-06 -1.780136e-08  2.510749e-06  2.054004e-11  2.859461e-05  3.312658e-08  4.597474e-06
   1.809842e-03  1.806581e-02 -5.484151e-05 -9.202683e-07  8.076768e-04  3.478483e-01  2.843962e-03
  -7.177971e-02 -4.116702e-05 -4.998375e-02  4.560778e-08  3.067298e-02 -9.397574e-04  6.433080e-01
  -5.728799e-02 -6.189906e-02 -1.717053e-03  2.152876e-06  1.411978e-03  1.084166e-01  5.181299e-04
   7.768225e+00 -5.678028e-04 -2.906126e-01 -6.359645e-08 -3.283686e-01  7.331257e-05 -7.124836e-01
  -5.678028e-04  4.814646e-01 -1.432874e-02  1.778260e-07 -1.545298e-04 -9.357957e-04 -5.553771e-04
  -2.906126e-01 -1.432874e-02  2.179102e+00 -3.118803e-08 -2.027721e-02 -3.007584e-04 -1.205477e-02
  -6.359645e-08  1.778260e-07 -3.118803e-08  3.710933e-05  5.835496e-07  4.338878e-07 -8.414271e-08
  -3.283686e-01 -1.545298e-04 -2.027721e-02  5.835496e-07  1.863205e+00  1.048861e-03 -9.675473e-02
   7.331257e-05 -9.357957e-04 -3.007584e-04  4.338878e-07  1.048861e-03  4.504621e-01  2.608824e-03
  -7.124836e-01 -5.553771e-04 -1.205477e-02 -8.414271e-08 -9.675473e-02  2.608824e-03  5.570895e+00
          [,29]         [,30]         [,31]         [,32]         [,33]         [,34]         [,35]
  -6.457061e-03 -4.866757e-05 -2.623354e-03 -9.260853e-05 -4.831239e-03 -1.753270e-04 -3.549456e+00
  -8.345307e-03  4.715595e-05  8.782287e-03  6.515888e-05 -4.040887e-03  5.732897e-05 -1.768847e+00
  -2.384022e-02  4.330284e-05 -1.763753e-02  3.073177e-04 -3.411146e-02  7.329211e-05 -1.233854e+00
   2.138683e-02  3.516615e-04  7.736704e-03  2.507909e-04  2.353880e-02  6.983143e-04 -1.623143e+00
  -1.299940e-01 -2.276029e-03  5.395768e-02 -4.506029e-03 -7.342013e-02 -3.951828e-03 -2.529763e+01
  -5.310641e-10 -1.771554e-07 -4.051232e-08 -3.798999e-06  1.367845e-08 -2.022776e-06 -2.307532e-05
  -2.469285e-02  9.501564e-04 -8.375349e-02  4.935205e-05  1.500951e-01  2.751987e-03 -7.787842e+00
   3.762137e-08  3.236177e-06 -4.960624e-08 -4.109764e-06  1.126400e-07 -1.702672e-05 -1.641659e-04
   2.527288e-04  2.957060e-07  2.029024e-04  1.120360e-06  5.041652e-04  5.001739e-07 -3.366850e-03
   2.226380e-07 -1.415280e-05  3.086092e-07 -1.911637e-05  6.383422e-07 -1.106117e-05 -1.185934e-04
   1.679894e-01  1.351288e-03  1.179851e-02  2.084263e-03  1.927557e-01  3.106268e-03 -7.442323e+00
   3.980803e-09 -9.799087e-06 -1.120932e-07 -1.869553e-05 -2.645890e-08 -2.936238e-05 -2.848236e-04
   1.874124e+00  2.203628e-03  1.446923e+00  5.731671e-03  5.403847e+00  6.559770e-03 -5.168309e+01
  -3.672947e-03  1.305758e+00 -3.228798e-03  2.411451e+00  7.205885e-03  3.829019e+00 -2.238870e+01
   7.811130e-02 -1.716155e-05  1.267694e-01 -1.305139e-03  1.845445e-01 -1.050663e-03 -5.853152e+00
   1.559257e-04 -1.803393e-02 -6.338187e-03  3.902090e-01 -1.368173e-02  2.191919e-01 -1.515289e+01
   1.256109e-01  1.137014e-03  2.296203e-01  1.185579e-03  4.889840e-01  1.460659e-03 -6.578798e+00
  -3.991942e-08 -2.941514e-06 -6.237097e-08 -1.745894e-05 -1.349976e-07  5.957818e-06 -1.583714e-04
   1.582936e-01  6.043350e-04  1.923116e-01  2.027460e-03  3.824882e-01  3.699380e-04 -1.475162e+01
   1.790135e-03  1.624946e-01 -1.844016e-03  1.867315e-02  4.297133e-03  5.963202e-01 -9.144651e+00
   2.529623e-01 -1.954315e-03  2.273077e-01 -1.054465e-02  1.289267e+00 -5.948466e-03 -2.824699e+01
  -1.118320e-03 -7.321193e-02 -3.539665e-03 -2.010042e-01 -1.280070e-03 -5.106159e-01 -9.528931e+00
   3.471603e-02 -1.138120e-04 -6.272792e-02 -1.206359e-03  1.103864e-01 -8.097978e-04 -5.086359e+00
  -2.672290e-03 -7.624514e-02 -1.477304e-03 -2.253861e-01 -2.954305e-03 -9.091869e-02 -4.991273e+00
   6.579429e-06  2.896277e-08  1.117641e-05 -7.063274e-08  3.452499e-06  4.461275e-08 -2.881613e-04
   1.275920e-03  4.701303e-02 -6.415411e-03  5.138981e-01  5.410833e-03  3.255360e-01 -4.452017e+00
   8.457272e-02  5.461874e-04  8.411937e-02  1.044321e-03  5.224196e-02  8.346469e-04 -6.073009e+00
  -5.487112e-04 -1.418358e-01 -6.669694e-03 -2.634647e-01  4.374331e-04 -6.774332e-01 -8.751659e+00
 [ getOption("max.print") est atteint -- 7 lignes omises ]

Model rank =  7542 / 7542 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                          k'      edf k-index p-value
s(measurement.no)                                   9.00e+00 8.10e+00       1    0.46
s(measurement.no):toneBis.ord1                      9.00e+00 4.54e+00       1    0.58
s(measurement.no):toneBis.ord2                      9.00e+00 3.47e+00       1    0.47
s(measurement.no):toneBis.ord3                      9.00e+00 4.25e+00       1    0.50
s(measurement.no,speaker)                           1.00e+02 5.06e+01       1    0.46
s(measurement.no,speaker):toneBis.ord1              1.00e+02 1.56e+01       1    0.49
s(measurement.no,speaker):toneBis.ord2              1.00e+02 7.22e-03       1    0.52
s(measurement.no,speaker):toneBis.ord3              1.00e+02 1.49e+01       1    0.52
s(measurement.no,speakerLeftRightTone)              5.80e+02 1.48e+02       1    0.48
s(measurement.no,speakerLeftRightTone):toneBis.ord1 5.80e+02 4.20e+01       1    0.48
s(measurement.no,speakerLeftRightTone):toneBis.ord2 5.80e+02 1.32e+01       1    0.47
s(measurement.no,speakerLeftRightTone):toneBis.ord3 5.80e+02 4.78e+01       1    0.46
s(measurement.no,speakerPos)                        3.00e+02 7.56e+01       1    0.47
s(measurement.no,speakerPos):toneBis.ord1           3.00e+02 2.02e+01       1    0.48
s(measurement.no,speakerPos):toneBis.ord2           3.00e+02 8.90e+00       1    0.49
s(measurement.no,speakerPos):toneBis.ord3           3.00e+02 2.96e+01       1    0.44
s(measurement.no,word)                              9.30e+02 1.84e+02       1    0.48
s(measurement.no,wordPos)                           1.39e+03 3.87e+02       1    0.51
s(measurement.no,wordLeftRightTone)                 1.27e+03 4.42e+02       1    0.49

# Plotting
# Normalized scale
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1d, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", ylim = c(-1, 1), lwd = 4, xlab = "Time (normalized)", ylab = "F1 (Z)", xaxt = "n", font.lab = 2)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1d, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1d, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1d, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
legend("topright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

# Plotting
# Reconstructed scale
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1d, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", ylim = c(550, 900), xlab = "Time (ms)", ylab = "F1 (Hz)", xaxt = "n", font.lab = 2, add = F, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT2auf * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1auf + global_mean1auf, hide.label = TRUE)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1d, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT1auf * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1auf + global_mean1auf)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1d, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT3auf * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1auf + global_mean1auf)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1d, view="measurement.no",
             rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", lwd = 4, add = T, transform.view = function(measurement.no) measurement.no * durationT4auf * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1auf + global_mean1auf)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
legend("topright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

# Plotting
# Difference plots between tones
par(mfcol = c(2, 3), mar = c(2, 2, 2, 1), oma = c(4, 4, 2, 1)) 
plot_diff(gamm.model1d, view="measurement.no", comp=list(toneBis.ord = c("1","2")),rm.ranef=TRUE, main = "1-2", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.606061 - 5.959596
    9.191919 - 10.000000
plot_diff(gamm.model1d, view="measurement.no",comp=list(toneBis.ord = c("1","3")),rm.ranef=TRUE, main = "1-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.303030 - 8.888889
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1d, view="measurement.no",comp=list(toneBis.ord = c("1","4")),rm.ranef=TRUE, main = "1-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.000000 - 8.181818
plot_diff(gamm.model1d, view="measurement.no",comp=list(toneBis.ord = c("2","3")),rm.ranef=TRUE, main = "2-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    6.161616 - 10.000000
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1d, view="measurement.no",comp=list(toneBis.ord = c("2","4")),rm.ranef=TRUE, main = "2-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    6.666667 - 10.000000
plot_diff(gamm.model1d, view="measurement.no",comp=list(toneBis.ord = c("3","4")),rm.ranef=TRUE, main = "3-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
mtext("Difference in F1 (Z)", side = 2, outer = TRUE, line = 2.5, cex = 1.2, font = 2)
mtext("Time (normalized)", side = 1, outer = TRUE, line = 2.5, cex = 1.2, font = 2)

plot_parametric(gamm.model1d, pred = list(toneBis.ord=c("1", "2", "3", "4")), xlab = "F1 (Z)", main = "Tone")
Summary:
    * toneBis.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; set to the value(s): 5. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

For Appendix B: Organizing tones as “1 < 2 < 3 < 4”


gamm.initialOrder.noAR <- bam(f1Zscore2 ~ tone.ord + 
                        
                        # smooth                        
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=tone.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=tone.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=tone.ord) +  
                    
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=tone.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                        
                      data=data.au.mas, method="fREML", discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.initialOrder.noAR, paste("Gamm_initialOrder_noAR.rds"))
gamm.initialOrder.noAR <- 
  readRDS("Gamm_initialOrder_noAR.rds")
r.gamm.initialOrder <- start_value_rho(gamm.initialOrder.noAR)
# Auto-regressive model

gamm.InitialOrder <- bam(f1Zscore2 ~ tone.ord + 
                       # smooth                        
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=tone.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=tone.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=tone.ord) +  
                        
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=tone.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                    
                      data=data.au.mas, method="fREML", rho = r.gamm.initialOrder, AR.start = data.au.mas$start, discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.InitialOrder, paste("Gamm_InitialOrder.rds"))
gamm.InitialOrder <- 
  readRDS("Gamm_f1_toneO_au_masbis2.rds")
summary(gamm.InitialOrder, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f1Zscore2 ~ tone.ord + s(measurement.no, bs = "cr") + s(measurement.no, 
    by = tone.ord, bs = "cr") + s(measurement.no, speaker, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = tone.ord) + s(measurement.no, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1, by = tone.ord) + s(measurement.no, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerPos, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = tone.ord) + s(measurement.no, word, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordPos, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 3, m = 1)

Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) -0.42981    0.07043  -6.103 1.08e-09 ***
tone.ord2    0.49433    0.10315   4.792 1.68e-06 ***
tone.ord3    0.79634    0.10038   7.934 2.38e-15 ***
tone.ord4    0.49171    0.08219   5.983 2.27e-09 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
                              edf Ref.df      F p-value    
s(measurement.no)           7.629  8.003 40.127 < 2e-16 ***
s(measurement.no):tone.ord2 1.942  2.239  0.992 0.31439    
s(measurement.no):tone.ord3 3.698  4.288  4.171 0.00183 ** 
s(measurement.no):tone.ord4 2.745  3.322  2.009 0.09147 .  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.655   Deviance explained = 70.7%
fREML =  10549  Scale est. = 0.32538   n = 10857
#Plotting

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.InitialOrder, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(tone.ord = "1"), col = "red", ylim = c(-1, 1), lwd = 4, xlab = "Time (normalized)", ylab = "F1 (Z)", xaxt = "n", font.lab = 2)
Summary:
    * tone.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):tone.ord2,s(measurement.no,speaker):tone.ord3,s(measurement.no,speaker):tone.ord4,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):tone.ord2,s(measurement.no,speakerLeftRightTone):tone.ord3,s(measurement.no,speakerLeftRightTone):tone.ord4,s(measurement.no,speakerPos),s(measurement.no,speakerPos):tone.ord2,s(measurement.no,speakerPos):tone.ord3,s(measurement.no,speakerPos):tone.ord4,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.InitialOrder, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(tone.ord = "2"), col = "orange", add = T, lwd = 4)
Summary:
    * tone.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):tone.ord2,s(measurement.no,speaker):tone.ord3,s(measurement.no,speaker):tone.ord4,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):tone.ord2,s(measurement.no,speakerLeftRightTone):tone.ord3,s(measurement.no,speakerLeftRightTone):tone.ord4,s(measurement.no,speakerPos),s(measurement.no,speakerPos):tone.ord2,s(measurement.no,speakerPos):tone.ord3,s(measurement.no,speakerPos):tone.ord4,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.InitialOrder, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(tone.ord = "3"), col = "chartreuse4", add = T, lwd = 4)
Summary:
    * tone.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):tone.ord2,s(measurement.no,speaker):tone.ord3,s(measurement.no,speaker):tone.ord4,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):tone.ord2,s(measurement.no,speakerLeftRightTone):tone.ord3,s(measurement.no,speakerLeftRightTone):tone.ord4,s(measurement.no,speakerPos),s(measurement.no,speakerPos):tone.ord2,s(measurement.no,speakerPos):tone.ord3,s(measurement.no,speakerPos):tone.ord4,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.InitialOrder, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(tone.ord = "4"), col = "royalblue4", add = T, lwd = 4)
Summary:
    * tone.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):tone.ord2,s(measurement.no,speaker):tone.ord3,s(measurement.no,speaker):tone.ord4,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):tone.ord2,s(measurement.no,speakerLeftRightTone):tone.ord3,s(measurement.no,speakerLeftRightTone):tone.ord4,s(measurement.no,speakerPos),s(measurement.no,speakerPos):tone.ord2,s(measurement.no,speakerPos):tone.ord3,s(measurement.no,speakerPos):tone.ord4,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
legend("topright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

Model 1E: /ai/ male, F2 as output


gamm.model1e.noAR <- bam(f2Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                        
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                        
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1e.noAR, paste("Gamm_model1e_noAR.rds"))
gamm.model1e.noAR <- 
  readRDS("Gamm_model1e_noAR.rds")
r.gamm.model1e <- start_value_rho(gamm.model1e.noAR)
# Auto-regressive model

gamm.model1e <- bam(f2Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                        
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                    
                      data=data.ai.mas, method="fREML", rho = r.gamm.model1e, AR.start = data.ai.mas$start, discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1e, paste("Gamm_model1e.rds"))
gamm.model1e <- 
  readRDS("Gamm_model1e.rds")
summary(gamm.model1e, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f2Zscore2 ~ toneBis.ord + s(measurement.no, bs = "cr") + s(measurement.no, 
    by = toneBis.ord, bs = "cr") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1, by = toneBis.ord) + s(measurement.no, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerPos, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, word, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordPos, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 3, m = 1)

Parametric coefficients:
              Estimate Std. Error t value Pr(>|t|)
(Intercept)    0.01529    0.07512   0.204    0.839
toneBis.ord.L -0.14756    0.10703  -1.379    0.168
toneBis.ord.Q -0.12943    0.13070  -0.990    0.322
toneBis.ord.C  0.21326    0.15164   1.406    0.160

Approximate significance of smooth terms:
                                 edf Ref.df      F  p-value    
s(measurement.no)              5.834  6.242 31.952  < 2e-16 ***
s(measurement.no):toneBis.ord1 3.602  4.282  2.215  0.06010 .  
s(measurement.no):toneBis.ord2 3.974  4.973  3.730  0.00268 ** 
s(measurement.no):toneBis.ord3 3.817  4.801  5.479 9.16e-05 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.644   Deviance explained = 67.8%
fREML = 7619.6  Scale est. = 0.2496    n = 12023
gam.check(gamm.model1e)


Method: fREML   Optimizer: perf chol
$grad
 [1] -2.606804e-13  1.605382e-13  1.389999e-13 -1.179057e-13 -3.517187e-13 -1.443290e-15 -8.105354e-05
 [8] -6.614710e-05 -8.881784e-16 -3.952394e-14 -1.332268e-15 -4.180206e-05  1.776357e-14 -7.460699e-14
[15]  1.278977e-13 -5.773160e-15  3.819167e-14  6.217249e-14  1.003642e-13 -6.572520e-14  2.060574e-13
[22]  1.509903e-13  5.506706e-14  9.769963e-15 -2.398082e-14  1.332268e-14 -5.679150e-05 -3.996803e-15
[29] -2.415845e-13 -1.421085e-14  7.105427e-15  8.526513e-14 -6.394885e-14 -2.486900e-13 -1.000444e-11

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]          [,7]
   2.263366e+00  2.957118e-02  1.182119e-01  9.913573e-03  8.148782e-02 -1.276238e-04  1.972664e-06
   2.957118e-02  7.556011e-01 -1.898898e-02  1.722273e-02  2.271054e-02 -1.042046e-05  3.166252e-05
   1.182119e-01 -1.898898e-02  9.700982e-01 -1.434248e-02  4.049020e-02  3.774792e-04 -1.477241e-06
   9.913573e-03  1.722273e-02 -1.434248e-02  1.436278e+00 -6.220648e-03  7.418559e-05  3.627433e-07
   8.148782e-02  2.271054e-02  4.049020e-02 -6.220648e-03  1.844286e+01  1.261228e-02  3.470008e-06
  -1.276238e-04 -1.042046e-05  3.774792e-04  7.418559e-05  1.261228e-02  7.502886e-02  1.730977e-08
   1.972664e-06  3.166252e-05 -1.477241e-06  3.627433e-07  3.470008e-06  1.730977e-08  8.109396e-05
   4.731360e-08  7.383003e-09  2.300870e-08 -4.748906e-08  3.777600e-06 -5.203129e-06 -7.505232e-11
   7.932566e-03 -3.436494e-03  4.167172e-02 -1.839662e-04 -1.619484e-02  2.064908e-03 -8.925853e-07
  -3.208634e-05  1.544205e-06 -1.768669e-04  2.129535e-04 -9.384107e-04 -8.768483e-03  5.597922e-08
  -8.919282e-05  2.529139e-04 -1.337485e-04  3.020934e-03 -5.203518e-02  3.208857e-04  1.692696e-07
   1.546043e-09 -4.371969e-12 -1.519128e-09 -1.163573e-08 -6.480568e-08 -2.003226e-07  5.747714e-12
   2.212247e-02  1.437503e-02  2.249300e-02  9.336702e-03  1.246187e+00  6.126772e-04 -1.356552e-06
  -1.302330e-04 -7.000967e-05  8.955518e-04  4.041613e-04  3.621857e-02  1.462235e-01 -1.849386e-07
   7.519140e-03  1.351893e-01 -7.072659e-03  4.244809e-03 -4.222554e-02 -2.643247e-04  3.240483e-04
   7.797280e-05  1.234992e-05  5.856251e-06 -7.068765e-05  4.079268e-03 -6.515185e-03  2.787486e-07
   3.984341e-03 -1.633067e-03  2.185301e-02  2.331700e-03 -2.147481e-02  1.007257e-03 -8.017777e-08
  -1.374653e-04  3.222476e-05  1.579074e-04  9.679396e-04  1.091004e-02  1.330298e-02 -5.852608e-09
  -5.848222e-03 -1.153444e-04  5.310353e-03 -3.857425e-02 -1.139522e-01  3.260730e-04  6.400358e-07
  -5.413710e-05 -4.715854e-06  2.349160e-04 -2.362591e-03  1.068723e-03 -1.504986e-03  9.660242e-08
   2.409590e-02 -4.177535e-02 -3.492145e-02  1.887236e-02  2.087479e+00  1.993046e-03 -5.463874e-07
  -7.494510e-04 -6.317616e-05  1.018112e-03  8.357567e-04  3.389941e-02  1.994890e-01  2.612850e-07
   8.169953e-03  9.687412e-02 -3.136806e-03  2.178719e-04 -1.183260e-02  2.769589e-04  1.878768e-04
   7.144633e-05 -9.823935e-05 -9.255932e-06 -1.075036e-05  5.219847e-03 -6.619231e-03  2.165689e-07
   1.006995e-04  4.634144e-04  2.530239e-04  6.782945e-04 -3.924636e-02  4.410851e-04  2.115793e-07
   5.949262e-05  8.428063e-07 -1.664917e-05 -6.792660e-05  7.375301e-04  9.490443e-04 -1.936110e-08
   4.754224e-08  6.684307e-09  5.747741e-08  5.081872e-07 -3.838214e-06  2.281734e-08 -2.759643e-11
  -2.932836e-05  6.988533e-06 -1.963514e-05  5.319037e-04 -2.692417e-04 -2.239010e-03 -4.808137e-08
           [,8]          [,9]         [,10]         [,11]         [,12]         [,13]         [,14]
   4.731360e-08  7.932566e-03 -3.208634e-05 -8.919282e-05  1.546043e-09  2.212247e-02 -1.302330e-04
   7.383003e-09 -3.436494e-03  1.544205e-06  2.529139e-04 -4.371969e-12  1.437503e-02 -7.000967e-05
   2.300870e-08  4.167172e-02 -1.768669e-04 -1.337485e-04 -1.519128e-09  2.249300e-02  8.955518e-04
  -4.748906e-08 -1.839662e-04  2.129535e-04  3.020934e-03 -1.163573e-08  9.336702e-03  4.041613e-04
   3.777600e-06 -1.619484e-02 -9.384107e-04 -5.203518e-02 -6.480568e-08  1.246187e+00  3.621857e-02
  -5.203129e-06  2.064908e-03 -8.768483e-03  3.208857e-04 -2.003226e-07  6.126772e-04  1.462235e-01
  -7.505232e-11 -8.925853e-07  5.597922e-08  1.692696e-07  5.747714e-12 -1.356552e-06 -1.849386e-07
   6.631013e-05  2.074066e-07 -7.209766e-10  3.174341e-08  1.251242e-10  2.941997e-07 -1.948815e-05
   2.074066e-07  4.761843e-01  2.331933e-02  5.633977e-03 -4.236830e-09  4.478265e-02  6.544929e-03
  -7.209766e-10  2.331933e-02  1.844055e+00 -6.659143e-05 -1.033513e-06  4.462054e-04  2.475496e-02
   3.174341e-08  5.633977e-03 -6.659143e-05  7.378615e-02  3.971181e-07  4.726695e-03  1.061047e-03
   1.251242e-10 -4.236830e-09 -1.033513e-06  3.971181e-07  4.180454e-05 -6.001818e-08  1.439146e-06
   2.941997e-07  4.478265e-02  4.462054e-04  4.726695e-03 -6.001818e-08  6.078054e+00  2.240296e-02
  -1.948815e-05  6.544929e-03  2.475496e-02  1.061047e-03  1.439146e-06  2.240296e-02  9.390697e+00
   2.273652e-06  6.789523e-03  5.250636e-04 -1.981501e-03  1.822149e-08 -2.403236e-01 -3.608698e-03
   2.143352e-04  2.392762e-04  2.043876e-03  6.919535e-05  1.548986e-07  5.130353e-04  1.510097e-02
   9.375705e-08  2.170079e-01  8.314700e-03  1.547852e-03  1.203567e-10 -3.170258e-02  2.752722e-03
  -9.865854e-06  6.795938e-03  4.001232e-01  1.075918e-04 -5.729976e-07 -5.296697e-03  7.663765e-01
   1.527373e-07  4.859213e-03  2.025290e-05  9.804807e-02  5.296315e-07  9.742284e-02 -7.699768e-04
   8.997901e-06  5.616847e-04 -4.604084e-03  7.676257e-03  6.738220e-05  1.441764e-04 -1.296469e-01
   7.097418e-07 -7.890415e-03 -4.194604e-04 -2.364254e-02 -5.145997e-08  1.285753e-01  7.724224e-03
  -2.172784e-05  2.787263e-03 -1.603306e-02  8.390177e-04 -1.504720e-06 -7.962855e-04  5.432809e-01
   3.401809e-06  2.631574e-03  5.955693e-04 -5.548982e-04  2.977991e-08 -6.762885e-02  5.447921e-04
   3.633024e-04  5.253870e-04  6.611094e-03  7.766502e-05  1.309469e-07 -2.651135e-05  5.626045e-03
   1.837322e-08  1.071768e-01  4.588354e-03  1.560705e-03 -7.776654e-09  1.547766e-02  1.676971e-03
   4.156107e-06  7.534744e-04  8.731027e-02  1.654048e-04 -1.159028e-06  1.123214e-03 -5.138385e-03
  -1.107925e-12  2.643940e-07 -1.838551e-08  4.720439e-06  9.410561e-12  7.046007e-08  1.581500e-07
  -2.471294e-06  2.727444e-04 -1.034248e-03  2.346838e-03  1.229876e-05 -1.080354e-03 -1.755329e-02
          [,15]         [,16]         [,17]         [,18]         [,19]         [,20]         [,21]
   7.519140e-03  7.797280e-05  3.984341e-03 -1.374653e-04 -5.848222e-03 -5.413710e-05  2.409590e-02
   1.351893e-01  1.234992e-05 -1.633067e-03  3.222476e-05 -1.153444e-04 -4.715854e-06 -4.177535e-02
  -7.072659e-03  5.856251e-06  2.185301e-02  1.579074e-04  5.310353e-03  2.349160e-04 -3.492145e-02
   4.244809e-03 -7.068765e-05  2.331700e-03  9.679396e-04 -3.857425e-02 -2.362591e-03  1.887236e-02
  -4.222554e-02  4.079268e-03 -2.147481e-02  1.091004e-02 -1.139522e-01  1.068723e-03  2.087479e+00
  -2.643247e-04 -6.515185e-03  1.007257e-03  1.330298e-02  3.260730e-04 -1.504986e-03  1.993046e-03
   3.240483e-04  2.787486e-07 -8.017777e-08 -5.852608e-09  6.400358e-07  9.660242e-08 -5.463874e-07
   2.273652e-06  2.143352e-04  9.375705e-08 -9.865854e-06  1.527373e-07  8.997901e-06  7.097418e-07
   6.789523e-03  2.392762e-04  2.170079e-01  6.795938e-03  4.859213e-03  5.616847e-04 -7.890415e-03
   5.250636e-04  2.043876e-03  8.314700e-03  4.001232e-01  2.025290e-05 -4.604084e-03 -4.194604e-04
  -1.981501e-03  6.919535e-05  1.547852e-03  1.075918e-04  9.804807e-02  7.676257e-03 -2.364254e-02
   1.822149e-08  1.548986e-07  1.203567e-10 -5.729976e-07  5.296315e-07  6.738220e-05 -5.145997e-08
  -2.403236e-01  5.130353e-04 -3.170258e-02 -5.296697e-03  9.742284e-02  1.441764e-04  1.285753e-01
  -3.608698e-03  1.510097e-02  2.752722e-03  7.663765e-01 -7.699768e-04 -1.296469e-01  7.724224e-03
   1.170472e+01  7.623010e-02  1.003060e-02  6.521751e-03  7.732701e-03  4.027768e-03 -8.421751e-02
   7.623010e-02  1.022238e+00  1.008682e-04 -1.680528e-02  2.635856e-04  3.607445e-02  8.143996e-04
   1.003060e-02  1.008682e-04  5.362080e-01  9.192892e-03  8.148788e-03  8.054612e-04 -6.345837e-02
   6.521751e-03 -1.680528e-02  9.192892e-03  9.239379e+00  1.228302e-03 -4.221971e-03 -6.725808e-04
   7.732701e-03  2.635856e-04  8.148788e-03  1.228302e-03  4.974034e-01  3.558081e-02 -7.606287e-02
   4.027768e-03  3.607445e-02  8.054612e-04 -4.221971e-03  3.558081e-02  7.498610e+00 -4.850523e-03
  -8.421751e-02  8.143996e-04 -6.345837e-02 -6.725808e-04 -7.606287e-02 -4.850523e-03  8.671335e+00
   7.068289e-05 -6.072112e-03  1.245527e-03 -3.151877e-02 -3.933948e-04 -8.377111e-02  1.539550e-01
   2.924078e+00  1.001372e-02  3.458527e-03  7.607383e-04  1.760611e-03  1.383524e-03  5.091225e-02
   3.856762e-02  5.778893e-01  2.278884e-04 -4.198671e-03  3.988876e-04  4.102462e-02  1.139065e-03
   8.943004e-03  3.520276e-05  4.236934e-02  1.065990e-03  5.417424e-03  7.405094e-05  1.006212e-01
   2.837903e-04  1.025614e-02 -8.378921e-04 -2.693567e-01  2.710934e-04 -5.196110e-02  7.291063e-05
  -5.490081e-07 -4.864264e-10  1.434818e-07  2.678472e-09  8.884453e-06  3.733020e-07 -8.280757e-06
  -7.496239e-04 -5.288512e-03  1.223291e-04  4.510787e-03  3.630302e-03  3.406304e-01 -5.064643e-04
          [,22]         [,23]         [,24]         [,25]         [,26]         [,27]         [,28]
  -7.494510e-04  8.169953e-03  7.144633e-05  1.006995e-04  5.949262e-05  4.754224e-08 -2.932836e-05
  -6.317616e-05  9.687412e-02 -9.823935e-05  4.634144e-04  8.428063e-07  6.684307e-09  6.988533e-06
   1.018112e-03 -3.136806e-03 -9.255932e-06  2.530239e-04 -1.664917e-05  5.747741e-08 -1.963514e-05
   8.357567e-04  2.178719e-04 -1.075036e-05  6.782945e-04 -6.792660e-05  5.081872e-07  5.319037e-04
   3.389941e-02 -1.183260e-02  5.219847e-03 -3.924636e-02  7.375301e-04 -3.838214e-06 -2.692417e-04
   1.994890e-01  2.769589e-04 -6.619231e-03  4.410851e-04  9.490443e-04  2.281734e-08 -2.239010e-03
   2.612850e-07  1.878768e-04  2.165689e-07  2.115793e-07 -1.936110e-08 -2.759643e-11 -4.808137e-08
  -2.172784e-05  3.401809e-06  3.633024e-04  1.837322e-08  4.156107e-06 -1.107925e-12 -2.471294e-06
   2.787263e-03  2.631574e-03  5.253870e-04  1.071768e-01  7.534744e-04  2.643940e-07  2.727444e-04
  -1.603306e-02  5.955693e-04  6.611094e-03  4.588354e-03  8.731027e-02 -1.838551e-08 -1.034248e-03
   8.390177e-04 -5.548982e-04  7.766502e-05  1.560705e-03  1.654048e-04  4.720439e-06  2.346838e-03
  -1.504720e-06  2.977991e-08  1.309469e-07 -7.776654e-09 -1.159028e-06  9.410561e-12  1.229876e-05
  -7.962855e-04 -6.762885e-02 -2.651135e-05  1.547766e-02  1.123214e-03  7.046007e-08 -1.080354e-03
   5.432809e-01  5.447921e-04  5.626045e-03  1.676971e-03 -5.138385e-03  1.581500e-07 -1.755329e-02
   7.068289e-05  2.924078e+00  3.856762e-02  8.943004e-03  2.837903e-04 -5.490081e-07 -7.496239e-04
  -6.072112e-03  1.001372e-02  5.778893e-01  3.520276e-05  1.025614e-02 -4.864264e-10 -5.288512e-03
   1.245527e-03  3.458527e-03  2.278884e-04  4.236934e-02 -8.378921e-04  1.434818e-07  1.223291e-04
  -3.151877e-02  7.607383e-04 -4.198671e-03  1.065990e-03 -2.693567e-01  2.678472e-09  4.510787e-03
  -3.933948e-04  1.760611e-03  3.988876e-04  5.417424e-03  2.710934e-04  8.884453e-06  3.630302e-03
  -8.377111e-02  1.383524e-03  4.102462e-02  7.405094e-05 -5.196110e-02  3.733020e-07  3.406304e-01
   1.539550e-01  5.091225e-02  1.139065e-03  1.006212e-01  7.291063e-05 -8.280757e-06 -5.064643e-04
   6.386262e+00  1.030344e-03 -5.966447e-03  8.445894e-04  2.009516e-01  1.081214e-07 -1.443359e-01
   1.030344e-03  3.105909e+00  2.404869e-02  4.697770e-03  1.310977e-03  1.955576e-07 -6.578235e-04
  -5.966447e-03  2.404869e-02  2.437535e+00  2.347651e-06 -1.377986e-02  2.986450e-09 -1.406511e-02
   8.445894e-04  4.697770e-03  2.347651e-06  7.824234e-02 -2.463124e-03  2.532264e-09  1.661884e-04
   2.009516e-01  1.310977e-03 -1.377986e-02 -2.463124e-03  9.800043e-01  9.447840e-08  6.426981e-03
   1.081214e-07  1.955576e-07  2.986450e-09  2.532264e-09  9.447840e-08  5.679233e-05 -7.383096e-07
  -1.443359e-01 -6.578235e-04 -1.406511e-02  1.661884e-04  6.426981e-03 -7.383096e-07  6.310079e-01
          [,29]         [,30]         [,31]         [,32]         [,33]         [,34]         [,35]
  -1.728620e-02  4.915948e-04  1.370490e-03  1.316025e-04 -5.051627e-03  8.305357e-04 -2.416918e+00
   8.168352e-02  1.910039e-04 -6.318119e-03  9.413799e-05  3.006954e-02  1.171627e-04 -1.300793e+00
  -8.799556e-02 -2.550957e-04  3.200506e-03  2.191247e-04  1.599280e-02 -3.295337e-04 -1.487161e+00
  -1.277637e-02 -1.657296e-03  2.317459e-03  5.899133e-04  5.797676e-02 -3.327210e-03 -1.408451e+00
  -1.001046e-01  3.303645e-02 -1.043963e-01  1.422508e-02  1.954781e-03  3.931593e-02 -2.675274e+01
   2.146999e-03 -2.235130e-02  8.182145e-04  1.216603e-03  6.435757e-04  1.673685e-02 -5.789188e-01
  -1.087285e-05 -5.361425e-08 -8.365357e-06  6.402595e-07  8.433642e-06 -3.232011e-07 -1.191399e-03
  -6.434546e-07  3.371109e-05 -1.912569e-07 -1.183281e-04 -5.110674e-07  1.567518e-05 -9.321882e-04
   9.922870e-02  3.815046e-03  1.851736e-02  2.644450e-03  9.815461e-02  2.670743e-03 -3.302436e+00
  -3.393346e-03  1.217942e-02 -1.232550e-03  1.666439e-02 -4.616135e-03  9.570525e-03 -2.842589e+00
  -4.421501e-03  5.259171e-04  1.972192e-02 -4.236840e-04  1.035805e-01  2.790196e-05 -1.666341e+00
   8.627996e-07  3.494815e-06 -4.955435e-08 -6.269002e-06  1.162362e-07 -1.704904e-05 -1.400779e-04
   8.523022e-01 -5.418694e-03  1.200342e-01 -6.531862e-05  3.210475e-01 -1.331550e-02 -2.401139e+01
  -1.614168e-02  5.749038e-02 -2.735649e-03  9.304945e-02 -3.542529e-02  8.668604e-01 -1.717365e+01
   5.871420e-03 -1.236314e-03  1.476181e-01  4.579091e-02  2.388808e-01 -2.330675e-02 -3.321135e+01
  -5.736584e-03  6.308972e-02  6.577524e-04  1.576013e-02 -2.292191e-04 -6.249886e-03 -3.112460e+00
   9.500309e-02  1.633004e-03  6.021000e-02 -8.854823e-04  9.916253e-02 -2.375200e-03 -5.802650e+00
  -4.914047e-03 -2.821604e-01 -9.518177e-03 -8.187934e-01 -1.856565e-03 -1.124877e+00 -1.359522e+01
   1.137339e-01  9.762798e-04  1.360212e-02 -2.260512e-03  3.031421e-01 -1.426618e-03 -6.022106e+00
   6.118956e-02 -3.366006e-01  1.060161e-02 -4.538047e-01  2.528679e-02 -6.929985e-01 -1.018046e+01
   1.214331e-01  4.790491e-03 -2.586071e-01 -1.231978e-03 -7.157577e-01  8.633410e-03 -2.436597e+01
  -4.120117e-03 -7.048702e-02 -6.091438e-04 -3.171609e-01 -1.716519e-03 -1.016692e-01 -9.056666e+00
  -2.717570e-01  1.525364e-03  4.896323e-02  1.010079e-02 -1.173263e-01  3.172594e-03 -1.386230e+01
  -6.206100e-03 -1.257657e-01  7.147744e-05 -6.704679e-02 -1.175774e-03 -1.037371e-01 -4.799202e+00
   2.759373e-02  1.207553e-03  2.756418e-02 -1.943155e-03  1.819321e-02  1.061517e-03 -2.147538e+00
  -6.183219e-03 -1.474789e-01  2.449890e-04 -1.942918e-01  4.109374e-03 -6.494298e-02 -3.323144e+00
   5.122037e-06 -3.211159e-08  1.329951e-06  2.572285e-07  1.021388e-05 -8.907799e-08 -2.631901e-04
  -6.257743e-03  3.958461e-02 -5.718670e-03  2.328244e-01  2.149611e-03 -2.959794e-02 -2.485607e+00
 [ getOption("max.print") est atteint -- 7 lignes omises ]

Model rank =  6565 / 6565 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                          k'      edf k-index p-value
s(measurement.no)                                   9.00e+00 5.83e+00    1.02    0.92
s(measurement.no):toneBis.ord1                      9.00e+00 3.60e+00    1.02    0.92
s(measurement.no):toneBis.ord2                      9.00e+00 3.97e+00    1.02    0.91
s(measurement.no):toneBis.ord3                      9.00e+00 3.82e+00    1.02    0.93
s(measurement.no,speaker)                           1.00e+02 5.47e+01    1.02    0.96
s(measurement.no,speaker):toneBis.ord1              1.00e+02 4.54e-03    1.02    0.93
s(measurement.no,speaker):toneBis.ord2              1.00e+02 1.23e+01    1.02    0.96
s(measurement.no,speaker):toneBis.ord3              1.00e+02 3.33e+00    1.02    0.92
s(measurement.no,speakerLeftRightTone)              5.90e+02 8.24e+01    1.02    0.93
s(measurement.no,speakerLeftRightTone):toneBis.ord1 5.90e+02 7.26e+01    1.02    0.94
s(measurement.no,speakerLeftRightTone):toneBis.ord2 5.90e+02 3.88e+01    1.02    0.93
s(measurement.no,speakerLeftRightTone):toneBis.ord3 5.90e+02 3.24e+01    1.02    0.96
s(measurement.no,speakerPos)                        3.00e+02 6.68e+01    1.02    0.94
s(measurement.no,speakerPos):toneBis.ord1           3.00e+02 3.73e+01    1.02    0.94
s(measurement.no,speakerPos):toneBis.ord2           3.00e+02 1.09e+01    1.02    0.93
s(measurement.no,speakerPos):toneBis.ord3           3.00e+02 4.97e+00    1.02    0.94
s(measurement.no,word)                              6.30e+02 3.10e+02    1.02    0.92
s(measurement.no,wordPos)                           9.99e+02 1.70e+02    1.02    0.89
s(measurement.no,wordLeftRightTone)                 9.36e+02 2.27e+02    1.02    0.92

# Plotting
# Normalized scale

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1e, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", ylim = c(-1, 1), lwd = 4, xlab = "Time (normalized)", ylab = "F2 (Z)", xaxt = "n", font.lab = 2)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1e, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1e, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1e, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
legend("topright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

# Plotting
# Reconstructed scale
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1e, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", ylim = c(1400, 1800), xlab = "Time (ms)", ylab = "F2 (Hz)", xaxt = "n", font.lab = 2, add = F, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT1 * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2 + global_mean2, hide.label = TRUE)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1e, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT2 * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2 + global_mean2)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1e, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT3 * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2 + global_mean2)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1e, view="measurement.no",
             rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", lwd = 4, add = T, transform.view = function(measurement.no) measurement.no * durationT4 * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2 + global_mean2)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
legend("bottomright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

# Plotting
# Diffrence plot between tones
par(mfcol = c(2, 3), mar = c(2, 2, 2, 1), oma = c(4, 4, 2, 1)) 
plot_diff(gamm.model1e, view="measurement.no", comp=list(toneBis.ord = c("1","2")),rm.ranef=TRUE, main = "1-2", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.000000 - 2.020202
plot_diff(gamm.model1e, view="measurement.no",comp=list(toneBis.ord = c("1","3")),rm.ranef=TRUE, main = "1-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.000000 - 1.717172
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1e, view="measurement.no",comp=list(toneBis.ord = c("1","4")),rm.ranef=TRUE, main = "1-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
plot_diff(gamm.model1e, view="measurement.no",comp=list(toneBis.ord = c("2","3")),rm.ranef=TRUE, main = "2-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1e, view="measurement.no",comp=list(toneBis.ord = c("2","4")),rm.ranef=TRUE, main = "2-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.000000 - 1.919192
plot_diff(gamm.model1e, view="measurement.no",comp=list(toneBis.ord = c("3","4")),rm.ranef=TRUE, main = "3-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.000000 - 1.414141
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
mtext("Difference in F2 (Z)", side = 2, outer = TRUE, line = 2.5, cex = 1.2, font = 2)
mtext("Time (normalized)", side = 1, outer = TRUE, line = 2.5, cex = 1.2, font = 2)

plot_parametric(gamm.model1e, pred = list(toneBis.ord=c("1", "2", "3", "4")), xlab = "F2 (Z)", main = "Tone")
Summary:
    * toneBis.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; set to the value(s): 5. 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Model 1F: /ai/ female, F2 as output


gamm.model1f.noAR <- bam(f2Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                          
                        
                        
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                        
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                        
                        
                      data=data.ai.fem, method="fREML", discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1f.noAR, paste("Gamm_model1f_noAR.rds"))
gamm.model1f.noAR <- 
  readRDS("Gamm_model1f_noAR.rds")
r.gamm.model1f <- start_value_rho(gamm.model1f.noAR)
# Auto-regressive model

gamm.model1f <- bam(f2Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                          
                        
                        
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                    
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                        
                    
                      data=data.ai.fem, method="fREML", rho = r.gamm.model1f, AR.start = data.ai.fem$start, discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1f, paste("Gamm_model1f.rds"))
gamm.model1f <- 
  readRDS("Gamm_model1f.rds")
summary(gamm.model1f, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f2Zscore2 ~ toneBis.ord + s(measurement.no, bs = "cr") + s(measurement.no, 
    by = toneBis.ord, bs = "cr") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1, by = toneBis.ord) + s(measurement.no, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerPos, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, word, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordPos, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 3, m = 1)

Parametric coefficients:
             Estimate Std. Error t value Pr(>|t|)
(Intercept)   0.01759    0.06436   0.273    0.785
toneBis.ord1 -0.10687    0.24338  -0.439    0.661
toneBis.ord2  0.07739    0.12629   0.613    0.540
toneBis.ord3 -0.02991    0.16311  -0.183    0.854

Approximate significance of smooth terms:
                                 edf Ref.df     F  p-value    
s(measurement.no)              2.993  3.301 8.992 3.41e-06 ***
s(measurement.no):toneBis.ord1 1.698  1.920 1.032   0.2849    
s(measurement.no):toneBis.ord2 1.000  1.001 3.952   0.0468 *  
s(measurement.no):toneBis.ord3 1.262  1.360 1.279   0.2068    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.469   Deviance explained = 51.9%
fREML =  10968  Scale est. = 0.45463   n = 11198
gam.check(gamm.model1f)


Method: fREML   Optimizer: perf chol
$grad
 [1] -8.680216e-09 -3.818379e-08 -3.832142e-05 -2.706223e-07  2.075530e-06 -4.120451e-09 -5.147328e-05
 [8] -4.062929e-05 -4.213564e-05 -1.307415e-08 -3.909493e-05  1.569795e-07 -4.827928e-06  1.250390e-07
[15] -2.757438e-08 -2.751360e-08 -1.294878e-08  5.329621e-08 -4.373979e-05 -3.576229e-07 -3.297578e-07
[22]  5.353744e-10 -7.308002e-08 -1.399523e-08 -2.017717e-08 -3.045525e-09 -8.080303e-07  1.043800e-07
[29] -2.594111e-06 -1.904703e-07 -1.472385e-05  5.402271e-07 -2.314541e-06 -2.590902e-07  2.108991e-04

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]          [,7]
   5.217266e-01 -1.930705e-02 -3.226213e-05  8.397579e-03  3.502305e-01 -2.819300e-04 -3.039013e-07
  -1.930705e-02  1.520758e-01 -6.195473e-06  3.091282e-03  7.003164e-04 -4.871926e-04  3.531726e-07
  -3.226213e-05 -6.195473e-06  3.833632e-05  4.997395e-06  5.900655e-06 -7.992972e-08 -6.589872e-11
   8.397579e-03  3.091282e-03  4.997395e-06  1.477972e-02 -1.743697e-02  1.406031e-04  2.625273e-08
   3.502305e-01  7.003164e-04  5.900655e-06 -1.743697e-02  1.860259e+01  3.349125e-02  2.994159e-06
  -2.819300e-04 -4.871926e-04 -7.992972e-08  1.406031e-04  3.349125e-02  2.801516e-01 -2.402172e-08
  -3.039013e-07  3.531726e-07 -6.589872e-11  2.625273e-08  2.994159e-06 -2.402172e-08  5.147416e-05
   7.613186e-10  4.822612e-09  2.940762e-13  1.728462e-09  2.667247e-07 -6.602727e-07  5.204887e-13
  -1.109815e-06 -1.757666e-07  6.031342e-10  1.631168e-07  2.023175e-05 -8.595425e-08 -9.187162e-12
   2.165835e-05  3.484902e-05 -2.463351e-07  1.945314e-04  2.555953e-03 -4.144252e-02  2.336192e-09
   2.321810e-02  9.882114e-03  6.855199e-06  4.347112e-02 -5.462106e-01 -2.605900e-05  3.524206e-07
  -1.617145e-04 -1.543894e-04 -3.595463e-08 -4.685308e-04  9.308661e-07 -3.650114e-02 -5.786495e-10
   1.646267e-02  3.734402e-03  4.332693e-06 -4.723268e-04  7.219024e-01  9.611287e-04  1.184157e-06
   3.393494e-04 -7.691454e-04  6.592938e-08  2.845870e-04  4.839794e-02  3.149861e-01 -3.388703e-08
  -2.752228e-03  7.911465e-03 -6.700675e-07  2.698351e-04  2.883183e-02 -1.590480e-04  6.650317e-06
   2.302906e-05 -1.069552e-04 -1.736894e-08  4.606923e-05  1.415211e-03 -1.258425e-02  9.769980e-08
  -5.445899e-03 -1.462877e-03  5.236577e-06 -7.837374e-05  9.707050e-02  3.413423e-04 -1.584488e-07
   4.630002e-04  2.028613e-04  1.057648e-07 -2.348404e-04 -1.082255e-02 -2.751171e-02  3.961053e-09
   8.681042e-09  3.818900e-08  8.116081e-11  2.706613e-07 -2.075839e-06  4.120654e-09  3.189484e-12
  -4.795063e-05 -1.191310e-05  8.050279e-08 -7.326568e-05 -2.711915e-03 -5.484909e-03  4.460416e-09
   1.607131e-02 -1.545276e-03  7.384527e-07 -2.901245e-03  1.083799e+00  2.306361e-03 -1.522510e-07
  -4.780234e-05 -7.913123e-04 -1.812025e-07  1.439888e-04  2.615313e-02  2.091210e-01 -2.684044e-08
  -7.070520e-03 -1.624012e-02 -2.660129e-06  1.206649e-03  2.547314e-01 -1.610947e-03  5.395028e-05
  -2.325632e-04  1.614707e-03  2.176382e-08  9.042713e-05  4.385212e-03 -1.488950e-02  1.281461e-07
  -1.359850e-02 -3.804345e-03  1.142487e-05  4.752608e-03  3.439529e-01 -8.074640e-04 -2.795746e-07
  -5.751961e-05  1.297463e-05 -4.042180e-07  2.297452e-04 -1.115517e-03 -2.266220e-02 -1.965011e-09
   4.605224e-04  1.321624e-04  4.877003e-08  5.598466e-04 -2.588102e-03  1.596977e-05  4.000689e-09
  -9.803994e-05 -3.677274e-05 -5.865504e-08 -1.081200e-04 -1.143095e-03 -1.700310e-02 -1.658247e-09
           [,8]          [,9]         [,10]         [,11]         [,12]         [,13]         [,14]
   7.613186e-10 -1.109815e-06  2.165835e-05  2.321810e-02 -1.617145e-04  1.646267e-02  3.393494e-04
   4.822612e-09 -1.757666e-07  3.484902e-05  9.882114e-03 -1.543894e-04  3.734402e-03 -7.691454e-04
   2.940762e-13  6.031342e-10 -2.463351e-07  6.855199e-06 -3.595463e-08  4.332693e-06  6.592938e-08
   1.728462e-09  1.631168e-07  1.945314e-04  4.347112e-02 -4.685308e-04 -4.723268e-04  2.845870e-04
   2.667247e-07  2.023175e-05  2.555953e-03 -5.462106e-01  9.308661e-07  7.219024e-01  4.839794e-02
  -6.602727e-07 -8.595425e-08 -4.144252e-02 -2.605900e-05 -3.650114e-02  9.611287e-04  3.149861e-01
   5.204887e-13 -9.187162e-12  2.336192e-09  3.524206e-07 -5.786495e-10  1.184157e-06 -3.388703e-08
   4.062969e-05  6.404318e-13 -1.868238e-08 -1.833161e-08 -4.171554e-07  1.596543e-08  1.019625e-06
   6.404318e-13  4.213742e-05 -7.766648e-07  1.799308e-06  3.279861e-08 -9.358312e-08 -4.013356e-08
  -1.868238e-08 -7.766648e-07  9.569397e-01  3.284336e-04 -1.491467e-02  7.817115e-04 -5.723585e-03
  -1.833161e-08  1.799308e-06  3.284336e-04  1.007836e+01 -2.876165e-02  1.053684e-01 -8.568196e-03
  -4.171554e-07  3.279861e-08 -1.491467e-02 -2.876165e-02  1.482623e+00 -8.420342e-04  4.928133e-02
   1.596543e-08 -9.358312e-08  7.817115e-04  1.053684e-01 -8.420342e-04  2.156814e+00 -3.114549e-02
   1.019625e-06 -4.013356e-08 -5.723585e-03 -8.568196e-03  4.928133e-02 -3.114549e-02  6.436357e+00
  -1.218173e-07 -1.422349e-07  4.667344e-05  3.971283e-03  1.093213e-04  1.160420e-02 -4.796883e-04
  -2.199708e-06  7.523372e-09 -2.432069e-03  4.233643e-04  6.794024e-04 -1.019431e-03 -2.836515e-02
   3.951092e-09  6.409136e-06 -3.297880e-03  3.836047e-02  3.634853e-04 -5.563219e-02  1.260381e-03
  -8.798374e-08 -2.259283e-07  3.681986e-01  9.079782e-04 -1.015902e-02  8.939109e-04 -1.086346e-01
   1.324348e-13 -1.499435e-11  1.307617e-08  3.910114e-05 -1.570021e-07  4.828856e-06 -1.250639e-07
   2.861714e-09  3.504736e-09  2.459841e-03  2.825781e-03  3.063558e-01  2.109926e-03 -1.510518e-02
   2.382708e-08  3.401256e-06 -3.052525e-06  7.121528e-02  5.511540e-04 -5.782026e-02 -1.573032e-03
  -7.233151e-07 -7.321848e-09 -1.490678e-03  1.471578e-03 -3.916288e-03  2.558795e-03  3.641941e-01
   3.727995e-07 -6.899120e-07  2.748291e-04  5.797480e-03  1.379381e-04  9.859597e-02  2.057709e-03
  -1.535037e-06  3.014524e-08  5.747295e-05 -6.968471e-04 -1.005144e-02  1.908172e-03  4.606862e-02
   1.736802e-08  2.952453e-05 -1.182489e-02  1.437834e-02  2.174949e-04  1.072130e-01  3.257204e-03
  -2.391081e-07 -2.670192e-07  3.058719e-01  1.314776e-03 -1.231566e-02 -1.377482e-03 -1.364549e-01
   6.003146e-10  8.981157e-08 -7.205593e-06  9.115598e-02  1.198224e-05  5.523629e-03 -1.980450e-04
  -1.941430e-07 -1.955776e-08  1.631130e-03 -1.706391e-02  5.107935e-01 -1.918595e-03  2.283547e-03
          [,15]         [,16]         [,17]         [,18]         [,19]         [,20]         [,21]
  -2.752228e-03  2.302906e-05 -5.445899e-03  4.630002e-04  8.681042e-09 -4.795063e-05  1.607131e-02
   7.911465e-03 -1.069552e-04 -1.462877e-03  2.028613e-04  3.818900e-08 -1.191310e-05 -1.545276e-03
  -6.700675e-07 -1.736894e-08  5.236577e-06  1.057648e-07  8.116081e-11  8.050279e-08  7.384527e-07
   2.698351e-04  4.606923e-05 -7.837374e-05 -2.348404e-04  2.706613e-07 -7.326568e-05 -2.901245e-03
   2.883183e-02  1.415211e-03  9.707050e-02 -1.082255e-02 -2.075839e-06 -2.711915e-03  1.083799e+00
  -1.590480e-04 -1.258425e-02  3.413423e-04 -2.751171e-02  4.120654e-09 -5.484909e-03  2.306361e-03
   6.650317e-06  9.769980e-08 -1.584488e-07  3.961053e-09  3.189484e-12  4.460416e-09 -1.522510e-07
  -1.218173e-07 -2.199708e-06  3.951092e-09 -8.798374e-08  1.324348e-13  2.861714e-09  2.382708e-08
  -1.422349e-07  7.523372e-09  6.409136e-06 -2.259283e-07 -1.499435e-11  3.504736e-09  3.401256e-06
   4.667344e-05 -2.432069e-03 -3.297880e-03  3.681986e-01  1.307617e-08  2.459841e-03 -3.052525e-06
   3.971283e-03  4.233643e-04  3.836047e-02  9.079782e-04  3.910114e-05  2.825781e-03  7.121528e-02
   1.093213e-04  6.794024e-04  3.634853e-04 -1.015902e-02 -1.570021e-07  3.063558e-01  5.511540e-04
   1.160420e-02 -1.019431e-03 -5.563219e-02  8.939109e-04  4.828856e-06  2.109926e-03 -5.782026e-02
  -4.796883e-04 -2.836515e-02  1.260381e-03 -1.086346e-01 -1.250639e-07 -1.510518e-02 -1.573032e-03
   4.728008e-01 -4.813332e-02  6.629405e-04 -4.612784e-04  2.758058e-08 -7.913843e-05 -7.583509e-03
  -4.813332e-02  3.055625e+00 -4.440650e-04  2.514453e-02  2.751715e-08  2.632136e-02  3.624428e-04
   6.629405e-04 -4.440650e-04  5.873026e-01 -3.240744e-02  1.294204e-08  5.192854e-04  3.272084e-02
  -4.612784e-04  2.514453e-02 -3.240744e-02  4.660306e+00 -5.330293e-08 -3.424336e-02 -9.663715e-04
   2.758058e-08  2.751715e-08  1.294204e-08 -5.330293e-08  4.374049e-05  3.576644e-07  3.298218e-07
  -7.913843e-05  2.632136e-02  5.192854e-04 -3.424336e-02  3.576644e-07  8.867639e-01 -1.785381e-03
  -7.583509e-03  3.624428e-04  3.272084e-02 -9.663715e-04  3.298218e-07 -1.785381e-03  2.520589e+00
   3.436058e-04 -6.882789e-02  4.517116e-04  2.558457e-02 -5.358923e-10 -6.090648e-03 -8.585768e-02
   7.779636e-01  1.846493e-03 -9.492715e-03  1.023744e-03  7.309128e-08  3.013441e-05 -7.007399e-03
  -4.819446e-03  1.629859e-01  2.717590e-04 -1.016687e-04  1.399742e-08 -2.874120e-03  2.981017e-05
  -2.209965e-03  2.372833e-04  1.779642e-01 -9.030754e-03  2.016450e-08  4.528766e-04  5.028011e-01
  -6.217936e-06 -3.439337e-03 -2.515359e-03  4.955732e-02  3.046670e-09 -1.325350e-02 -5.296312e-03
   4.086530e-06  8.968962e-06  1.173718e-03 -1.707707e-04  8.081566e-07 -4.657195e-04  1.441468e-03
   9.244644e-05  2.655193e-03 -2.547562e-04  2.955204e-02 -1.043987e-07  1.037198e-01 -3.727596e-03
          [,22]         [,23]         [,24]         [,25]         [,26]         [,27]         [,28]
  -4.780234e-05 -7.070520e-03 -2.325632e-04 -1.359850e-02 -5.751961e-05  4.605224e-04 -9.803994e-05
  -7.913123e-04 -1.624012e-02  1.614707e-03 -3.804345e-03  1.297463e-05  1.321624e-04 -3.677274e-05
  -1.812025e-07 -2.660129e-06  2.176382e-08  1.142487e-05 -4.042180e-07  4.877003e-08 -5.865504e-08
   1.439888e-04  1.206649e-03  9.042713e-05  4.752608e-03  2.297452e-04  5.598466e-04 -1.081200e-04
   2.615313e-02  2.547314e-01  4.385212e-03  3.439529e-01 -1.115517e-03 -2.588102e-03 -1.143095e-03
   2.091210e-01 -1.610947e-03 -1.488950e-02 -8.074640e-04 -2.266220e-02  1.596977e-05 -1.700310e-02
  -2.684044e-08  5.395028e-05  1.281461e-07 -2.795746e-07 -1.965011e-09  4.000689e-09 -1.658247e-09
  -7.233151e-07  3.727995e-07 -1.535037e-06  1.736802e-08 -2.391081e-07  6.003146e-10 -1.941430e-07
  -7.321848e-09 -6.899120e-07  3.014524e-08  2.952453e-05 -2.670192e-07  8.981157e-08 -1.955776e-08
  -1.490678e-03  2.748291e-04  5.747295e-05 -1.182489e-02  3.058719e-01 -7.205593e-06  1.631130e-03
   1.471578e-03  5.797480e-03 -6.968471e-04  1.437834e-02  1.314776e-03  9.115598e-02 -1.706391e-02
  -3.916288e-03  1.379381e-04 -1.005144e-02  2.174949e-04 -1.231566e-02  1.198224e-05  5.107935e-01
   2.558795e-03  9.859597e-02  1.908172e-03  1.072130e-01 -1.377482e-03  5.523629e-03 -1.918595e-03
   3.641941e-01  2.057709e-03  4.606862e-02  3.257204e-03 -1.364549e-01 -1.980450e-04  2.283547e-03
   3.436058e-04  7.779636e-01 -4.819446e-03 -2.209965e-03 -6.217936e-06  4.086530e-06  9.244644e-05
  -6.882789e-02  1.846493e-03  1.629859e-01  2.372833e-04 -3.439337e-03  8.968962e-06  2.655193e-03
   4.517116e-04 -9.492715e-03  2.717590e-04  1.779642e-01 -2.515359e-03  1.173718e-03 -2.547562e-04
   2.558457e-02  1.023744e-03 -1.016687e-04 -9.030754e-03  4.955732e-02 -1.707707e-04  2.955204e-02
  -5.358923e-10  7.309128e-08  1.399742e-08  2.016450e-08  3.046670e-09  8.081566e-07 -1.043987e-07
  -6.090648e-03  3.013441e-05 -2.874120e-03  4.528766e-04 -1.325350e-02 -4.657195e-04  1.037198e-01
  -8.585768e-02 -7.007399e-03  2.981017e-05  5.028011e-01 -5.296312e-03  1.441468e-03 -3.727596e-03
   3.310900e+00  2.033160e-03 -8.632237e-02  1.991545e-03 -1.935478e-01 -8.062306e-05 -5.587930e-02
   2.033160e-03  1.538678e+01  7.028293e-02 -2.234707e-02  2.307943e-03 -2.184207e-05  5.552556e-04
  -8.632237e-02  7.028293e-02  3.461121e+00  1.783457e-04 -1.001350e-02  2.182243e-05 -8.557728e-03
   1.991545e-03 -2.234707e-02  1.783457e-04  3.292450e+00 -4.184621e-02  6.752231e-03 -3.201470e-05
  -1.935478e-01  2.307943e-03 -1.001350e-02 -4.184621e-02  2.467040e+00  1.432436e-04  1.201616e-02
  -8.062306e-05 -2.184207e-05  2.182243e-05  6.752231e-03  1.432436e-04  9.515830e-03  1.910125e-04
  -5.587930e-02  5.552556e-04 -8.557728e-03 -3.201470e-05  1.201616e-02  1.910125e-04  1.692993e+00
          [,29]         [,30]         [,31]         [,32]         [,33]         [,34]         [,35]
  -4.747372e-02  3.337757e-04 -5.418671e-03  4.361552e-04 -8.781344e-03  1.355612e-04 -9.964186e-01
   4.338458e-02 -2.286561e-03  3.225563e-02 -1.657239e-03  2.674596e-02 -9.082588e-04 -3.489283e-01
   2.123250e-05  2.014125e-06  9.459766e-06  6.666164e-07  1.840276e-05  2.585350e-07 -1.428383e-04
   1.233268e-02  1.473303e-04  5.694499e-03  2.511116e-04 -1.249822e-03 -1.267570e-04 -1.310067e-01
   2.602325e-01 -3.165838e-03 -1.789058e-02 -6.548626e-03 -6.975417e-02 -1.770740e-03 -2.640258e+01
  -3.933377e-03 -6.558814e-02 -3.409374e-03 -4.227723e-02 -1.558701e-04 -6.161006e-02 -1.083381e+00
   1.880510e-06  1.737619e-08  3.734035e-06  8.451515e-09  1.209781e-06 -4.415712e-08 -2.045015e-04
  -9.256016e-08  3.593163e-06  1.127717e-07  4.895491e-06 -8.009378e-08 -2.099717e-06 -4.555024e-05
   1.617998e-06  1.266259e-07 -3.290745e-06 -1.455549e-07  6.832467e-06  2.447451e-07 -2.497555e-04
  -3.313858e-03 -2.050332e-01 -7.525615e-04 -1.239484e-01  2.250413e-03 -8.866007e-02 -2.060179e+00
  -2.347254e-01 -1.041339e-02  5.520654e-01 -9.369219e-03  1.838998e-02 -7.607017e-03 -1.685662e+01
   1.048434e-02 -1.044820e-01  3.240730e-03 -4.986571e-02  2.328300e-03 -4.790406e-02 -2.313245e+00
  -1.566408e-01 -6.806189e-03  4.001113e-02 -8.458014e-03  3.329030e-02 -8.507843e-03 -1.455140e+01
  -1.291251e-02 -3.642201e-02 -2.424088e-03  7.826512e-02 -1.000503e-02 -6.166251e-01 -1.481612e+01
   2.332050e-02 -2.733424e-03  3.963072e-02  1.159562e-03 -4.736459e-02  2.169779e-03 -6.155394e+00
  -2.738249e-02 -1.557734e-02 -1.377524e-02  9.622281e-02 -1.082357e-02 -1.048492e-01 -5.121165e+00
   6.985141e-02 -8.414637e-04  1.849721e-02  1.911055e-03  1.819945e-01  1.168761e-03 -6.559820e+00
  -1.490551e-02  1.263609e-01 -1.007583e-02  1.283007e-01 -2.835415e-02 -2.762107e-02 -1.055743e+01
   2.594697e-06  1.905009e-07  1.472650e-05 -5.403156e-07  2.315052e-06  2.591308e-07 -2.109292e-04
   9.852282e-04 -3.698872e-01 -3.919506e-03  6.721700e-02  4.378847e-03 -8.939731e-02 -2.829340e+00
   3.828670e-01 -2.649899e-04  1.974183e-01 -1.426923e-03  1.112492e-01  3.462102e-03 -1.197483e+01
  -9.202884e-04 -1.680494e-01 -9.393852e-03 -7.746791e-02  5.855954e-03 -9.722956e-02 -5.848163e+00
  -1.777997e-01 -1.259961e-03  5.495508e-02 -6.984099e-03  1.789517e-01  9.278401e-04 -4.013049e+01
  -5.683042e-05 -3.781561e-02  1.895281e-03  1.577835e-01 -3.637657e-03 -1.105895e-02 -5.261157e+00
  -5.429765e-02  1.224458e-03  3.876620e-01  8.853239e-03  2.208250e-01  7.029536e-03 -1.467221e+01
  -2.774000e-03 -2.155534e-01  5.910518e-03 -1.760124e-01  7.430681e-04  1.183353e-01 -5.101052e+00
  -1.547499e-02 -2.477674e-04  3.447358e-03  2.446402e-04 -3.410851e-04  1.363043e-04 -6.138985e-01
   1.338352e-02  5.249003e-02 -1.413601e-02  1.360782e-01  5.228264e-03 -1.091880e-01 -4.476002e+00
 [ getOption("max.print") est atteint -- 7 lignes omises ]

Model rank =  6427 / 6427 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                          k'      edf k-index p-value
s(measurement.no)                                   9.00e+00 2.99e+00       1    0.35
s(measurement.no):toneBis.ord1                      9.00e+00 1.70e+00       1    0.36
s(measurement.no):toneBis.ord2                      9.00e+00 1.00e+00       1    0.36
s(measurement.no):toneBis.ord3                      9.00e+00 1.26e+00       1    0.34
s(measurement.no,speaker)                           1.00e+02 5.50e+01       1    0.40
s(measurement.no,speaker):toneBis.ord1              1.00e+02 6.84e-04       1    0.36
s(measurement.no,speaker):toneBis.ord2              1.00e+02 4.12e+00       1    0.38
s(measurement.no,speaker):toneBis.ord3              1.00e+02 3.83e+01       1    0.34
s(measurement.no,speakerLeftRightTone)              5.90e+02 5.87e+01       1    0.36
s(measurement.no,speakerLeftRightTone):toneBis.ord1 5.90e+02 2.26e+01       1    0.45
s(measurement.no,speakerLeftRightTone):toneBis.ord2 5.90e+02 3.42e+01       1    0.34
s(measurement.no,speakerLeftRightTone):toneBis.ord3 5.90e+02 5.66e+00       1    0.38
s(measurement.no,speakerPos)                        3.00e+02 3.56e+01       1    0.33
s(measurement.no,speakerPos):toneBis.ord1           3.00e+02 9.08e+01       1    0.32
s(measurement.no,speakerPos):toneBis.ord2           3.00e+02 3.95e+01       1    0.39
s(measurement.no,speakerPos):toneBis.ord3           3.00e+02 1.02e+01       1    0.41
s(measurement.no,word)                              6.15e+02 2.60e+02       1    0.35
s(measurement.no,wordPos)                           9.33e+02 1.99e+02       1    0.34
s(measurement.no,wordLeftRightTone)                 8.79e+02 1.90e+02       1    0.34

# Plotting
# Normalized scale

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1f, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", ylim = c(-1, 1), lwd = 4, xlab = "Time (normalized)", ylab = "F2 (Z)", xaxt = "n", font.lab = 2)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1f, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1f, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1f, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
legend("topright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

# Plotting 
# Reconstructed scale
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1f, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", ylim = c(1700, 2050), xlab = "Time (ms)", ylab = "F2 (Hz)", xaxt = "n", font.lab = 2, add = F, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT2f * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2f + global_mean2f, hide.label = TRUE)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1f, view="measurement.no",
             rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", lwd = 4, add = T, transform.view = function(measurement.no) measurement.no * durationT4f * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2f + global_mean2f)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1f, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT1f * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2f + global_mean2f)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1f, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT3f * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2f + global_mean2f)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
legend("bottomright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

# Plotting
# Diffrence plot between tones
par(mfcol = c(2, 3), mar = c(2, 2, 2, 1), oma = c(4, 4, 2, 1)) 
plot_diff(gamm.model1f, view="measurement.no", comp=list(toneBis.ord = c("1","2")),rm.ranef=TRUE, main = "1-2", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
plot_diff(gamm.model1f, view="measurement.no",comp=list(toneBis.ord = c("1","3")),rm.ranef=TRUE, main = "1-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1f, view="measurement.no",comp=list(toneBis.ord = c("1","4")),rm.ranef=TRUE, main = "1-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
plot_diff(gamm.model1f, view="measurement.no",comp=list(toneBis.ord = c("2","3")),rm.ranef=TRUE, main = "2-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1f, view="measurement.no",comp=list(toneBis.ord = c("2","4")),rm.ranef=TRUE, main = "2-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
plot_diff(gamm.model1f, view="measurement.no",comp=list(toneBis.ord = c("3","4")),rm.ranef=TRUE, main = "3-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
mtext("Difference in F2 (Z)", side = 2, outer = TRUE, line = 2.5, cex = 1.2, font = 2)
mtext("Time (normalized)", side = 1, outer = TRUE, line = 2.5, cex = 1.2, font = 2)

plot_parametric(gamm.model1f, pred = list(toneBis.ord=c("1", "2", "3", "4")), xlab = "F2 (Z)", main = "Tone")
Summary:
    * toneBis.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; set to the value(s): 5. 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Model 1G: /au/ male, F2 as output


gamm.model1g.noAR <- bam(f2Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                        
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                        
                      data=data.au.mas, method="fREML", discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1g.noAR, paste("Gamm_model1g_noAR.rds"))
gamm.model1g.noAR <- 
  readRDS("Gamm_model1g_noAR.rds")
r.gamm.model1g <- start_value_rho(gamm.model1g.noAR)
# Auto-regressive model

gamm.model1g <- bam(f2Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                        
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                    
                      data=data.au.mas, method="fREML", rho = r.gamm.model1g, AR.start = data.au.mas$start, discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1g, paste("Gamm_model1g.rds"))
gamm.model1g <- 
  readRDS("Gamm_model1g.rds")
summary(gamm.model1g, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f2Zscore2 ~ toneBis.ord + s(measurement.no, bs = "cr") + s(measurement.no, 
    by = toneBis.ord, bs = "cr") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1, by = toneBis.ord) + s(measurement.no, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerPos, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, word, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordPos, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 3, m = 1)

Parametric coefficients:
             Estimate Std. Error t value Pr(>|t|)  
(Intercept)   0.04924    0.06351   0.775   0.4381  
toneBis.ord1 -0.19064    0.10813  -1.763   0.0779 .
toneBis.ord2 -0.19199    0.16524  -1.162   0.2453  
toneBis.ord3 -0.09237    0.13347  -0.692   0.4889  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
                                 edf Ref.df      F p-value    
s(measurement.no)              7.165  7.777 54.388  <2e-16 ***
s(measurement.no):toneBis.ord1 1.616  1.831  0.119   0.854    
s(measurement.no):toneBis.ord2 1.698  1.966  0.519   0.593    
s(measurement.no):toneBis.ord3 2.001  2.377  1.142   0.274    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.726   Deviance explained =   77%
fREML = 9170.2  Scale est. = 0.24868   n = 10857
gam.check(gamm.model1g)


Method: fREML   Optimizer: perf chol
$grad
 [1]  2.229328e-13 -1.039169e-13 -1.226241e-13  4.013456e-13 -5.329071e-15 -2.220446e-14  9.592327e-14
 [8]  1.310063e-14 -4.903654e-05 -7.888230e-05 -9.703349e-14  7.105427e-14 -3.197442e-13  1.207923e-13
[15] -1.350031e-13  2.486900e-13 -5.989232e-05 -7.860379e-14 -9.947598e-14  3.019807e-14  3.197442e-14
[22] -4.796163e-14 -6.579657e-05 -5.042393e-05  1.030287e-13  4.618528e-14  5.329071e-14  1.394440e-13
[29] -3.126388e-13 -1.008971e-12  1.421085e-13  4.689582e-13 -5.684342e-14  7.105427e-13  9.094947e-12

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]          [,7]
   3.437874e+00  2.316266e-02  2.018002e-02 -5.515869e-02 -6.066135e-02  4.707938e-06  9.395319e-03
   2.316266e-02  3.980832e-02 -1.062052e-02  2.157234e-02 -2.195134e-03 -4.651760e-05  4.614615e-02
   2.018002e-02 -1.062052e-02  1.623651e-01  4.053160e-02 -1.583566e-02  4.027810e-05 -5.065022e-04
  -5.515869e-02  2.157234e-02  4.053160e-02  2.885601e-01 -4.320236e-03  1.940318e-04  3.109130e-03
  -6.066135e-02 -2.195134e-03 -1.583566e-02 -4.320236e-03  2.412681e+00  6.689216e-03 -1.198989e-02
   4.707938e-06 -4.651760e-05  4.027810e-05  1.940318e-04  6.689216e-03  1.311127e+00  1.126068e-04
   9.395319e-03  4.614615e-02 -5.065022e-04  3.109130e-03 -1.198989e-02  1.126068e-04  1.795085e+00
   3.562528e-05  1.518743e-04 -7.633376e-06  5.644838e-05  9.770154e-04 -1.140562e-01  5.546141e-03
  -1.505581e-07  1.627740e-08 -5.316040e-07  1.365900e-07  9.245564e-07  9.501505e-09 -4.452620e-07
  -7.305871e-10  7.964168e-10  7.802123e-08  2.524896e-08 -3.195785e-08 -4.947116e-06 -6.925460e-09
  -8.451302e-04  2.044229e-04  4.937841e-04  9.478053e-04  2.268942e-03  3.217867e-05  3.799916e-04
  -3.168470e-05  8.746443e-06 -1.699352e-05 -2.364217e-04 -8.192527e-05 -4.396729e-02 -5.381943e-05
   6.200292e-03  1.317073e-02 -3.688721e-02 -1.329708e-02  1.121849e+00  4.031927e-03  7.156981e-02
  -6.926706e-05 -2.536088e-04  1.979158e-04  3.175109e-04  2.513075e-03  7.862587e-01 -2.660659e-04
   1.726737e-02  6.078346e-02 -3.682938e-03  9.445019e-03 -4.419676e-02 -1.133598e-03  2.439917e+00
   3.764560e-05  2.628084e-04 -5.372063e-05  2.126977e-04  1.483001e-03 -1.659597e-01  9.683060e-03
   3.076055e-08 -1.095645e-07  1.651019e-06  8.091615e-07  1.465533e-06  1.335006e-08 -1.128683e-06
  -3.894257e-05  2.687697e-05  1.729336e-04  4.764481e-05  1.094681e-04 -3.718060e-02 -2.018863e-04
   4.130878e-04 -1.087641e-03  6.326398e-03 -3.768399e-02 -7.981084e-03  6.366140e-04 -7.120429e-03
   2.107742e-05 -5.743470e-06  8.947987e-04 -2.717772e-04  1.678862e-03  1.939915e-03  5.401216e-04
  -4.975967e-02  1.673679e-02 -1.892785e-03 -1.727756e-02  1.242058e+00  1.890168e-03  1.368316e-01
  -7.544341e-05  1.151636e-04 -2.561342e-04  1.642415e-04 -3.447386e-04  2.339544e-01 -2.203239e-04
   6.368708e-07  2.135991e-06 -9.643205e-08  2.181347e-07  2.550577e-06  7.479623e-09  5.762013e-05
   5.573879e-09  1.694732e-08 -2.672746e-10  7.137451e-09  5.257411e-08 -4.216054e-06 -1.881824e-07
  -5.524864e-03 -1.595370e-03  1.310796e-02  2.243005e-02  8.161436e-02  9.707901e-04 -3.689276e-02
   3.157755e-06  3.499191e-06  7.249782e-04  4.215737e-04  1.203485e-04 -9.100894e-03 -4.298606e-05
  -1.806840e-02  4.151006e-03 -1.477690e-03  2.640669e-02  9.901812e-02  1.390322e-03  2.649766e-02
  -2.661150e-04  1.332405e-04  1.843904e-04 -1.315551e-03  3.202030e-04 -5.662848e-03  3.045579e-04
           [,8]          [,9]         [,10]         [,11]         [,12]         [,13]         [,14]
   3.562528e-05 -1.505581e-07 -7.305871e-10 -8.451302e-04 -3.168470e-05  6.200292e-03 -6.926706e-05
   1.518743e-04  1.627740e-08  7.964168e-10  2.044229e-04  8.746443e-06  1.317073e-02 -2.536088e-04
  -7.633376e-06 -5.316040e-07  7.802123e-08  4.937841e-04 -1.699352e-05 -3.688721e-02  1.979158e-04
   5.644838e-05  1.365900e-07  2.524896e-08  9.478053e-04 -2.364217e-04 -1.329708e-02  3.175109e-04
   9.770154e-04  9.245564e-07 -3.195785e-08  2.268942e-03 -8.192527e-05  1.121849e+00  2.513075e-03
  -1.140562e-01  9.501505e-09 -4.947116e-06  3.217867e-05 -4.396729e-02  4.031927e-03  7.862587e-01
   5.546141e-03 -4.452620e-07 -6.925460e-09  3.799916e-04 -5.381943e-05  7.156981e-02 -2.660659e-04
   4.739546e-01 -4.754952e-09 -1.458317e-06 -6.702921e-06 -2.052291e-03 -6.283709e-04 -4.769456e-02
  -4.754952e-09  4.903668e-05  2.026651e-11  1.758484e-08 -2.847634e-09  3.211098e-07  2.947175e-09
  -1.458317e-06  2.026651e-11  7.888903e-05  1.439876e-09 -1.851590e-06 -2.050451e-08  2.965460e-06
  -6.702921e-06  1.758484e-08  1.439876e-09  4.261686e-03  3.264167e-04 -1.194758e-02  3.281816e-05
  -2.052291e-03 -2.847634e-09 -1.851590e-06  3.264167e-04  1.044634e+00  3.366967e-04 -5.496669e-02
  -6.283709e-04  3.211098e-07 -2.050451e-08 -1.194758e-02  3.366967e-04  1.226825e+01  7.700868e-02
  -4.769456e-02  2.947175e-09  2.965460e-06  3.281816e-05 -5.496669e-02  7.700868e-02  1.048073e+01
   6.964696e-03 -6.915297e-07 -1.557946e-08  1.373393e-04 -3.100722e-05  7.738119e-01  1.038945e-02
   5.094348e-01 -6.350002e-10 -1.421767e-07  9.778121e-06  1.454865e-02  3.013264e-03 -2.970130e-03
  -1.006685e-08  3.523436e-10  4.716587e-11  8.854692e-08 -6.256216e-09  8.265483e-07  1.024402e-08
  -1.553169e-02  1.200411e-07  4.348406e-05 -1.156317e-06  4.271824e-03  4.617527e-04 -1.257342e-01
   1.463290e-04  1.116032e-06  7.689642e-08  6.150664e-02  2.798424e-03 -3.992483e-01 -1.138000e-03
   1.474212e-02  2.869437e-10 -8.815555e-06  2.459809e-04  3.223812e-01  3.147687e-03 -3.882249e-01
  -2.564841e-04  6.535536e-07 -4.457709e-08 -2.089977e-04 -2.569032e-04  6.422756e-01  3.763017e-03
  -1.272270e-03  3.426163e-09  1.087427e-06 -1.232699e-05  3.093683e-02  7.003735e-04  3.476545e-01
   1.217399e-07 -2.562365e-12 -7.880084e-13  2.600275e-08 -7.652363e-09 -3.768505e-06  3.490936e-07
   1.372942e-05 -3.541337e-13 -3.450176e-11 -9.090443e-11 -7.768342e-08 -7.261994e-08 -8.597461e-06
  -2.824487e-04  1.063025e-05  1.483455e-06  4.661171e-03 -6.884880e-04 -2.115217e-01 -9.364835e-04
  -8.136509e-03  8.770457e-08  4.047443e-05  3.713670e-05 -1.379101e-02 -2.773177e-04 -3.657457e-02
   4.105578e-05  1.051161e-06  5.323889e-08  8.921723e-02  6.708379e-03 -1.844980e-01  1.048615e-03
   4.720731e-03  1.542600e-08  3.682382e-06  1.282240e-04  3.301771e-01  1.360682e-03 -4.707971e-02
          [,15]         [,16]         [,17]         [,18]         [,19]         [,20]         [,21]
   1.726737e-02  3.764560e-05  3.076055e-08 -3.894257e-05  4.130878e-04  2.107742e-05 -4.975967e-02
   6.078346e-02  2.628084e-04 -1.095645e-07  2.687697e-05 -1.087641e-03 -5.743470e-06  1.673679e-02
  -3.682938e-03 -5.372063e-05  1.651019e-06  1.729336e-04  6.326398e-03  8.947987e-04 -1.892785e-03
   9.445019e-03  2.126977e-04  8.091615e-07  4.764481e-05 -3.768399e-02 -2.717772e-04 -1.727756e-02
  -4.419676e-02  1.483001e-03  1.465533e-06  1.094681e-04 -7.981084e-03  1.678862e-03  1.242058e+00
  -1.133598e-03 -1.659597e-01  1.335006e-08 -3.718060e-02  6.366140e-04  1.939915e-03  1.890168e-03
   2.439917e+00  9.683060e-03 -1.128683e-06 -2.018863e-04 -7.120429e-03  5.401216e-04  1.368316e-01
   6.964696e-03  5.094348e-01 -1.006685e-08 -1.553169e-02  1.463290e-04  1.474212e-02 -2.564841e-04
  -6.915297e-07 -6.350002e-10  3.523436e-10  1.200411e-07  1.116032e-06  2.869437e-10  6.535536e-07
  -1.557946e-08 -1.421767e-07  4.716587e-11  4.348406e-05  7.689642e-08 -8.815555e-06 -4.457709e-08
   1.373393e-04  9.778121e-06  8.854692e-08 -1.156317e-06  6.150664e-02  2.459809e-04 -2.089977e-04
  -3.100722e-05  1.454865e-02 -6.256216e-09  4.271824e-03  2.798424e-03  3.223812e-01 -2.569032e-04
   7.738119e-01  3.013264e-03  8.265483e-07  4.617527e-04 -3.992483e-01  3.147687e-03  6.422756e-01
   1.038945e-02 -2.970130e-03  1.024402e-08 -1.257342e-01 -1.138000e-03 -3.882249e-01  3.763017e-03
   1.201541e+01  5.469194e-02 -1.685569e-06 -8.880102e-05  6.289388e-02 -9.079899e-04  4.368643e-01
   5.469194e-02  4.042026e+00  4.713961e-09 -1.747234e-02  7.489288e-04  9.669501e-03  2.627193e-03
  -1.685569e-06  4.713961e-09  5.989440e-05  6.459432e-07  8.302777e-07  7.707207e-08  4.379773e-06
  -8.880102e-05 -1.747234e-02  6.459432e-07  1.787920e+00  8.224739e-05 -1.794346e-02 -3.161759e-04
   6.289388e-02  7.489288e-04  8.302777e-07  8.224739e-05  4.163459e+00  2.143289e-03 -1.517120e-01
  -9.079899e-04  9.669501e-03  7.707207e-08 -1.794346e-02  2.143289e-03  7.773279e+00  7.615210e-04
   4.368643e-01  2.627193e-03  4.379773e-06 -3.161759e-04 -1.517120e-01  7.615210e-04  6.381873e+00
  -2.551545e-03 -1.757162e-01  4.317841e-09 -5.963117e-03 -1.395542e-04  4.836602e-02 -1.706296e-02
   1.057619e-04  8.334761e-07 -1.452046e-11 -2.574785e-08  9.327295e-07  1.673359e-08  5.122834e-05
  -3.632611e-07 -7.706134e-06 -1.317324e-12 -7.595148e-07  6.123641e-09  1.629840e-06  1.724851e-07
  -5.177068e-02 -1.254979e-05  3.862083e-05  1.175347e-02  7.325413e-02 -1.978241e-04  1.997388e-02
  -1.531191e-04 -1.769128e-02  2.499450e-07  1.872743e-01  1.263834e-03 -6.983178e-02  3.903511e-04
   1.596218e-02 -2.769383e-05  1.444847e-07  1.005949e-03  2.096324e+00  8.294863e-04 -1.316587e-01
   1.096983e-03  1.790163e-02  2.165260e-08 -4.448259e-04  1.546872e-03  2.084293e-01 -7.516814e-04
          [,22]         [,23]         [,24]         [,25]         [,26]         [,27]         [,28]
  -7.544341e-05  6.368708e-07  5.573879e-09 -5.524864e-03  3.157755e-06 -1.806840e-02 -2.661150e-04
   1.151636e-04  2.135991e-06  1.694732e-08 -1.595370e-03  3.499191e-06  4.151006e-03  1.332405e-04
  -2.561342e-04 -9.643205e-08 -2.672746e-10  1.310796e-02  7.249782e-04 -1.477690e-03  1.843904e-04
   1.642415e-04  2.181347e-07  7.137451e-09  2.243005e-02  4.215737e-04  2.640669e-02 -1.315551e-03
  -3.447386e-04  2.550577e-06  5.257411e-08  8.161436e-02  1.203485e-04  9.901812e-02  3.202030e-04
   2.339544e-01  7.479623e-09 -4.216054e-06  9.707901e-04 -9.100894e-03  1.390322e-03 -5.662848e-03
  -2.203239e-04  5.762013e-05 -1.881824e-07 -3.689276e-02 -4.298606e-05  2.649766e-02  3.045579e-04
  -1.272270e-03  1.217399e-07  1.372942e-05 -2.824487e-04 -8.136509e-03  4.105578e-05  4.720731e-03
   3.426163e-09 -2.562365e-12 -3.541337e-13  1.063025e-05  8.770457e-08  1.051161e-06  1.542600e-08
   1.087427e-06 -7.880084e-13 -3.450176e-11  1.483455e-06  4.047443e-05  5.323889e-08  3.682382e-06
  -1.232699e-05  2.600275e-08 -9.090443e-11  4.661171e-03  3.713670e-05  8.921723e-02  1.282240e-04
   3.093683e-02 -7.652363e-09 -7.768342e-08 -6.884880e-04 -1.379101e-02  6.708379e-03  3.301771e-01
   7.003735e-04 -3.768505e-06 -7.261994e-08 -2.115217e-01 -2.773177e-04 -1.844980e-01  1.360682e-03
   3.476545e-01  3.490936e-07 -8.597461e-06 -9.364835e-04 -3.657457e-02  1.048615e-03 -4.707971e-02
  -2.551545e-03  1.057619e-04 -3.632611e-07 -5.177068e-02 -1.531191e-04  1.596218e-02  1.096983e-03
  -1.757162e-01  8.334761e-07 -7.706134e-06 -1.254979e-05 -1.769128e-02 -2.769383e-05  1.790163e-02
   4.317841e-09 -1.452046e-11 -1.317324e-12  3.862083e-05  2.499450e-07  1.444847e-07  2.165260e-08
  -5.963117e-03 -2.574785e-08 -7.595148e-07  1.175347e-02  1.872743e-01  1.005949e-03 -4.448259e-04
  -1.395542e-04  9.327295e-07  6.123641e-09  7.325413e-02  1.263834e-03  2.096324e+00  1.546872e-03
   4.836602e-02  1.673359e-08  1.629840e-06 -1.978241e-04 -6.983178e-02  8.294863e-04  2.084293e-01
  -1.706296e-02  5.122834e-05  1.724851e-07  1.997388e-02  3.903511e-04 -1.316587e-01 -7.516814e-04
   2.196855e+00 -6.006520e-07 -6.206556e-07 -1.548556e-03 -1.956458e-01 -1.280320e-03 -3.319614e-01
  -6.006520e-07  6.580981e-05 -3.654483e-11  1.677686e-06 -4.933806e-08  7.725429e-07 -3.599597e-08
  -6.206556e-07 -3.654483e-11  5.042602e-05 -4.414987e-08 -1.261128e-06  5.156091e-09  8.111764e-07
  -1.548556e-03  1.677686e-06 -4.414987e-08  6.709925e+00  5.329479e-02  8.642176e-02  1.979182e-03
  -1.956458e-01 -4.933806e-08 -1.261128e-06  5.329479e-02  2.156669e+00  1.112837e-03  1.328819e-02
  -1.280320e-03  7.725429e-07  5.156091e-09  8.642176e-02  1.112837e-03  7.967526e+00  5.692828e-03
  -3.319614e-01 -3.599597e-08  8.111764e-07  1.979182e-03  1.328819e-02  5.692828e-03  4.696572e+00
          [,29]         [,30]         [,31]         [,32]         [,33]         [,34]         [,35]
   1.163646e-02 -2.188569e-04  1.384030e-02  4.125753e-04  2.297420e-02 -1.364179e-04 -3.082698e+00
  -2.710885e-02  3.038571e-04 -4.188369e-02 -2.447702e-04 -4.460484e-02  3.996755e-05 -3.077556e-01
   5.811125e-02 -2.917499e-04  1.671158e-02 -5.151884e-04 -5.437552e-02  4.881909e-04 -3.489790e-01
   6.089001e-02 -1.374553e-04  3.397011e-02  5.511413e-04  3.513849e-02  2.334519e-03 -5.003965e-01
  -1.229868e-02  5.314826e-03 -1.029640e-01  3.437312e-03  4.422363e-02  2.151496e-03 -8.700154e+00
   9.824874e-04 -5.295970e-02  3.702037e-05 -1.907415e-01  2.056159e-03 -1.317421e-01 -2.465283e+00
  -2.920378e-02 -2.196896e-03  6.687497e-02 -1.784388e-03 -1.741749e-01 -2.235248e-04 -7.382928e+00
   1.524239e-03 -7.464410e-02  9.422477e-04 -6.590795e-02  2.669401e-03  1.385551e-02 -1.308684e+00
   8.663802e-07  4.574252e-08 -2.567976e-06 -1.431636e-08  2.050524e-07  3.747505e-08 -8.270227e-05
   1.176618e-07 -5.556982e-06  2.463770e-07 -1.972180e-05 -9.632058e-08 -1.044966e-05 -1.852579e-04
   5.902653e-03 -6.322036e-05  1.896552e-02 -7.254751e-05  8.093250e-03  1.067883e-05 -3.279158e-01
   2.664065e-04 -3.265108e-01 -2.530802e-03  6.964577e-02  3.757299e-03  1.256601e-01 -2.124746e+00
   4.006361e-01  2.401440e-03  4.435018e-01  3.171134e-03  1.718547e+00 -4.395128e-04 -4.029830e+01
  -1.119001e-03 -9.524887e-01  6.070144e-04 -2.621125e-01  2.795584e-02 -2.727400e-01 -1.621998e+01
   4.843734e-01  1.277907e-04  5.999173e-01  9.479997e-03  7.503544e-01  1.318917e-03 -3.813422e+01
   1.615325e-03  1.317023e-01  4.936278e-03 -1.653512e-01  1.717751e-02  2.224564e-01 -8.852333e+00
   2.156973e-05  1.531343e-07  1.216068e-05  3.237014e-08  2.347271e-05  2.333424e-07 -3.553942e-04
   4.596092e-03  3.892882e-01  7.690336e-03  2.065172e-01  9.789057e-03  2.340366e-01 -3.969899e+00
   3.602447e-01  1.319812e-04  3.877252e-01 -8.422117e-04  2.043456e+00  2.542471e-04 -1.895627e+01
   1.145925e-03 -1.516239e+00 -2.342256e-02  2.249494e+00  1.956533e-02  4.084740e-01 -1.378275e+01
   5.961189e-03  6.372762e-03 -1.804802e-01  3.859804e-03  1.178360e-01  2.061606e-03 -2.150542e+01
   8.753924e-04 -5.096577e-01  8.267062e-03 -1.487580e-01 -3.576956e-03 -5.207596e-02 -5.046148e+00
  -4.041343e-08  4.452367e-08  4.030344e-05  4.795860e-07 -1.185712e-05 -7.455456e-07 -8.628078e-04
   1.659950e-07  5.315215e-06  5.092938e-08  1.455300e-05  8.230839e-07  2.047104e-05 -1.994034e-04
   1.403369e-01  5.380428e-03 -2.327774e-01  1.238792e-02  2.722891e-01  5.228962e-03 -2.433305e+01
   2.394346e-03  4.751751e-02  6.237748e-03  2.248064e-01  4.839937e-03  1.971381e-01 -4.246845e+00
   1.442915e-02 -1.070577e-03 -1.127369e-01 -4.036508e-03  6.703618e-03 -3.794700e-03 -2.351528e+01
   1.986515e-03 -7.995356e-01 -6.053670e-03 -3.215859e-01 -7.179484e-03 -1.594099e-02 -7.194074e+00
 [ getOption("max.print") est atteint -- 7 lignes omises ]

Model rank =  7802 / 7802 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                          k'      edf k-index p-value
s(measurement.no)                                   9.00e+00 7.17e+00    1.02    0.94
s(measurement.no):toneBis.ord1                      9.00e+00 1.62e+00    1.02    0.93
s(measurement.no):toneBis.ord2                      9.00e+00 1.70e+00    1.02    0.91
s(measurement.no):toneBis.ord3                      9.00e+00 2.00e+00    1.02    0.93
s(measurement.no,speaker)                           1.00e+02 2.23e+01    1.02    0.92
s(measurement.no,speaker):toneBis.ord1              1.00e+02 1.74e+01    1.02    0.95
s(measurement.no,speaker):toneBis.ord2              1.00e+02 7.92e-04    1.02    0.91
s(measurement.no,speaker):toneBis.ord3              1.00e+02 4.91e+00    1.02    0.91
s(measurement.no,speakerLeftRightTone)              6.00e+02 1.13e+02    1.02    0.92
s(measurement.no,speakerLeftRightTone):toneBis.ord1 6.00e+02 9.40e+01    1.02    0.94
s(measurement.no,speakerLeftRightTone):toneBis.ord2 6.00e+02 7.94e+00    1.02    0.95
s(measurement.no,speakerLeftRightTone):toneBis.ord3 6.00e+02 6.55e+01    1.02    0.97
s(measurement.no,speakerPos)                        3.00e+02 5.31e+01    1.02    0.93
s(measurement.no,speakerPos):toneBis.ord1           3.00e+02 2.36e-03    1.02    0.93
s(measurement.no,speakerPos):toneBis.ord2           3.00e+02 5.72e+01    1.02    0.94
s(measurement.no,speakerPos):toneBis.ord3           3.00e+02 6.14e+01    1.02    0.94
s(measurement.no,word)                              9.75e+02 3.38e+02    1.02    0.94
s(measurement.no,wordPos)                           1.43e+03 4.17e+02    1.02    0.93
s(measurement.no,wordLeftRightTone)                 1.36e+03 5.01e+02    1.02    0.96

# Plotting
# Normalized scale

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1g, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", ylim = c(-1, 1), lwd = 4, xlab = "Time (normalized)", ylab = "F2 (Z)", xaxt = "n", font.lab = 2)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1g, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1g, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1g, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
legend("topright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

# Plotting
# Reconstructed scale
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1g, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", ylim = c(1050, 1350), xlab = "Time (ms)", ylab = "F2 (Hz)", xaxt = "n", font.lab = 2, add = F, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT1au * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2au + global_mean2au, hide.label = TRUE)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1g, view="measurement.no",
             rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", lwd = 4, add = T, transform.view = function(measurement.no) measurement.no * durationT4au * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2au + global_mean2au)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1g, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT2au * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2au + global_mean2au)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1g, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT3au * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2au + global_mean2au)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
legend("top", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

# Plotting
# Diffrence plot between tones
par(mfcol = c(2, 3), mar = c(2, 2, 2, 1), oma = c(4, 4, 2, 1)) 
plot_diff(gamm.model1g, view="measurement.no", comp=list(toneBis.ord = c("1","2")),rm.ranef=TRUE, main = "1-2", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
plot_diff(gamm.model1g, view="measurement.no",comp=list(toneBis.ord = c("1","3")),rm.ranef=TRUE, main = "1-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1g, view="measurement.no",comp=list(toneBis.ord = c("1","4")),rm.ranef=TRUE, main = "1-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
plot_diff(gamm.model1g, view="measurement.no",comp=list(toneBis.ord = c("2","3")),rm.ranef=TRUE, main = "2-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1g, view="measurement.no",comp=list(toneBis.ord = c("2","4")),rm.ranef=TRUE, main = "2-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
plot_diff(gamm.model1g, view="measurement.no",comp=list(toneBis.ord = c("3","4")),rm.ranef=TRUE, main = "3-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Difference is not significant.
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
mtext("Difference in F2 (Z)", side = 2, outer = TRUE, line = 2.5, cex = 1.2, font = 2)
mtext("Time (normalized)", side = 1, outer = TRUE, line = 2.5, cex = 1.2, font = 2)

NA
NA
plot_parametric(gamm.model1g, pred = list(toneBis.ord=c("1", "2", "3", "4")), xlab = "F2 (Z)", main = "Tone")
Summary:
    * toneBis.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; set to the value(s): 5. 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Model 1H: /au/ female, F2 as output


gamm.model1h <- bam(f2Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                        
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                        
                      data=data.au.fem, method="fREML", discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1h.noAR, paste("Gamm_model1h_noAR.rds"))
gamm.model1h.noAR <- 
  readRDS("Gamm_model1h_noAR.rds")
r.gamm.model1h <- start_value_rho(gamm.model1h.noAR)
# Auto-regressive model

gamm.model1h <- bam(f2Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr") +
                        
                        # random effects
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                        
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +  
                        
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1, by=toneBis.ord) +
                          
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                          
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1),
                    
                      data=data.au.fem, method="fREML", rho = r.gamm.model1h, AR.start = data.au.fem$start, discrete = TRUE, nthreads = ncores)
#saveRDS(gamm.model1h, paste("Gamm_model1h.rds"))
gamm.model1h <- 
  readRDS("Gamm_model1h.rds")
summary(gamm.model1h, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f2Zscore2 ~ toneBis.ord + s(measurement.no, bs = "cr") + s(measurement.no, 
    by = toneBis.ord, bs = "cr") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1, by = toneBis.ord) + s(measurement.no, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerPos, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1, 
    by = toneBis.ord) + s(measurement.no, word, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordPos, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, wordLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 3, m = 1)

Parametric coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)   0.05552    0.04806   1.155 0.248053    
toneBis.ord1 -0.31831    0.08609  -3.697 0.000219 ***
toneBis.ord2 -0.16235    0.13889  -1.169 0.242453    
toneBis.ord3  0.02006    0.08500   0.236 0.813438    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
                                 edf Ref.df      F p-value    
s(measurement.no)              7.332  7.724 32.386 < 2e-16 ***
s(measurement.no):toneBis.ord1 3.735  4.515  1.410 0.25469    
s(measurement.no):toneBis.ord2 1.000  1.000  8.169 0.00427 ** 
s(measurement.no):toneBis.ord3 3.550  4.198  3.324 0.00813 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.744   Deviance explained = 78.7%
fREML =   8049  Scale est. = 0.2311    n = 10252
gam.check(gamm.model1h)


Method: fREML   Optimizer: perf chol
$grad
 [1] -2.056133e-13 -9.925394e-14 -5.381781e-05  7.482903e-14  2.238210e-13 -9.080208e-05 -5.604331e-05
 [8] -1.954764e-06 -3.857644e-05 -5.551115e-15  3.552714e-15 -7.882583e-15  2.771117e-13  1.776357e-14
[15] -4.618528e-13 -3.019807e-14 -1.953993e-13 -9.503509e-14 -3.552714e-14 -8.881784e-15 -2.202682e-13
[22] -6.661338e-14 -7.620288e-05 -2.547962e-14 -5.329071e-14 -9.316737e-05 -1.172396e-13 -2.753353e-14
[29]  5.684342e-14 -1.989520e-13 -6.536993e-13 -1.136868e-13 -1.705303e-13  7.105427e-15 -5.456968e-12

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]          [,7]
   2.886506e+00 -8.165956e-02  4.205714e-06  4.235402e-02  3.969066e-02  7.414044e-09 -9.806132e-07
  -8.165956e-02  5.854181e-01  3.361882e-06  4.546892e-02 -1.799790e-02 -1.986621e-08  5.026616e-06
   4.205714e-06  3.361882e-06  5.381423e-05 -8.825209e-06 -2.121406e-06 -5.018114e-12 -2.242107e-11
   4.235402e-02  4.546892e-02 -8.825209e-06  9.564489e-01 -2.190838e-02 -3.053887e-08  3.316095e-07
   3.969066e-02 -1.799790e-02 -2.121406e-06 -2.190838e-02  1.300605e+01 -1.472137e-06 -9.948271e-07
   7.414044e-09 -1.986621e-08 -5.018114e-12 -3.053887e-08 -1.472137e-06  9.080134e-05 -2.037248e-12
  -9.806132e-07  5.026616e-06 -2.242107e-11  3.316095e-07 -9.948271e-07 -2.037248e-12  5.604629e-05
  -5.454388e-09 -6.151380e-08  1.066201e-12 -5.468488e-08 -8.124166e-07 -7.149893e-09  6.602073e-10
   9.803514e-07  5.854191e-07  2.452243e-10 -1.097971e-06 -3.023621e-06  1.366655e-12 -3.924320e-11
   1.396230e-05 -1.406249e-05  6.633962e-08 -1.900635e-04 -7.678157e-04 -3.554136e-07  4.994476e-09
   9.376440e-03  3.573732e-03 -6.001278e-07  2.180237e-02  2.655765e-02  7.471867e-08  8.484395e-07
  -6.808330e-06 -1.959267e-05  7.773505e-09  1.268144e-04 -2.564425e-04 -1.033468e-06  2.932959e-10
   1.072305e-01 -2.293115e-03 -1.249674e-06  2.594501e-02  2.915698e+00 -4.124312e-07 -2.296648e-06
  -5.113264e-05  1.407438e-04 -4.736159e-09 -4.440147e-04 -2.015467e-02  7.257574e-06 -8.948578e-08
  -1.206730e-02  1.124403e-01 -1.493274e-06  1.918102e-04  1.506926e-01 -1.993904e-07  6.519124e-05
   1.142488e-04  5.683852e-04  6.149664e-09  2.246579e-04 -3.118093e-03 -1.130600e-05  1.477604e-06
   2.200695e-02 -1.333230e-02  1.241474e-05 -1.086276e-02 -7.985877e-03  1.077522e-07 -1.042582e-06
   3.913438e-05  1.639885e-06  1.393471e-07 -4.512330e-04 -2.294813e-03 -2.518078e-06  1.972913e-08
   1.777503e-02 -4.356595e-03 -2.078651e-06  1.281784e-01 -1.006199e-02  2.349787e-07  6.891805e-09
  -3.862066e-04 -7.429886e-04  1.297983e-08  2.257717e-03  1.347356e-03 -6.810254e-06 -1.810731e-08
  -1.469443e-02  2.264674e-03  2.490395e-06  1.501686e-02  1.841689e+00 -2.522577e-07  4.834629e-06
   2.984468e-04  4.180668e-05 -2.001799e-07 -6.658631e-04 -9.969294e-03 -7.344100e-06 -8.820564e-08
  -1.070262e-06  3.650026e-06 -2.750601e-11  5.192212e-07  1.308526e-05  9.138350e-13  3.188189e-09
   5.899755e-06 -4.036605e-05 -7.390840e-10 -1.552603e-06  3.510216e-04 -5.981947e-07  8.665276e-08
   9.899997e-03  4.437641e-03  8.036792e-06 -6.254622e-03 -2.712646e-02 -4.790932e-08 -7.759347e-07
  -3.004297e-08 -8.786602e-08  1.636921e-11  2.189748e-07 -5.196137e-08  7.865171e-11  4.153039e-12
   1.748174e-03  2.190495e-04 -1.256478e-07  2.572225e-02  3.933658e-02  5.137537e-09  1.373502e-07
  -1.017652e-04 -4.262670e-04  6.334965e-08  1.175215e-03 -1.018894e-03 -3.479467e-06 -1.500264e-08
           [,8]          [,9]         [,10]         [,11]         [,12]         [,13]         [,14]
  -5.454388e-09  9.803514e-07  1.396230e-05  9.376440e-03 -6.808330e-06  1.072305e-01 -5.113264e-05
  -6.151380e-08  5.854191e-07 -1.406249e-05  3.573732e-03 -1.959267e-05 -2.293115e-03  1.407438e-04
   1.066201e-12  2.452243e-10  6.633962e-08 -6.001278e-07  7.773505e-09 -1.249674e-06 -4.736159e-09
  -5.468488e-08 -1.097971e-06 -1.900635e-04  2.180237e-02  1.268144e-04  2.594501e-02 -4.440147e-04
  -8.124166e-07 -3.023621e-06 -7.678157e-04  2.655765e-02 -2.564425e-04  2.915698e+00 -2.015467e-02
  -7.149893e-09  1.366655e-12 -3.554136e-07  7.471867e-08 -1.033468e-06 -4.124312e-07  7.257574e-06
   6.602073e-10 -3.924320e-11  4.994476e-09  8.484395e-07  2.932959e-10 -2.296648e-06 -8.948578e-08
   2.223720e-06 -4.942095e-12  2.585219e-06  2.837683e-07  1.470165e-06 -2.553101e-07 -4.725988e-05
  -4.942095e-12  3.858004e-05  7.533450e-08 -7.046646e-07  1.861346e-09 -1.367543e-05  7.320647e-08
   2.585219e-06  7.533450e-08  7.933819e-02 -2.047914e-04  1.096834e-03 -1.195762e-04 -1.883057e-02
   2.837683e-07 -7.046646e-07 -2.047914e-04  5.351787e-01  2.594692e-03  1.282930e-02  1.684367e-04
   1.470165e-06  1.861346e-09  1.096834e-03  2.594692e-03  2.048069e-02  3.334529e-05 -1.156569e-02
  -2.553101e-07 -1.367543e-05 -1.195762e-04  1.282930e-02  3.334529e-05  1.435264e+01  4.791918e-02
  -4.725988e-05  7.320647e-08 -1.883057e-02  1.684367e-04 -1.156569e-02  4.791918e-02  8.618028e+00
   1.284654e-05  5.939598e-07  1.730831e-04  1.461684e-02 -5.072850e-05  1.007960e+00  8.347341e-06
   5.663082e-04  8.979453e-09  7.190810e-03 -1.514458e-04  2.091834e-03  1.982998e-03 -7.081581e-04
  -3.797280e-07  1.185975e-04  4.068010e-03 -4.238278e-03  2.170208e-06 -6.172665e-01  4.346679e-03
   2.624094e-06  3.919648e-07  4.107291e-01 -5.753731e-05  8.626483e-03 -3.907466e-03 -1.938123e-01
   3.842853e-07 -1.808104e-06  9.411679e-04  9.884525e-01  3.781443e-03 -3.380966e-01  1.804735e-03
   2.214223e-05  1.053697e-08  3.142429e-02  1.632188e-02  1.083723e-01 -2.615276e-03 -6.221225e-01
  -1.025341e-06  4.169355e-06  2.711764e-04  4.154280e-02  9.510881e-05  1.007055e+00 -1.374389e-02
  -3.436731e-05  1.314116e-08  2.714099e-02  1.105886e-03 -8.834764e-03  2.218211e-03  2.703374e-01
   7.804734e-10 -1.924734e-11 -3.613284e-09  8.300473e-07 -1.179357e-09  1.146377e-05 -5.910111e-08
   2.355309e-05  3.739131e-10  1.661186e-03  3.244934e-07  8.194045e-05  1.092027e-04 -1.394831e-02
  -1.881713e-07  6.061738e-05  2.449292e-03  2.168689e-02  2.649863e-04 -1.497470e-01  1.881975e-03
   1.002061e-09  2.358607e-11  6.171795e-05  1.465217e-06 -3.277593e-06 -8.284783e-07  1.877677e-05
   1.381352e-07 -7.890231e-07  1.349794e-04  2.393237e-01  1.184016e-03  1.494030e-01  3.073656e-04
   7.517212e-06  2.536061e-08  4.450671e-03  1.235016e-02  9.063413e-02 -2.364311e-03 -8.753786e-02
          [,15]         [,16]         [,17]         [,18]         [,19]         [,20]         [,21]
  -1.206730e-02  1.142488e-04  2.200695e-02  3.913438e-05  1.777503e-02 -3.862066e-04 -1.469443e-02
   1.124403e-01  5.683852e-04 -1.333230e-02  1.639885e-06 -4.356595e-03 -7.429886e-04  2.264674e-03
  -1.493274e-06  6.149664e-09  1.241474e-05  1.393471e-07 -2.078651e-06  1.297983e-08  2.490395e-06
   1.918102e-04  2.246579e-04 -1.086276e-02 -4.512330e-04  1.281784e-01  2.257717e-03  1.501686e-02
   1.506926e-01 -3.118093e-03 -7.985877e-03 -2.294813e-03 -1.006199e-02  1.347356e-03  1.841689e+00
  -1.993904e-07 -1.130600e-05  1.077522e-07 -2.518078e-06  2.349787e-07 -6.810254e-06 -2.522577e-07
   6.519124e-05  1.477604e-06 -1.042582e-06  1.972913e-08  6.891805e-09 -1.810731e-08  4.834629e-06
   1.284654e-05  5.663082e-04 -3.797280e-07  2.624094e-06  3.842853e-07  2.214223e-05 -1.025341e-06
   5.939598e-07  8.979453e-09  1.185975e-04  3.919648e-07 -1.808104e-06  1.053697e-08  4.169355e-06
   1.730831e-04  7.190810e-03  4.068010e-03  4.107291e-01  9.411679e-04  3.142429e-02  2.711764e-04
   1.461684e-02 -1.514458e-04 -4.238278e-03 -5.753731e-05  9.884525e-01  1.632188e-02  4.154280e-02
  -5.072850e-05  2.091834e-03  2.170208e-06  8.626483e-03  3.781443e-03  1.083723e-01  9.510881e-05
   1.007960e+00  1.982998e-03 -6.172665e-01 -3.907466e-03 -3.380966e-01 -2.615276e-03  1.007055e+00
   8.347341e-06 -7.081581e-04  4.346679e-03 -1.938123e-01  1.804735e-03 -6.221225e-01 -1.374389e-02
   1.162960e+01  5.817242e-02 -2.117739e-02  1.616569e-03  5.765664e-02 -3.002136e-03 -2.103386e-01
   5.817242e-02  5.746728e+00  5.947032e-04  3.575333e-02 -8.456714e-05  5.590658e-02 -6.217315e-03
  -2.117739e-02  5.947032e-04  7.532931e+00  5.418699e-02  1.134806e-01  2.397540e-03  1.506407e-01
   1.616569e-03  3.575333e-02  5.418699e-02  3.116018e+00  7.192935e-03  1.606300e-01  3.570076e-03
   5.765664e-02 -8.456714e-05  1.134806e-01  7.192935e-03  1.450465e+01  8.068396e-02 -2.322966e-01
  -3.002136e-03  5.590658e-02  2.397540e-03  1.606300e-01  8.068396e-02  4.994323e+00 -1.354518e-03
  -2.103386e-01 -6.217315e-03  1.506407e-01  3.570076e-03 -2.322966e-01 -1.354518e-03  6.311074e+00
  -5.023120e-03 -1.831192e-01  2.369937e-03  1.312044e-01 -1.120044e-04 -7.528376e-02  1.162652e-02
   1.075408e-04  1.586930e-06 -1.131739e-07 -3.705227e-08  1.546342e-06 -1.449636e-07 -2.302263e-05
   1.660074e-03  7.754395e-02  6.928677e-05  9.060316e-03 -1.326965e-04 -2.281753e-04 -9.332746e-04
  -4.552947e-03  9.060298e-04  2.714276e+00  2.794188e-02  1.352447e-01  1.081392e-02  2.509813e-01
   4.280971e-07 -3.755343e-07  6.161042e-06  4.014409e-04  2.191644e-06  2.796713e-05  1.159615e-06
  -6.045488e-06  1.858074e-04 -8.130998e-02  1.071648e-03  1.472407e+00  3.716360e-03 -3.984301e-01
  -1.215969e-03 -9.845598e-02  5.441616e-04  1.194015e-02  1.235850e-02  7.557761e-02 -2.835687e-03
          [,22]         [,23]         [,24]         [,25]         [,26]         [,27]         [,28]
   2.984468e-04 -1.070262e-06  5.899755e-06  9.899997e-03 -3.004297e-08  1.748174e-03 -1.017652e-04
   4.180668e-05  3.650026e-06 -4.036605e-05  4.437641e-03 -8.786602e-08  2.190495e-04 -4.262670e-04
  -2.001799e-07 -2.750601e-11 -7.390840e-10  8.036792e-06  1.636921e-11 -1.256478e-07  6.334965e-08
  -6.658631e-04  5.192212e-07 -1.552603e-06 -6.254622e-03  2.189748e-07  2.572225e-02  1.175215e-03
  -9.969294e-03  1.308526e-05  3.510216e-04 -2.712646e-02 -5.196137e-08  3.933658e-02 -1.018894e-03
  -7.344100e-06  9.138350e-13 -5.981947e-07 -4.790932e-08  7.865171e-11  5.137537e-09 -3.479467e-06
  -8.820564e-08  3.188189e-09  8.665276e-08 -7.759347e-07  4.153039e-12  1.373502e-07 -1.500264e-08
  -3.436731e-05  7.804734e-10  2.355309e-05 -1.881713e-07  1.002061e-09  1.381352e-07  7.517212e-06
   1.314116e-08 -1.924734e-11  3.739131e-10  6.061738e-05  2.358607e-11 -7.890231e-07  2.536061e-08
   2.714099e-02 -3.613284e-09  1.661186e-03  2.449292e-03  6.171795e-05  1.349794e-04  4.450671e-03
   1.105886e-03  8.300473e-07  3.244934e-07  2.168689e-02  1.465217e-06  2.393237e-01  1.235016e-02
  -8.834764e-03 -1.179357e-09  8.194045e-05  2.649863e-04 -3.277593e-06  1.184016e-03  9.063413e-02
   2.218211e-03  1.146377e-05  1.092027e-04 -1.497470e-01 -8.284783e-07  1.494030e-01 -2.364311e-03
   2.703374e-01 -5.910111e-08 -1.394831e-02  1.881975e-03  1.877677e-05  3.073656e-04 -8.753786e-02
  -5.023120e-03  1.075408e-04  1.660074e-03 -4.552947e-03  4.280971e-07 -6.045488e-06 -1.215969e-03
  -1.831192e-01  1.586930e-06  7.754395e-02  9.060298e-04 -3.755343e-07  1.858074e-04 -9.845598e-02
   2.369937e-03 -1.131739e-07  6.928677e-05  2.714276e+00  6.161042e-06 -8.130998e-02  5.441616e-04
   1.312044e-01 -3.705227e-08  9.060316e-03  2.794188e-02  4.014409e-04  1.071648e-03  1.194015e-02
  -1.120044e-04  1.546342e-06 -1.326965e-04  1.352447e-01  2.191644e-06  1.472407e+00  1.235850e-02
  -7.528376e-02 -1.449636e-07 -2.281753e-04  1.081392e-02  2.796713e-05  3.716360e-03  7.557761e-02
   1.162652e-02 -2.302263e-05 -9.332746e-04  2.509813e-01  1.159615e-06 -3.984301e-01 -2.835687e-03
   3.613317e+00 -1.749931e-07 -5.564151e-02 -6.419589e-03  3.759500e-05  1.833572e-03  2.676195e-01
  -1.749931e-07  7.621419e-05  2.528416e-08  7.251031e-08 -9.692229e-12  1.152698e-06  4.582238e-08
  -5.564151e-02  2.528416e-08  2.120648e-02  1.300634e-04  1.346675e-06 -3.780534e-05 -1.108945e-02
  -6.419589e-03  7.251031e-08  1.300634e-04  2.841610e+00  1.035599e-06  9.122822e-03  1.217038e-02
   3.759500e-05 -9.692229e-12  1.346675e-06  1.035599e-06  9.327441e-05  1.760766e-06  4.661362e-05
   1.833572e-03  1.152698e-06 -3.780534e-05  9.122822e-03  1.760766e-06  1.196596e+00  1.383148e-02
   2.676195e-01  4.582238e-08 -1.108945e-02  1.217038e-02  4.661362e-05  1.383148e-02  3.299539e+00
          [,29]         [,30]         [,31]         [,32]         [,33]         [,34]         [,35]
   4.258808e-02 -1.360150e-03  3.322268e-03 -9.971456e-06  7.513848e-03 -6.354940e-04 -3.165894e+00
   9.882143e-02 -1.016725e-03  3.402620e-02  6.864391e-04  8.031297e-02 -1.222000e-03 -1.367253e+00
   4.306426e-07 -1.592972e-07 -9.994174e-06 -5.212644e-08 -1.112493e-05  2.342457e-07 -6.390932e-05
  -1.533348e-01  1.645684e-03 -1.380154e-02 -6.476801e-04 -1.070087e-01  5.018938e-04 -1.275058e+00
   9.345435e-02  6.575828e-03 -2.739587e-01  1.417134e-03  1.539258e-01  3.241403e-03 -1.976019e+01
   8.930580e-08 -1.212004e-05  3.019437e-07  4.748293e-06  1.667192e-08  5.186820e-06 -8.710142e-05
   1.796511e-06 -1.500460e-08  1.140299e-05 -5.597067e-08 -3.728870e-06  5.989330e-09 -3.106739e-04
   2.448654e-06 -5.116654e-05  2.348723e-07 -3.071005e-05  2.768391e-06  7.628962e-05 -1.035268e-03
  -4.790622e-06  1.103795e-07 -5.536293e-06 -7.359308e-09 -1.054108e-05 -6.506780e-08 -3.032537e-04
  -5.112386e-04 -1.321889e-02  5.654700e-04 -2.250108e-02 -2.140277e-04  3.746993e-02 -7.558734e-01
   2.054230e-02  1.758034e-03 -1.710042e-02 -1.830262e-03  9.673513e-02 -9.864212e-04 -4.159457e+00
   2.799252e-04 -2.023547e-03 -6.154558e-05  1.481228e-02  4.067976e-04  9.443481e-03 -3.076511e-01
   1.414336e+00 -1.346433e-02  4.423084e-01 -2.125935e-03  3.110768e+00  6.736847e-03 -4.865230e+01
   3.486488e-03 -6.946701e-01  1.001795e-02 -3.000997e-01  2.918616e-02 -2.431340e-01 -1.410859e+01
   3.614122e-01  6.535554e-03  9.034376e-01 -3.426288e-03  5.183498e-01  3.993955e-03 -4.683977e+01
   2.359391e-02  3.703734e-01  9.277112e-03 -1.266902e-01  3.311281e-02  6.289435e-01 -1.136494e+01
   7.550260e-01  1.050738e-02  2.482924e-01 -2.646575e-04  1.089313e+00  2.023632e-03 -2.187818e+01
   9.607222e-04  7.693279e-02  6.302139e-03 -4.182787e-02  1.570391e-02  4.390413e-01 -5.852202e+00
   6.642941e-01 -1.679143e-03  6.888582e-01  1.577090e-03  9.456626e-02  8.396634e-03 -4.769336e+01
   6.317578e-03 -1.998857e-01  1.910147e-02  3.861191e-01  1.644910e-02 -2.603969e-02 -1.099547e+01
   1.883312e-01  5.845969e-03  3.252394e-01  4.116890e-03  8.603551e-01  6.514449e-03 -2.017136e+01
   7.188005e-04 -1.599402e-01 -7.030199e-04 -2.095657e-01  3.853118e-03 -1.421315e-01 -6.970679e+00
   1.889327e-05  2.476178e-07  5.242289e-05  9.862300e-10 -9.372364e-06 -1.135426e-08 -8.807661e-04
  -6.490300e-04 -5.122356e-02  1.678026e-03  1.880673e-02 -1.564464e-03 -6.453308e-04 -4.583916e-01
   1.059145e-01  1.631450e-02  3.379487e-02 -1.028514e-02  9.566842e-02 -4.237459e-03 -1.303378e+01
   1.130094e-06  2.785413e-04 -3.245905e-06 -1.763910e-05 -2.415180e-06  2.538859e-05 -1.262042e-03
  -3.375729e-02  2.344395e-03  4.313759e-01  1.717118e-03  1.301346e-01  1.109539e-03 -9.207264e+00
  -3.034153e-03 -5.597238e-01  8.277296e-03  1.232575e-01 -5.090926e-04 -1.322615e-01 -6.145576e+00
 [ getOption("max.print") est atteint -- 7 lignes omises ]

Model rank =  7542 / 7542 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                          k'      edf k-index p-value
s(measurement.no)                                   9.00e+00 7.33e+00       1    0.44
s(measurement.no):toneBis.ord1                      9.00e+00 3.73e+00       1    0.40
s(measurement.no):toneBis.ord2                      9.00e+00 1.00e+00       1    0.40
s(measurement.no):toneBis.ord3                      9.00e+00 3.55e+00       1    0.45
s(measurement.no,speaker)                           1.00e+02 3.95e+01       1    0.39
s(measurement.no,speaker):toneBis.ord1              1.00e+02 2.81e-03       1    0.36
s(measurement.no,speaker):toneBis.ord2              1.00e+02 1.51e+00       1    0.41
s(measurement.no,speaker):toneBis.ord3              1.00e+02 8.93e+00       1    0.38
s(measurement.no,speakerLeftRightTone)              5.80e+02 1.26e+02       1    0.47
s(measurement.no,speakerLeftRightTone):toneBis.ord1 5.80e+02 1.16e+02       1    0.41
s(measurement.no,speakerLeftRightTone):toneBis.ord2 5.80e+02 5.55e+01       1    0.47
s(measurement.no,speakerLeftRightTone):toneBis.ord3 5.80e+02 1.17e+02       1    0.42
s(measurement.no,speakerPos)                        3.00e+02 5.43e+01       1    0.41
s(measurement.no,speakerPos):toneBis.ord1           3.00e+02 9.19e-01       1    0.43
s(measurement.no,speakerPos):toneBis.ord2           3.00e+02 2.61e+01       1    0.37
s(measurement.no,speakerPos):toneBis.ord3           3.00e+02 3.07e+01       1    0.38
s(measurement.no,word)                              9.30e+02 3.86e+02       1    0.36
s(measurement.no,wordPos)                           1.39e+03 3.36e+02       1    0.41
s(measurement.no,wordLeftRightTone)                 1.27e+03 4.18e+02       1    0.41

# Plotting
# Normalized scale

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1h, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", ylim = c(-1, 1), lwd = 4, xlab = "Time (normalized)", ylab = "F2 (Z)", xaxt = "n", font.lab = 2)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1h, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1h, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
plot_smooth(gamm.model1h, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
legend("topright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

# Plotting
# Reconstructed scale
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model1h, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), col = "orange", ylim = c(1150, 1600), xlab = "Time (ms)", ylab = "F2 (Hz)", xaxt = "n", font.lab = 2, add = F, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT2auf * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2auf + global_mean2auf, hide.label = TRUE)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1h, view="measurement.no",
             rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), col = "royalblue4", lwd = 4, add = T, transform.view = function(measurement.no) measurement.no * durationT4auf * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2auf + global_mean2auf)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1h, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT1auf * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2auf + global_mean2auf)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model1h, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), col = "chartreuse4", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * durationT3auf * 0.1, transform = function(f2Zscore2) f2Zscore2 * global_sd2auf + global_mean2auf)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 
    * Note: X-values are transformed.
legend("top", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=4)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

# Plotting
# Diffrence plot between tones
par(mfcol = c(2, 3), mar = c(2, 2, 2, 1), oma = c(4, 4, 2, 1)) 
plot_diff(gamm.model1h, view="measurement.no", comp=list(toneBis.ord = c("1","2")),rm.ranef=TRUE, main = "1-2", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.000000 - 3.232323
plot_diff(gamm.model1h, view="measurement.no",comp=list(toneBis.ord = c("1","3")),rm.ranef=TRUE, main = "1-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.000000 - 4.545455
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1h, view="measurement.no",comp=list(toneBis.ord = c("1","4")),rm.ranef=TRUE, main = "1-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.000000 - 10.000000
plot_diff(gamm.model1h, view="measurement.no",comp=list(toneBis.ord = c("2","3")),rm.ranef=TRUE, main = "2-3", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    9.191919 - 10.000000
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
plot_diff(gamm.model1h, view="measurement.no",comp=list(toneBis.ord = c("2","4")),rm.ranef=TRUE, main = "2-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    6.666667 - 10.000000
plot_diff(gamm.model1h, view="measurement.no",comp=list(toneBis.ord = c("3","4")),rm.ranef=TRUE, main = "3-4", hide.label = T, xaxt = "n", xlab = "", ylab = "")
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

measurement.no window(s) of significant difference(s):
    0.000000 - 1.515152
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
mtext("Difference in F2 (Z)", side = 2, outer = TRUE, line = 2.5, cex = 1.2, font = 2)
mtext("Time (normalized)", side = 1, outer = TRUE, line = 2.5, cex = 1.2, font = 2)

plot_parametric(gamm.model1h, pred = list(toneBis.ord=c("1", "2", "3", "4")), xlab = "F2 (Z)", main = "Tone")
Summary:
    * toneBis.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; set to the value(s): 5. 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(measurement.no,speaker),s(measurement.no,speaker):toneBis.ord1,s(measurement.no,speaker):toneBis.ord2,s(measurement.no,speaker):toneBis.ord3,s(measurement.no,speakerLeftRightTone),s(measurement.no,speakerLeftRightTone):toneBis.ord1,s(measurement.no,speakerLeftRightTone):toneBis.ord2,s(measurement.no,speakerLeftRightTone):toneBis.ord3,s(measurement.no,speakerPos),s(measurement.no,speakerPos):toneBis.ord1,s(measurement.no,speakerPos):toneBis.ord2,s(measurement.no,speakerPos):toneBis.ord3,s(measurement.no,word),s(measurement.no,wordPos),s(measurement.no,wordLeftRightTone)
 

Model 2: Tonal impact on vowel realization from a fine-grained perspective

Test for Model 2A: Random effects similar to Model 1 (/ai/ male, F1 as output)

gamm.model2test.noAR <- bam(f1Zscore2 ~ 
                         # smooth
                        s(measurement.no, bs="cr") +
                        s(f0Zscore2, bs="cr") +
                        s(durationZscore2, bs="cr") +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr") +
                        ti(measurement.no, durationZscore2, bs = "cr") +
                        ti(measurement.no, f0Zscore2, bs = "cr") +
                        ti(f0Zscore2, durationZscore2, bs = "cr") +
                        
                        # random effect
                        
                        ## left segment * pow  
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                        s(durationZscore2, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                        s(f0Zscore2, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
 
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                        s(durationZscore2, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                        s(f0Zscore2, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                            
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                        s(durationZscore2, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                        s(f0Zscore2, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                  
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=5, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=5, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=5, m=1),
 
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores)
saveRDS(gamm.model2test.noAR, paste("Gamm_model2test_noAR.rds"))
gamm.model2test.noAR <- 
  readRDS("Gamm_model2a_noAR.rds")
r.gamm.model2test <- start_value_rho(gamm.model2test.noAR)
# Auto-regressive model

gamm.model2test <- bam(f1Zscore2 ~ 
                         # smooth
                        s(measurement.no, bs="cr") +
                        s(f0Zscore2, bs="cr") +
                        s(durationZscore2, bs="cr") +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr") +
                        ti(measurement.no, durationZscore2, bs = "cr") +
                        ti(measurement.no, f0Zscore2, bs = "cr") +
                        ti(f0Zscore2, durationZscore2, bs = "cr") +
                        
                        # random effect
                        
                        ## left segment * pow  
                        s(measurement.no, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                        s(durationZscore2, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                        s(f0Zscore2, word, bs="fs", xt = list(bs="tp"), k=3, m=1) +
 
                        s(measurement.no, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                        s(durationZscore2, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                        s(f0Zscore2, wordLeftRightTone, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                            
                        s(measurement.no, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                        s(durationZscore2, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                        s(f0Zscore2, wordPos, bs="fs", xt = list(bs="tp"), k=3, m=1) +
                  
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=5, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=5, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=5, m=1),
                      
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores, rho = r.gamm.model2test, AR.start = data.ai.mas$start)
saveRDS(gamm.model2test, paste("Gamm_model2test.rds"))
gamm.model2test <- 
  readRDS("Gamm_model2a.rds")
summary(gamm.model2test, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f1Zscore2 ~ s(measurement.no, bs = "cr") + s(f0Zscore2, bs = "cr") + 
    s(durationZscore2, bs = "cr") + ti(measurement.no, f0Zscore2, 
    durationZscore2, bs = "cr") + ti(measurement.no, durationZscore2, 
    bs = "cr") + ti(measurement.no, f0Zscore2, bs = "cr") + ti(f0Zscore2, 
    durationZscore2, bs = "cr") + s(measurement.no, word, bs = "fs", 
    xt = list(bs = "tp"), k = 3, m = 1) + s(durationZscore2, 
    word, bs = "fs", xt = list(bs = "tp"), k = 3, m = 1) + s(f0Zscore2, 
    word, bs = "fs", xt = list(bs = "tp"), k = 3, m = 1) + s(measurement.no, 
    wordLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 3, 
    m = 1) + s(durationZscore2, wordLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 3, m = 1) + s(f0Zscore2, wordLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 3, m = 1) + s(measurement.no, 
    wordPos, bs = "fs", xt = list(bs = "tp"), k = 3, m = 1) + 
    s(durationZscore2, wordPos, bs = "fs", xt = list(bs = "tp"), 
        k = 3, m = 1) + s(f0Zscore2, wordPos, bs = "fs", xt = list(bs = "tp"), 
    k = 3, m = 1) + s(measurement.no, speaker, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(durationZscore2, speaker, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(measurement.no, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speakerPos, bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + 
    s(f0Zscore2, speakerPos, bs = "fs", xt = list(bs = "tp"), 
        k = 10, m = 1) + s(measurement.no, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 5, m = 1) + s(durationZscore2, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 5, 
    m = 1) + s(f0Zscore2, speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), 
    k = 5, m = 1)

Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.05456    0.03976  -1.372     0.17

Approximate significance of smooth terms:
                                               edf Ref.df      F  p-value    
s(measurement.no)                            7.999  8.165 70.719  < 2e-16 ***
s(f0Zscore2)                                 1.000  1.000  4.159   0.0414 *  
s(durationZscore2)                           2.014  2.094  0.911   0.3851    
ti(measurement.no,f0Zscore2,durationZscore2) 7.469 10.436  0.978   0.3984    
ti(measurement.no,durationZscore2)           8.978 10.828 18.751  < 2e-16 ***
ti(measurement.no,f0Zscore2)                 7.295  8.907  5.030 8.86e-07 ***
ti(f0Zscore2,durationZscore2)                3.516  4.304  1.386   0.2594    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.765   Deviance explained = 79.9%
fREML = 5915.7  Scale est. = 0.13714   n = 11029
gam.check(gamm.model2test)


Method: fREML   Optimizer: perf chol
$grad
 [1]  7.327472e-14 -5.359783e-05 -1.103562e-13 -1.332268e-14 -6.039613e-14 -2.509104e-14 -3.752554e-14  3.641532e-14  5.750955e-14
[10] -1.971756e-13 -4.329870e-14 -1.409983e-14  2.842171e-14  1.509903e-13 -7.198618e-05  1.669775e-13 -9.287826e-05 -3.677059e-13
[19]  3.410605e-13 -1.154632e-13 -7.460699e-14  5.506706e-14  1.278977e-13  1.243450e-13  1.421085e-14 -1.119105e-13 -9.237056e-14
[28] -6.927792e-14  3.126388e-13 -1.776357e-15  3.623768e-13 -1.845746e-15  7.105427e-15  1.666722e-14 -7.105427e-14  6.078471e-15
[37]  8.881784e-14 -5.018208e-14 -4.121148e-13 -1.021405e-14 -1.776357e-13  3.019807e-14 -7.815970e-14  8.437695e-14  6.608047e-13
[46]  1.776357e-14  2.131628e-13 -1.438849e-13 -1.818989e-12

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]          [,7]          [,8]          [,9]
   3.515353e+00  1.734713e-07  6.250010e-05  2.099074e-03  1.067503e-03  2.136168e-03 -6.000821e-04 -2.479263e-04 -2.292334e-02
   1.734713e-07  5.359434e-05 -6.617653e-08 -4.848540e-07 -2.724150e-07 -6.260771e-08 -6.604466e-08  2.915065e-08 -1.067458e-06
   6.250010e-05 -6.617653e-08  2.750637e-01 -1.144683e-03 -3.919240e-03  3.065156e-03 -2.873264e-03 -2.390580e-04 -3.449031e-04
   2.099074e-03 -4.848540e-07 -1.144683e-03  3.764993e-01  5.267160e-02  5.381808e-02 -1.537929e-02  5.205418e-04  1.367769e-03
   1.067503e-03 -2.724150e-07 -3.919240e-03  5.267160e-02  4.505835e-01 -1.278721e-01 -7.175089e-03  5.834331e-04 -2.245853e-03
   2.136168e-03 -6.260771e-08  3.065156e-03  5.381808e-02 -1.278721e-01  2.570803e-01  3.986232e-03 -3.872980e-02  2.736511e-03
  -6.000821e-04 -6.604466e-08 -2.873264e-03 -1.537929e-02 -7.175089e-03  3.986232e-03  1.297922e+00 -4.721886e-02  3.555107e-03
  -2.479263e-04  2.915065e-08 -2.390580e-04  5.205418e-04  5.834331e-04 -3.872980e-02 -4.721886e-02  1.328429e+00 -1.277377e-02
  -2.292334e-02 -1.067458e-06 -3.449031e-04  1.367769e-03 -2.245853e-03  2.736511e-03  3.555107e-03 -1.277377e-02  6.836243e-01
  -2.625597e-03 -7.429757e-06 -3.257084e-04  3.639254e-02 -1.543300e-03 -1.852304e-02 -5.038050e-03  1.859032e-03  3.208912e-01
  -3.172543e-03  4.152279e-07  8.924450e-03 -3.319540e-03 -8.346621e-03 -4.059068e-02 -9.403568e-03  2.421557e-02 -1.700558e-03
  -1.714842e-04  9.046096e-08 -2.473567e-02 -8.003946e-03 -1.491780e-02 -1.936009e-02 -1.457051e-02 -9.513306e-02 -4.761105e-03
  -1.092248e-02 -6.981689e-07  5.732594e-03  8.519329e-03  5.162828e-02  5.466842e-02  1.015023e-02  5.633674e-03 -1.196681e-02
  -2.682439e-04 -4.400221e-07 -7.630525e-03 -1.730844e-03  5.598155e-03  5.123250e-03  1.204084e-04 -5.056881e-03  8.976213e-04
   4.000549e-07 -7.189309e-11  1.537678e-06 -5.278494e-07 -2.392877e-06 -1.403395e-06  8.609552e-07  1.057864e-06  5.367193e-07
  -2.682439e-04 -4.400221e-07 -7.630525e-03 -1.730844e-03  5.598155e-03  5.123250e-03  1.204084e-04 -5.056881e-03  8.976213e-04
   1.069782e-07 -8.287089e-11 -5.593675e-07  2.551404e-07  1.883580e-07  5.319414e-07  9.299422e-07 -1.121830e-06 -8.881177e-07
  -2.682439e-04 -4.400221e-07 -7.630525e-03 -1.730844e-03  5.598155e-03  5.123250e-03  1.204084e-04 -5.056881e-03  8.976213e-04
  -8.813946e-03 -2.042993e-06  1.011647e-03  5.638530e-02  4.375822e-02  4.065695e-02  1.111674e-02 -6.637716e-03 -6.594935e-02
  -3.718286e-04 -3.440895e-07 -7.182883e-03 -4.198553e-03  1.438183e-03  2.572849e-03  1.568683e-04 -4.891373e-03 -6.254570e-04
          [,10]         [,11]         [,12]         [,13]         [,14]         [,15]         [,16]         [,17]         [,18]
  -2.625597e-03 -3.172543e-03 -1.714842e-04 -1.092248e-02 -2.682439e-04  4.000549e-07 -2.682439e-04  1.069782e-07 -2.682439e-04
  -7.429757e-06  4.152279e-07  9.046096e-08 -6.981689e-07 -4.400221e-07 -7.189309e-11 -4.400221e-07 -8.287089e-11 -4.400221e-07
  -3.257084e-04  8.924450e-03 -2.473567e-02  5.732594e-03 -7.630525e-03  1.537678e-06 -7.630525e-03 -5.593675e-07 -7.630525e-03
   3.639254e-02 -3.319540e-03 -8.003946e-03  8.519329e-03 -1.730844e-03 -5.278494e-07 -1.730844e-03  2.551404e-07 -1.730844e-03
  -1.543300e-03 -8.346621e-03 -1.491780e-02  5.162828e-02  5.598155e-03 -2.392877e-06  5.598155e-03  1.883580e-07  5.598155e-03
  -1.852304e-02 -4.059068e-02 -1.936009e-02  5.466842e-02  5.123250e-03 -1.403395e-06  5.123250e-03  5.319414e-07  5.123250e-03
  -5.038050e-03 -9.403568e-03 -1.457051e-02  1.015023e-02  1.204084e-04  8.609552e-07  1.204084e-04  9.299422e-07  1.204084e-04
   1.859032e-03  2.421557e-02 -9.513306e-02  5.633674e-03 -5.056881e-03  1.057864e-06 -5.056881e-03 -1.121830e-06 -5.056881e-03
   3.208912e-01 -1.700558e-03 -4.761105e-03 -1.196681e-02  8.976213e-04  5.367193e-07  8.976213e-04 -8.881177e-07  8.976213e-04
   5.319962e-01  2.554781e-03 -1.201076e-02 -6.123377e-02  2.315556e-03 -6.794350e-07  2.315556e-03 -2.514528e-06  2.315556e-03
   2.554781e-03  1.884662e-01  2.319193e-02  1.132118e-02 -2.873057e-04  4.070293e-07 -2.873057e-04  3.351192e-06 -2.873057e-04
  -1.201076e-02  2.319193e-02  2.977111e-01  2.924093e-02 -1.142670e-03 -5.908487e-06 -1.142670e-03  1.548844e-06 -1.142670e-03
  -6.123377e-02  1.132118e-02  2.924093e-02  9.039470e+00  2.754007e-03  2.615377e-06  2.754007e-03  1.092647e-05  2.754007e-03
   2.315556e-03 -2.873057e-04 -1.142670e-03  2.754007e-03  5.743026e-01  2.774251e-05  5.743026e-01  1.753174e-05  5.743026e-01
  -6.794350e-07  4.070293e-07 -5.908487e-06  2.615377e-06  2.774251e-05  7.203586e-05  2.774251e-05  5.069861e-10  2.774251e-05
   2.315556e-03 -2.873057e-04 -1.142670e-03  2.754007e-03  5.743026e-01  2.774251e-05  5.743026e-01  1.753174e-05  5.743026e-01
  -2.514528e-06  3.351192e-06  1.548844e-06  1.092647e-05  1.753174e-05  5.069861e-10  1.753174e-05  9.289832e-05  1.753174e-05
   2.315556e-03 -2.873057e-04 -1.142670e-03  2.754007e-03  5.743026e-01  2.774251e-05  5.743026e-01  1.753174e-05  5.743026e-01
   5.688982e-02  4.104975e-02  1.022953e-01  1.522494e+01  5.765057e-02  2.158597e-05  5.765057e-02  5.313838e-05  5.765057e-02
   6.202224e-03  1.113369e-03 -4.871156e-03  8.274888e-03  3.086136e-01  4.157147e-05  3.086136e-01  1.075506e-05  3.086136e-01
          [,19]         [,20]         [,21]         [,22]         [,23]         [,24]         [,25]         [,26]         [,27]
  -8.813946e-03 -3.718286e-04  3.734551e-03 -3.718286e-04 -1.481476e-03 -3.718286e-04  3.063532e-03 -1.227346e-03 -8.128050e-04
  -2.042993e-06 -3.440895e-07 -6.999927e-07 -3.440895e-07 -3.244854e-06 -3.440895e-07  5.512651e-07 -1.014388e-06 -4.376011e-07
   1.011647e-03 -7.182883e-03 -2.998040e-02 -7.182883e-03 -1.800463e-02 -7.182883e-03  1.017670e-02 -7.177007e-03  2.193903e-02
   5.638530e-02 -4.198553e-03 -8.990512e-03 -4.198553e-03  3.393670e-03 -4.198553e-03  2.059826e-02 -2.944719e-03 -6.173710e-04
   4.375822e-02  1.438183e-03 -8.285557e-03  1.438183e-03  2.517066e-02  1.438183e-03  5.001594e-02  1.280059e-03 -2.773404e-02
   4.065695e-02  2.572849e-03  1.439072e-03  2.572849e-03  2.119409e-02  2.572849e-03  3.539306e-02  3.018760e-03 -1.370260e-02
   1.111674e-02  1.568683e-04  1.232464e-02  1.568683e-04  3.335688e-02  1.568683e-04  3.762737e-02  3.237817e-03  6.100248e-03
  -6.637716e-03 -4.891373e-03 -3.182517e-02 -4.891373e-03  1.122041e-02 -4.891373e-03 -6.012762e-02 -6.610273e-03  1.841749e-02
  -6.594935e-02 -6.254570e-04  3.209375e-03 -6.254570e-04  6.935718e-04 -6.254570e-04  6.668586e-03 -5.908623e-04 -3.844081e-06
   5.688982e-02  6.202224e-03 -5.873285e-03  6.202224e-03 -5.413826e-03  6.202224e-03  1.025079e-02  4.314305e-03 -9.438793e-03
   4.104975e-02  1.113369e-03  1.176798e-02  1.113369e-03  4.990998e-02  1.113369e-03  5.997339e-03  8.798648e-03  3.918751e-03
   1.022953e-01 -4.871156e-03 -6.961474e-02 -4.871156e-03  8.138101e-02 -4.871156e-03  2.470996e-02  3.706717e-03 -4.040108e-02
   1.522494e+01  8.274888e-03  5.350253e-02  8.274888e-03  8.121419e-01  8.274888e-03  3.247231e+00 -8.331614e-03  8.495592e-02
   5.765057e-02  3.086136e-01  1.770263e-01  3.086136e-01  2.910577e-01  3.086136e-01 -3.865610e-03  4.380561e-01  3.288633e-01
   2.158597e-05  4.157147e-05  3.528778e-04  4.157148e-05  5.926741e-05  4.157148e-05  2.376135e-06  2.417486e-05  3.438198e-04
   5.765057e-02  3.086136e-01  1.770263e-01  3.086136e-01  2.910577e-01  3.086136e-01 -3.865610e-03  4.380561e-01  3.288633e-01
   5.313838e-05  1.075506e-05 -6.904595e-06  1.075506e-05  2.210152e-04  1.075506e-05  2.419183e-05  2.132564e-05  3.593498e-05
   5.765057e-02  3.086136e-01  1.770263e-01  3.086136e-01  2.910577e-01  3.086136e-01 -3.865610e-03  4.380561e-01  3.288633e-01
   5.823101e+01  4.128214e-02  2.965312e-01  4.128214e-02  2.250110e+00  4.128214e-02  8.009087e+00  5.012105e-02  3.008885e-01
   4.128214e-02  9.419166e-01  7.049264e-01  9.419166e-01  9.000911e-01  9.419166e-01  3.592641e-02  2.451223e-01  5.351499e-01
          [,28]         [,29]         [,30]         [,31]         [,32]         [,33]         [,34]         [,35]         [,36]
  -1.227346e-03  4.761000e-04 -1.227346e-03 -1.957419e-02  8.651916e-05 -4.634872e-04  8.651916e-05  1.083711e-03  8.651916e-05
  -1.014388e-06 -4.287839e-06 -1.014388e-06 -6.090473e-07  7.013495e-09  7.869128e-08  7.013495e-09 -4.905629e-06  7.013495e-09
  -7.177007e-03  2.367473e-04 -7.177007e-03  1.078264e-03 -3.361113e-04  1.892776e-02 -3.361113e-04 -1.205936e-02 -3.361113e-04
  -2.944719e-03  1.282408e-02 -2.944719e-03  7.127771e-02 -3.077114e-04 -1.929128e-03 -3.077114e-04  9.572064e-03 -3.077114e-04
   1.280059e-03  3.029798e-02  1.280059e-03  2.785233e-02 -7.086155e-05 -4.265287e-03 -7.086155e-05  9.048170e-03 -7.086155e-05
   3.018760e-03  2.336816e-02  3.018760e-03  2.391496e-03 -1.774993e-04 -7.341357e-03 -1.774993e-04  1.547170e-02 -1.774993e-04
   3.237817e-03  2.154058e-02  3.237817e-03 -2.139034e-02  8.559990e-05 -8.864555e-04  8.559990e-05  3.989537e-03  8.559990e-05
  -6.610273e-03  8.660457e-03 -6.610273e-03  3.040254e-02  1.562156e-04 -7.282298e-03  1.562156e-04  3.009222e-02  1.562156e-04
  -5.908623e-04 -1.170313e-02 -5.908623e-04 -4.584941e-02  2.482773e-04  1.914068e-03  2.482773e-04 -6.792545e-03  2.482773e-04
   4.314305e-03 -4.890537e-02  4.314305e-03  4.921107e-02 -1.700974e-04  7.715210e-04 -1.700974e-04 -1.584932e-01 -1.700974e-04
   8.798648e-03  9.076909e-02  8.798648e-03  1.280202e-04 -9.130059e-05  9.164045e-03 -9.130059e-05  2.203064e-02 -9.130060e-05
   3.706717e-03  3.568227e-02  3.706717e-03  9.115963e-03  1.110850e-03 -1.232866e-02  1.110850e-03  6.645245e-03  1.110850e-03
  -8.331614e-03  4.095826e-01 -8.331614e-03  1.345234e-01 -1.716492e-04  1.563964e-02 -1.716492e-04  1.261459e-02 -1.716492e-04
   4.380561e-01  3.091767e-01  4.380561e-01 -4.506500e-03 -2.992545e-05  1.108883e-02 -2.992545e-05 -1.350212e-02 -2.992545e-05
   2.417486e-05  2.468378e-05  2.417486e-05  8.228938e-06 -4.163405e-07  1.584191e-05 -4.163405e-07 -1.346311e-05 -4.163405e-07
   4.380561e-01  3.091767e-01  4.380561e-01 -4.506500e-03 -2.992545e-05  1.108883e-02 -2.992545e-05 -1.350212e-02 -2.992545e-05
   2.132564e-05  2.564578e-04  2.132564e-05  4.077058e-06 -7.221842e-08  3.464073e-06 -7.221842e-08 -4.635750e-06 -7.221842e-08
   4.380561e-01  3.091767e-01  4.380561e-01 -4.506500e-03 -2.992545e-05  1.108883e-02 -2.992545e-05 -1.350212e-02 -2.992545e-05
   5.012105e-02  1.802129e+00  5.012105e-02  2.417953e-01 -1.137978e-03 -1.566450e-02 -1.137978e-03 -1.946942e-02 -1.137978e-03
   2.451223e-01  1.306684e-01  2.451223e-01 -1.309974e-03 -1.997786e-03  7.995700e-03 -1.997786e-03 -5.161172e-02 -1.997786e-03
          [,37]         [,38]         [,39]         [,40]         [,41]         [,42]         [,43]         [,44]         [,45]
   6.508631e-03  4.542543e-04 -5.200397e-04  4.542543e-04  2.331807e-03  4.542543e-04  1.629493e-02  9.412544e-04 -5.310086e-03
  -1.481997e-06  1.017547e-07 -4.653770e-07  1.017547e-07  2.056746e-07  1.017547e-07 -4.765144e-07 -2.221551e-07 -1.491835e-08
   9.050014e-03  6.535860e-03  3.845691e-03  6.535860e-03  1.043818e-02  6.535860e-03 -6.180670e-04 -2.805909e-03  4.966234e-02
  -5.100845e-02 -1.665356e-03  1.088982e-02 -1.665356e-03  1.752515e-02 -1.665356e-03 -4.158215e-02 -4.130472e-03  9.927497e-03
   4.876315e-04  3.073109e-04  1.449638e-02  3.073109e-04 -5.928034e-03  3.073109e-04 -4.346989e-03  1.229781e-03 -3.850640e-03
  -1.381394e-02  2.181238e-03  7.266178e-04  2.181238e-03  5.931124e-03  2.181238e-03  1.035366e-02  1.839256e-03  1.727775e-02
  -1.014863e-02  1.127687e-04  3.653871e-03  1.127687e-04  7.134118e-03  1.127687e-04  2.945919e-02  8.956551e-05 -8.428906e-03
  -1.436441e-02 -2.515113e-03 -3.619174e-02 -2.515113e-03  9.361054e-02 -2.515113e-03  7.288848e-02 -5.108158e-03 -3.615952e-02
   2.435898e-03  6.234950e-04  6.335894e-03  6.234950e-04  2.423515e-02  6.234950e-04 -6.918040e-02  1.664197e-03 -8.341378e-03
  -5.356073e-02  2.237072e-03  2.400343e-02  2.237072e-03  2.064235e-02  2.237072e-03  1.926792e-01 -4.996207e-03  6.468193e-06
  -2.704586e-02 -9.774293e-04 -3.355778e-02 -9.774293e-04  1.467168e-02 -9.774293e-04 -2.623495e-02  5.656942e-03  2.688190e-02
  -2.949337e-02 -3.283299e-03 -7.225536e-02 -3.283299e-03  9.286753e-03 -3.283299e-03  4.304534e-02  5.365013e-03 -2.682179e-02
   1.175207e-01 -1.435919e-03 -9.137602e-02 -1.435919e-03  3.261554e-02 -1.435919e-03  9.330805e-01  8.486932e-03  1.014504e-01
   1.423516e-02 -8.489582e-03 -5.166855e-02 -8.489582e-03 -3.400680e-02 -8.489582e-03 -1.796420e-02  3.683902e-02  1.138147e-02
   3.288978e-06 -3.087494e-06  8.675636e-05 -3.087494e-06  9.526133e-07 -3.087494e-06 -3.906305e-06 -1.105539e-06  5.548511e-06
   1.423516e-02 -8.489582e-03 -5.166855e-02 -8.489582e-03 -3.400680e-02 -8.489582e-03 -1.796420e-02  3.683902e-02  1.138147e-02
   4.282721e-06 -1.347577e-06 -1.246200e-05 -1.347577e-06  1.956037e-06 -1.347577e-06  2.946578e-06  3.387541e-06 -4.474957e-06
   1.423516e-02 -8.489582e-03 -5.166855e-02 -8.489582e-03 -3.400680e-02 -8.489582e-03 -1.796420e-02  3.683902e-02  1.138147e-02
  -2.688123e-01 -7.374267e-03 -3.004114e-01 -7.374267e-03 -2.070009e-01 -7.374267e-03  4.292433e+00  6.159721e-02  3.127001e-01
   1.486904e-02 -7.306829e-03  3.146466e-02 -7.306829e-03 -4.575714e-02 -7.306829e-03 -4.141968e-02  1.202989e-01  9.683877e-02
          [,46]         [,47]         [,48]         [,49]
   9.412544e-04  2.058337e-03  9.412544e-04 -3.499505e+00
  -2.221551e-07 -1.559052e-06 -2.221551e-07 -2.542367e-05
  -2.805909e-03  1.025767e-02 -2.805909e-03 -5.070718e-01
  -4.130472e-03 -2.465117e-02 -4.130472e-03 -1.176987e+00
   1.229781e-03 -2.551288e-03  1.229781e-03 -1.153294e+00
   1.839256e-03 -1.552691e-02  1.839256e-03 -9.042403e-01
   8.956552e-05 -3.195256e-03  8.956551e-05 -1.688430e+00
  -5.108158e-03  1.686253e-02 -5.108158e-03 -2.300393e+00
   1.664197e-03  9.002733e-03  1.664197e-03 -1.272580e+00
  -4.996207e-03 -2.675100e-03 -4.996207e-03 -1.875046e+00
   5.656942e-03 -2.870739e-02  5.656942e-03 -5.905415e-01
   5.365013e-03 -1.802384e-02  5.365013e-03 -6.672805e-01
   8.486932e-03  4.393746e-02  8.486932e-03 -4.170095e+01
   3.683902e-02  3.409380e-02  3.683902e-02 -6.711692e+00
  -1.105539e-06 -1.428680e-05 -1.105539e-06 -2.315759e-03
   3.683902e-02  3.409380e-02  3.683902e-02 -6.711692e+00
   3.387541e-06  4.161140e-06  3.387541e-06 -1.613599e-03
   3.683902e-02  3.409380e-02  3.683902e-02 -6.711692e+00
   6.159721e-02  1.781564e-01  6.159721e-02 -1.346091e+02
   1.202989e-01  3.063189e-02  1.202989e-01 -1.068569e+01
 [ getOption("max.print") est atteint -- 29 lignes omises ]

Model rank =  9875 / 9875 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                 k'    edf k-index p-value    
s(measurement.no)                              9.00   8.00    1.02   0.925    
s(f0Zscore2)                                   9.00   1.00    0.98   0.100 .  
s(durationZscore2)                             9.00   2.01    0.93  <2e-16 ***
ti(measurement.no,f0Zscore2,durationZscore2)  64.00   7.47    1.01   0.790    
ti(measurement.no,durationZscore2)            16.00   8.98    0.98   0.085 .  
ti(measurement.no,f0Zscore2)                  16.00   7.30    0.99   0.135    
ti(f0Zscore2,durationZscore2)                 16.00   3.52    0.97  <2e-16 ***
s(measurement.no,word)                       627.00  96.83    1.02   0.910    
s(durationZscore2,word)                      627.00  13.43    0.93  <2e-16 ***
s(f0Zscore2,word)                            627.00  13.43    0.98   0.080 .  
s(measurement.no,wordLeftRightTone)          930.00 290.59    1.02   0.920    
s(durationZscore2,wordLeftRightTone)         930.00  83.88    0.93  <2e-16 ***
s(f0Zscore2,wordLeftRightTone)               930.00 126.58    0.98   0.095 .  
s(measurement.no,wordPos)                    993.00 112.59    1.02   0.895    
s(durationZscore2,wordPos)                   993.00 101.30    0.93  <2e-16 ***
s(f0Zscore2,wordPos)                         993.00 134.51    0.98   0.120    
s(measurement.no,speaker)                    100.00  65.87    1.02   0.955    
s(durationZscore2,speaker)                   100.00  13.17    0.93  <2e-16 ***
s(f0Zscore2,speaker)                         100.00  42.19    0.98   0.120    
s(measurement.no,speakerPos)                 300.00  42.17    1.02   0.895    
s(durationZscore2,speakerPos)                300.00 117.44    0.93  <2e-16 ***
s(f0Zscore2,speakerPos)                      300.00  59.01    0.98   0.100 .  
s(measurement.no,speakerLeftRightTone)       295.00  82.70    1.02   0.875    
s(durationZscore2,speakerLeftRightTone)      295.00  95.50    0.93  <2e-16 ***
s(f0Zscore2,speakerLeftRightTone)            295.00  48.67    0.98   0.070 .  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Because of the high number of levels in the word variable — for instance, in the case of the diphthong /ai/ produced by male speakers, there were 205 distinct word types, each appearing on average only five times. The related variables wordPos and wordLeftRightTone contained 311 and 293 levels, respectively. Introducing separate nonlinear effects for each of these rarely occurring levels and increasing k values, would increase model fitting, but at the cost of substantially greater computation time. Moreover, simply doubling the k values failed to resolve the poor fit, as reflected in the gam.check diagnostics.

Another structure is tested:

Model 2A: /ai/ male, F1 as output

system.time(gamm.test2.noAR <- bam(f1Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1), 
                          
                          
 
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores)
)
utilisateur     système      écoulé 
  15157.010      40.441    1315.679 
saveRDS(gamm.model2a.noAR, paste("Gamm_model2a_noAR.rds"))
gamm.model2a.noAR <- 
  readRDS("Gamm_model2a_noAR.rds")
r.gamm.test2 <- start_value_rho(gamm.test2.noAR)
system.time(gamm.test2 <- bam(f1Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1),
                      
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores, rho = r.gamm.test2, AR.start = data.ai.mas$start)
)
utilisateur     système      écoulé 
  15969.389      57.827    1398.232 
saveRDS(gamm.model2a, paste("Gamm_model2a.rds"))
gamm.model2a <- 
  readRDS("Gamm_model2a.rds")
summary(gamm.model2a, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f1Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(word, bs = "re") + s(wordPos, 
    bs = "re") + s(wordLeftRightTone, bs = "re") + s(wordPos, 
    measurement.no, bs = "re") + s(wordPos, f0Zscore2, bs = "re") + 
    s(wordPos, durationZscore2, bs = "re") + s(wordLeftRightTone, 
    measurement.no, bs = "re") + s(wordLeftRightTone, f0Zscore2, 
    bs = "re") + s(wordLeftRightTone, durationZscore2, bs = "re") + 
    s(word, measurement.no, bs = "re") + s(word, f0Zscore2, bs = "re") + 
    s(word, durationZscore2, bs = "re") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1) + s(measurement.no, speakerPos, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(durationZscore2, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1) + s(durationZscore2, speakerLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1)

Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.04726    0.04994  -0.946    0.344

Approximate significance of smooth terms:
                                                edf Ref.df      F  p-value    
s(measurement.no)                             7.931  8.103 78.102  < 2e-16 ***
s(f0Zscore2)                                  1.000  1.000  2.757   0.0969 .  
s(durationZscore2)                            1.883  1.926  0.843   0.4655    
ti(measurement.no,f0Zscore2,durationZscore2) 39.275 58.289  1.137   0.2213    
ti(measurement.no,durationZscore2)            8.530 10.584 17.884  < 2e-16 ***
ti(measurement.no,f0Zscore2)                 10.303 13.169  3.641 7.66e-06 ***
ti(f0Zscore2,durationZscore2)                 6.803  9.395  0.817   0.6130    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.773   Deviance explained = 80.5%
fREML = 6007.6  Scale est. = 0.13386   n = 11029
gam.check(gamm.model2a)


Method: fREML   Optimizer: perf chol
$grad
 [1]  5.462297e-14 -9.626245e-05 -5.856648e-12  2.785328e-12  5.072387e-12  2.330580e-12 -7.629453e-13  1.047162e-12  3.013145e-13
[10]  9.966250e-12  5.706546e-14  6.866285e-12 -4.843059e-11 -1.431744e-12 -6.084733e-11  6.449596e-11  6.220446e-11 -9.343033e-10
[19]  1.883365e-10  1.088480e-10 -2.186091e-09  2.705391e-11 -2.397638e-11 -7.213591e-05  6.110668e-12 -7.087024e-05 -7.877698e-11
[28] -7.087024e-05  1.065814e-14 -7.087024e-05 -2.700062e-13  1.106071e-11 -1.008971e-10  1.121658e-11 -7.982948e-12  1.112643e-11
[37] -2.032152e-12  6.528111e-12  4.175149e-11  6.549428e-12  9.016787e-12  6.595169e-12  4.829417e-09

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]          [,7]          [,8]          [,9]
   3.466488e+00  3.254244e-07 -5.257459e-05  2.369806e-03 -3.785818e-04  9.031393e-04 -8.953825e-04  2.513386e-03 -2.314106e-02
   3.254244e-07  9.624767e-05  2.522700e-08 -1.672270e-06  3.218722e-07 -3.379400e-07 -3.567809e-07  1.001399e-07 -1.830944e-06
  -5.257459e-05  2.522700e-08  2.428702e-01  9.599315e-03 -3.791693e-03 -4.473523e-04 -2.250122e-03  4.141712e-03 -3.018283e-04
   2.369806e-03 -1.672270e-06  9.599315e-03  1.491842e+00  3.739066e-01  3.498922e-01 -1.445288e-02  8.733083e-03 -1.701172e-02
  -3.785818e-04  3.218722e-07 -3.791693e-03  3.739066e-01  1.039836e+00  3.620979e-01 -4.001896e-02  1.331440e-02  1.315308e-02
   9.031393e-04 -3.379400e-07 -4.473523e-04  3.498922e-01  3.620979e-01  1.665344e+00 -2.164189e-02  5.687499e-02 -1.384919e-02
  -8.953825e-04 -3.567809e-07 -2.250122e-03 -1.445288e-02 -4.001896e-02 -2.164189e-02  1.312628e+00 -4.818861e-02  6.458888e-03
   2.513386e-03  1.001399e-07  4.141712e-03  8.733083e-03  1.331440e-02  5.687499e-02 -4.818861e-02  7.147504e-01 -1.097371e-02
  -2.314106e-02 -1.830944e-06 -3.018283e-04 -1.701172e-02  1.315308e-02 -1.384919e-02  6.458888e-03 -1.097371e-02  8.211776e-01
   8.670701e-04 -1.135610e-05  2.368823e-04  1.868331e-02 -2.159962e-02 -2.776271e-02 -3.243167e-03  8.905405e-03  2.849521e-01
  -2.481418e-03  7.630919e-07  1.228556e-02  9.108747e-03 -2.231992e-02 -4.294433e-02 -7.035073e-03  1.259923e-02 -1.893175e-03
   2.556338e-04  8.581353e-09 -2.427160e-02 -5.468547e-03 -7.785009e-02 -4.163480e-02 -1.012262e-02 -4.430971e-02 -2.490084e-03
  -3.447358e-03  7.005046e-07 -2.786481e-02  6.451613e-02  8.385667e-02  1.940479e-01  7.534175e-03  6.382948e-03 -1.940439e-02
  -1.803509e-03 -1.808460e-06 -8.122175e-03  1.695652e-02  1.476343e-02  5.458842e-02  1.419975e-02 -1.016646e-02  1.234741e-03
  -3.135282e-03  1.014155e-06 -4.549273e-03 -7.143607e-03 -1.932942e-02 -1.324133e-02  7.630295e-03  1.044614e-02  1.414855e-03
   3.161807e-03  1.948018e-06 -2.931742e-02 -1.547613e-02 -3.248714e-02  3.228465e-02  9.935850e-03  1.245089e-02  6.326217e-03
  -7.303350e-05 -3.552654e-06  4.711371e-03  4.852834e-02  9.054060e-04  1.546967e-02  2.733553e-03 -2.295500e-02 -4.355489e-03
  -2.510954e-03 -8.461292e-07 -9.895568e-03 -8.636499e-03 -3.037666e-02  1.923186e-02  2.530829e-03  5.492548e-03 -7.789324e-03
  -1.146528e-02  2.288220e-09  5.695517e-03 -1.089927e-02 -2.148931e-02  1.248538e-01  9.588392e-03  3.768874e-02  2.733393e-03
  -9.108057e-04 -8.447339e-06 -1.360835e-02  5.705969e-02  4.784689e-02  2.705386e-02  1.881434e-02 -1.652159e-02  3.934800e-03
   1.285633e-03 -4.643584e-07 -3.077620e-02 -5.300816e-02 -3.104807e-02 -6.271712e-03  8.709306e-03 -1.461632e-02 -2.470352e-03
  -8.029424e-04  1.473774e-07  1.398889e-03  8.398311e-04  8.201404e-04  7.450023e-02  3.883319e-03 -8.474142e-03 -1.166961e-03
   5.296443e-04 -9.827522e-07 -4.296249e-04  3.680081e-03  1.541388e-04 -2.672043e-04  1.606137e-03 -4.885811e-03 -1.162341e-03
          [,10]         [,11]         [,12]         [,13]         [,14]         [,15]         [,16]         [,17]         [,18]
   8.670701e-04 -2.481418e-03  2.556338e-04 -3.447358e-03 -1.803509e-03 -3.135282e-03  3.161807e-03 -7.303350e-05 -2.510954e-03
  -1.135610e-05  7.630919e-07  8.581353e-09  7.005046e-07 -1.808460e-06  1.014155e-06  1.948018e-06 -3.552654e-06 -8.461292e-07
   2.368823e-04  1.228556e-02 -2.427160e-02 -2.786481e-02 -8.122175e-03 -4.549273e-03 -2.931742e-02  4.711371e-03 -9.895568e-03
   1.868331e-02  9.108747e-03 -5.468547e-03  6.451613e-02  1.695652e-02 -7.143607e-03 -1.547613e-02  4.852834e-02 -8.636499e-03
  -2.159962e-02 -2.231992e-02 -7.785009e-02  8.385667e-02  1.476343e-02 -1.932942e-02 -3.248714e-02  9.054060e-04 -3.037666e-02
  -2.776271e-02 -4.294433e-02 -4.163480e-02  1.940479e-01  5.458842e-02 -1.324133e-02  3.228465e-02  1.546967e-02  1.923186e-02
  -3.243167e-03 -7.035073e-03 -1.012262e-02  7.534175e-03  1.419975e-02  7.630295e-03  9.935850e-03  2.733553e-03  2.530829e-03
   8.905405e-03  1.259923e-02 -4.430971e-02  6.382948e-03 -1.016646e-02  1.044614e-02  1.245089e-02 -2.295500e-02  5.492548e-03
   2.849521e-01 -1.893175e-03 -2.490084e-03 -1.940439e-02  1.234741e-03  1.414855e-03  6.326217e-03 -4.355489e-03 -7.789324e-03
   7.285349e-01  1.011165e-04 -1.010159e-02 -1.070318e-02 -4.019067e-02  5.062560e-02  4.234568e-03  1.364799e-02 -2.422853e-02
   1.011165e-04  2.595572e-01  3.861788e-02  1.179314e-02  2.839956e-02  7.204392e-03  3.833444e-02  4.256016e-02 -2.560959e-03
  -1.010159e-02  3.861788e-02  5.545796e-01  1.186113e-02  1.839866e-02  1.115068e-02  3.516205e-02 -2.483921e-02 -3.471128e-02
  -1.070318e-02  1.179314e-02  1.186113e-02  1.815138e+01  4.309702e+00  3.947410e+00 -7.340032e-01 -5.992768e-02  7.390915e-01
  -4.019067e-02  2.839956e-02  1.839866e-02  4.309702e+00  9.218066e+00  8.806554e-01  5.940487e-01  4.399999e-01  2.947558e-01
   5.062560e-02  7.204392e-03  1.115068e-02  3.947410e+00  8.806554e-01  7.929611e+00  8.904016e-02  1.155338e-01  3.394582e-01
   4.234568e-03  3.833444e-02  3.516205e-02 -7.340032e-01  5.940487e-01  8.904016e-02  1.435087e+01  4.821219e-01 -3.392921e-01
   1.364799e-02  4.256016e-02 -2.483921e-02 -5.992768e-02  4.399999e-01  1.155338e-01  4.821219e-01  7.455341e+00  1.166365e-01
  -2.422853e-02 -2.560959e-03 -3.471128e-02  7.390915e-01  2.947558e-01  3.394582e-01 -3.392921e-01  1.166365e-01  3.660416e+00
   9.722005e-02  4.191458e-02  3.337161e-02 -3.128248e+00 -7.502600e-01 -2.509511e+00  9.658708e+00  1.898687e-01 -4.095034e-01
  -3.582614e-02  8.281039e-02  7.335226e-02  7.455916e-02 -5.440680e-02 -3.370936e-01  8.115281e-02  3.156737e+00 -2.460427e-01
  -3.958237e-02 -1.626170e-02 -6.262443e-02  5.366123e-01  3.051813e-01  6.735285e-01 -3.297105e-01 -2.801922e-02  1.747584e+00
  -1.100917e-02  1.028274e-02  1.175056e-02 -1.162598e+00 -2.267117e-01 -2.644962e-01  2.589457e+00 -2.963317e-02 -8.849255e-02
  -6.160560e-03  5.084718e-03  2.038801e-03  1.068396e-02  5.458985e-03  1.597971e-02  1.581451e-02  4.699794e-01  2.319510e-02
          [,19]         [,20]         [,21]         [,22]         [,23]         [,24]         [,25]         [,26]         [,27]
  -1.146528e-02 -9.108057e-04  1.285633e-03 -8.029424e-04  5.296443e-04  1.902710e-07 -6.273515e-03  3.238994e-07  2.256300e-04
   2.288220e-09 -8.447339e-06 -4.643584e-07  1.473774e-07 -9.827522e-07 -5.189064e-11 -1.628522e-06  1.978558e-10  9.811981e-08
   5.695517e-03 -1.360835e-02 -3.077620e-02  1.398889e-03 -4.296249e-04 -1.342548e-06  2.765686e-04 -1.068288e-06  5.185318e-03
  -1.089927e-02  5.705969e-02 -5.300816e-02  8.398311e-04  3.680081e-03 -1.676807e-06  5.710830e-02 -1.078327e-06 -1.962422e-03
  -2.148931e-02  4.784689e-02 -3.104807e-02  8.201404e-04  1.541388e-04 -1.239502e-06  4.982816e-02  8.550915e-08 -1.802298e-03
   1.248538e-01  2.705386e-02 -6.271712e-03  7.450023e-02 -2.672043e-04  9.230099e-07 -1.492911e-02  7.205055e-07 -2.824205e-03
   9.588392e-03  1.881434e-02  8.709306e-03  3.883319e-03  1.606137e-03  4.034183e-07 -5.019764e-03  4.341406e-07  3.961336e-04
   3.768874e-02 -1.652159e-02 -1.461632e-02 -8.474142e-03 -4.885811e-03 -2.500351e-07  3.256103e-02 -3.121217e-07 -1.117035e-03
   2.733393e-03  3.934800e-03 -2.470352e-03 -1.166961e-03 -1.162341e-03 -2.486333e-07 -4.118656e-02  1.391181e-06  1.336206e-03
   9.722005e-02 -3.582614e-02 -3.958237e-02 -1.100917e-02 -6.160560e-03  1.801658e-07 -8.338279e-03 -4.885601e-07  3.107099e-03
   4.191458e-02  8.281039e-02 -1.626170e-02  1.028274e-02  5.084718e-03  8.475368e-07  5.612739e-03  1.868643e-06  8.702710e-03
   3.337161e-02  7.335226e-02 -6.262443e-02  1.175056e-02  2.038801e-03 -1.554367e-06  9.990891e-03  7.728639e-06  2.576811e-03
  -3.128248e+00  7.455916e-02  5.366123e-01 -1.162598e+00  1.068396e-02  3.280058e-05 -7.674887e-02  4.688782e-07  1.097912e-01
  -7.502600e-01 -5.440680e-02  3.051813e-01 -2.267117e-01  5.458985e-03  1.524673e-05 -3.286473e-02  3.958571e-06  2.221275e-02
  -2.509511e+00 -3.370936e-01  6.735285e-01 -2.644962e-01  1.597971e-02  1.837905e-05 -8.305300e-03 -1.474733e-05  4.282762e-02
   9.658708e+00  8.115281e-02 -3.297105e-01  2.589457e+00  1.581451e-02 -1.630738e-05  8.252216e-02  3.392793e-06 -1.420215e-03
   1.898687e-01  3.156737e+00 -2.801922e-02 -2.963317e-02  4.699794e-01  7.455051e-06  4.648056e-02 -8.819364e-06 -9.772582e-03
  -4.095034e-01 -2.460427e-01  1.747584e+00 -8.849255e-02  2.319510e-02  1.211135e-04 -3.012453e-02  3.493841e-06 -2.479951e-02
   4.479019e+01 -2.567000e-01 -3.915212e-01  7.181289e+00  3.549589e-02 -2.257985e-05  3.013539e-01 -1.866720e-06 -6.566352e-02
  -2.567000e-01  7.572756e+00 -3.249392e-01  1.634742e-01  5.473824e-01 -1.565755e-05  1.571203e-01 -4.565630e-06 -1.715742e-02
  -3.915212e-01 -3.249392e-01  3.631740e+00 -8.486202e-02 -2.279671e-02  1.354024e-04  4.393043e-02 -1.283146e-05 -1.239498e-02
   7.181289e+00  1.634742e-01 -8.486202e-02  2.751956e+00 -1.176012e-02 -5.099138e-06  8.718836e-02  1.070211e-06 -6.691574e-03
   3.549589e-02  5.473824e-01 -2.279671e-02 -1.176012e-02  1.327961e-01 -1.184830e-06  2.578065e-02 -5.003558e-08  1.953858e-03
          [,28]         [,29]         [,30]         [,31]         [,32]         [,33]         [,34]         [,35]         [,36]
   3.238994e-07  2.848656e-04  3.238994e-07  2.354045e-03  6.602446e-04  2.066015e-03  6.602446e-04  2.954308e-03  6.602446e-04
   1.978558e-10 -5.075100e-06  1.978558e-10 -2.357042e-06  1.742967e-07 -4.506694e-07  1.742967e-07  1.982060e-06  1.742967e-07
  -1.068288e-06 -1.060609e-02 -1.068288e-06  7.408756e-03  3.384804e-03  5.053837e-02  3.384804e-03  1.011859e-03  3.384804e-03
  -1.078327e-06  5.281122e-02 -1.078327e-06 -6.252265e-02 -6.166565e-03 -7.175672e-02 -6.166565e-03  2.905527e-02 -6.166565e-03
   8.550915e-08 -4.717364e-02  8.550915e-08  5.092826e-02 -1.270054e-02  6.507221e-02 -1.270054e-02 -6.738047e-02 -1.270054e-02
   7.205055e-07  2.785336e-02  7.205055e-07 -2.272129e-02  2.786613e-03 -5.384258e-04  2.786613e-03  3.737048e-02  2.786613e-03
   4.341406e-07 -6.816300e-04  4.341406e-07 -4.589540e-03  3.008454e-04  9.131853e-03  3.008454e-04 -5.655566e-03  3.008454e-04
  -3.121217e-07  3.067706e-02 -3.121217e-07 -8.937439e-03 -2.356265e-03 -1.194732e-02 -2.356265e-03  2.393652e-02 -2.356265e-03
   1.391181e-06 -8.951553e-04  1.391181e-06  2.654937e-02  1.297923e-03  9.785086e-03  1.297923e-03  3.370070e-02  1.297923e-03
  -4.885601e-07 -1.217557e-01 -4.885601e-07 -5.539353e-02  3.635620e-03  4.574992e-02  3.635620e-03  3.774287e-03  3.635620e-03
   1.868643e-06  2.808647e-02  1.868643e-06 -8.895873e-03  2.822619e-04  2.201661e-02  2.822619e-04 -4.660109e-03  2.822619e-04
   7.728639e-06 -1.411400e-02  7.728639e-06 -1.532168e-03 -2.168444e-03  2.031596e-02 -2.168444e-03 -1.685863e-02 -2.168444e-03
   4.688782e-07  2.020178e-02  4.688782e-07  3.589547e-01 -3.851288e-02  5.405672e-01 -3.851288e-02  1.720583e-01 -3.851288e-02
   3.958571e-06 -2.647148e-02  3.958571e-06  1.827308e-01 -4.478051e-03  3.656100e-01 -4.478051e-03 -2.230772e-01 -4.478051e-03
  -1.474733e-05 -4.780749e-02 -1.474733e-05  7.950423e-02 -1.680504e-02  5.065197e-01 -1.680504e-02  7.661485e-02 -1.680504e-02
   3.392793e-06 -3.648350e-02  3.392793e-06 -1.453652e-01 -7.329776e-03 -2.339512e-01 -7.329776e-03 -1.835476e-01 -7.329776e-03
  -8.819364e-06  4.519786e-02 -8.819364e-06  7.703553e-03 -4.630002e-02 -4.444761e-01 -4.630002e-02 -4.427686e-01 -4.630002e-02
   3.493841e-06 -3.832558e-02  3.493841e-06 -5.269946e-02 -3.825081e-02  1.309363e-01 -3.825081e-02  3.935735e-02 -3.825081e-02
  -1.866720e-06 -7.874127e-02 -1.866720e-06 -3.135266e-01  7.528121e-03 -8.271734e-01  7.528121e-03 -3.995199e-01  7.528121e-03
  -4.565630e-06 -2.562267e-01 -4.565630e-06  9.679624e-02 -3.790972e-02  8.421184e-02 -3.790972e-02  4.275194e-02 -3.790972e-02
  -1.283146e-05  1.860514e-02 -1.283146e-05 -4.356539e-02 -9.766193e-03  1.326428e-01 -9.766193e-03  1.783945e-01 -9.766193e-03
   1.070211e-06 -1.684891e-02  1.070211e-06 -9.637297e-03 -3.159678e-03 -2.009227e-01 -3.159679e-03 -1.318745e-02 -3.159679e-03
  -5.003558e-08  1.217378e-03 -5.003558e-08  1.799551e-02 -5.047812e-03 -1.458993e-02 -5.047812e-03  1.677832e-02 -5.047812e-03
          [,37]         [,38]         [,39]         [,40]         [,41]         [,42]         [,43]
  -3.213077e-04  3.019502e-04  3.543897e-04  3.019502e-04  1.260611e-03  3.019502e-04 -3.465615e+00
  -1.633042e-06  1.494054e-07 -2.300773e-06  1.494054e-07  2.556078e-06  1.494054e-07 -5.939244e-05
  -1.056913e-02 -3.745522e-03  7.688511e-02 -3.745522e-03  1.040335e-02 -3.745522e-03 -4.414147e-01
  -3.120067e-02 -3.601232e-03  1.183837e-02 -3.601232e-03 -4.018379e-02 -3.601232e-03 -6.506775e+00
   6.241151e-02 -6.620320e-04  2.134548e-02 -6.620320e-04 -9.395151e-03 -6.620320e-04 -5.662798e+00
   5.190466e-02 -2.014853e-03  6.995841e-02 -2.014853e-03 -1.517668e-02 -2.014853e-03 -6.967924e+00
   2.282296e-02  5.745013e-04  2.916525e-04  5.745013e-04 -1.075087e-02  5.745013e-04 -1.609863e+00
   1.643976e-02  1.132104e-04  1.316086e-02  1.132104e-04 -9.210980e-04  1.132104e-04 -2.155326e+00
  -7.294338e-02  1.354866e-03 -7.389988e-04  1.354866e-03  9.068532e-03  1.354866e-03 -1.549261e+00
   1.773028e-01 -1.506083e-03  1.538220e-02 -1.506083e-03 -2.658573e-02 -1.506083e-03 -3.102400e+00
   2.657577e-02  9.019459e-03  1.313715e-01  9.019459e-03 -1.934220e-02  9.019459e-03 -1.426948e+00
   5.511488e-02  1.267216e-02  1.173007e-02  1.267216e-02  3.694716e-02  1.267216e-02 -1.474379e+00
   1.556021e-01  1.877833e-02  1.306755e+00  1.877833e-02  8.748383e-02  1.877833e-02 -4.039977e+01
  -2.282520e-02  6.587446e-03  7.848954e-01  6.587446e-03 -1.297808e-02  6.587446e-03 -2.980972e+01
   2.759076e-01 -7.007738e-02  4.252907e-01 -7.007738e-02 -1.508098e-01 -7.007738e-02 -2.781311e+01
   7.613142e-01 -2.667143e-02 -2.427464e-01 -2.667143e-02 -9.270626e-02 -2.667143e-02 -4.495953e+01
   3.308783e-01 -2.499769e-03 -1.880997e-01 -2.499769e-03  1.798947e-01 -2.499769e-03 -2.692800e+01
   2.706501e-02 -7.299993e-02  4.475465e-01 -7.299993e-02 -1.829990e-02 -7.299993e-02 -1.401381e+01
   2.646707e+00  8.122295e-02 -9.287438e-01  8.122295e-02  4.696571e-02  8.122295e-02 -8.483872e+01
   9.535406e-01 -1.968214e-02 -3.232926e-01 -1.968214e-02  8.340616e-01 -1.968214e-02 -3.915445e+01
   2.194926e-04 -5.474025e-02  4.690387e-01 -5.474025e-02 -1.067795e-01 -5.474025e-02 -1.575472e+01
   5.212558e-01  9.763909e-03 -6.007923e-02  9.763909e-03  2.774211e-02  9.763909e-03 -1.671337e+01
   1.495984e-02 -7.913897e-03 -2.025652e-02 -7.913897e-03  1.910262e-02 -7.913897e-03 -2.896180e+00
 [ getOption("max.print") est atteint -- 20 lignes omises ]

Model rank =  8855 / 8855 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                   k'      edf k-index p-value  
s(measurement.no)                            9.00e+00 7.93e+00    1.02   0.905  
s(f0Zscore2)                                 9.00e+00 1.00e+00    1.00   0.525  
s(durationZscore2)                           2.90e+01 1.88e+00    1.00   0.635  
ti(measurement.no,f0Zscore2,durationZscore2) 3.08e+02 3.93e+01    0.98   0.095 .
ti(measurement.no,durationZscore2)           4.40e+01 8.53e+00    1.00   0.375  
ti(measurement.no,f0Zscore2)                 2.80e+01 1.03e+01    1.00   0.525  
ti(f0Zscore2,durationZscore2)                7.70e+01 6.80e+00    0.99   0.105  
s(word)                                      2.09e+02 8.08e+01      NA      NA  
s(wordPos)                                   3.31e+02 5.96e+01      NA      NA  
s(wordLeftRightTone)                         3.10e+02 5.56e+01      NA      NA  
s(measurement.no,wordPos)                    3.31e+02 8.99e+01      NA      NA  
s(f0Zscore2,wordPos)                         3.31e+02 5.39e+01      NA      NA  
s(durationZscore2,wordPos)                   3.31e+02 2.80e+01      NA      NA  
s(measurement.no,wordLeftRightTone)          3.10e+02 1.70e+02      NA      NA  
s(f0Zscore2,wordLeftRightTone)               3.10e+02 7.83e+01      NA      NA  
s(durationZscore2,wordLeftRightTone)         3.10e+02 3.15e+01      NA      NA  
s(measurement.no,word)                       2.09e+02 3.34e+01      NA      NA  
s(f0Zscore2,word)                            2.09e+02 5.79e+00      NA      NA  
s(durationZscore2,word)                      2.09e+02 1.40e-03      NA      NA  
s(measurement.no,speaker)                    1.00e+02 6.41e+01    1.02   0.910  
s(durationZscore2,speaker)                   3.00e+02 9.66e+00    1.00   0.660  
s(f0Zscore2,speaker)                         1.00e+02 4.03e+01    1.00   0.455  
s(measurement.no,speakerPos)                 3.00e+02 4.86e+01    1.02   0.875  
s(durationZscore2,speakerPos)                9.00e+02 1.42e+02    1.00   0.675  
s(f0Zscore2,speakerPos)                      3.00e+02 6.53e+01    1.00   0.505  
s(measurement.no,speakerLeftRightTone)       5.90e+02 1.13e+02    1.02   0.885  
s(durationZscore2,speakerLeftRightTone)      1.77e+03 2.52e+02    1.00   0.605  
s(f0Zscore2,speakerLeftRightTone)            5.90e+02 5.76e+01    1.00   0.475  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

# Plotting
# 3D plot 
# png("pred2-1.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.test2, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.25))),
        ylim = quantile(data.ai.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25 * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0 + global_mean0), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1, 
        zlim = c(450,750),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, nthreads = ncores, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.266227 to 1.296824. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.449662795901817. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(450,750), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
# dev.off()
# png("pred2-2.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.test2, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.5))),
        ylim = quantile(data.ai.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5 * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0 + global_mean0), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1, 
        zlim = c(450,750),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.266227 to 1.296824. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.0671853722597352. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(450,750), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
# dev.off()
# png("pred2-3.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.test2, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.75))),
        ylim = quantile(data.ai.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75 * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0 + global_mean0), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1, 
        zlim = c(450,750),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.266227 to 1.296824. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.637773887350503. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(450,750), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

# dev.off()
# Plotting
# 3D plot 
 png("pred2-1.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2a, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.25))),
        ylim = quantile(data.ai.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25 * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0 + global_mean0), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1, 
        zlim = c(450,750),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, nthreads = ncores, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.266227 to 1.296824. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.449662795901817. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(450,750), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
 dev.off()
null device 
          1 
 png("pred2-2.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2a, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.5))),
        ylim = quantile(data.ai.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5 * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0 + global_mean0), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1, 
        zlim = c(450,750),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.266227 to 1.296824. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.0671853722597352. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(450,750), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
 dev.off()
null device 
          1 
 png("pred2-3.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2a, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.75))),
        ylim = quantile(data.ai.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75 * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0 + global_mean0), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1, 
        zlim = c(450,750),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.266227 to 1.296824. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.637773887350503. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(450,750), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
 dev.off()
null device 
          1 
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_diff2(gamm.model2a, view=c("measurement.no","durationZscore2"),
           main = "",
           comp = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.8,0.2), na.rm = T)),
           ylim = quantile(data.ai.mas$durationZscore2, c(0.1,0.9), na.rm = T),
           transform.view = c(function(measurement.no) measurement.no, function(durationZscore2) durationZscore2 * global_sdd + global_meand), 
           print.summary = TRUE,
           sim.ci = F,
           show.diff = F,
           alpha.diff = 0.5,
         add.color.legend = FALSE, rm.ranef = TRUE,  
        xlab = "Time (Normalized)", ylab = "Duration (ms)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, hide.label = T)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * durationZscore2 : numeric predictor; with 30 values ranging from -0.786628 to 1.340871. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
abline(h = (1.2 * global_sdd + global_meand), lty=2,lwd=2, col = "white")

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_diff(gamm.model2a, view="measurement.no", comp=list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.8,0.2), na.rm = T)), cond = list(durationZscore2 = 1.3), 
          rm.ranef=TRUE, shade = F, main = "", xlab = "Time (normalized)", ylab = "Difference in F1 (Z)", xaxt = "n", font.lab = 2, cex.lab = 1, cex.axis = 1, lwd = 2, hide.label = T)
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * durationZscore2 : numeric predictor; set to the value(s): 1.3. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 

Difference is not significant.
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

png("diffduration1.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model2a, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.5), na.rm=T), durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.85))), col = "black", lwd = 4, xlab = "Time (Normalized)", ylab = "F1 (Z)", font.lab = 2, xaxt = "n", hide.label = T)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; set to the value(s): -0.0524849620085245. 
    * durationZscore2 : numeric predictor; set to the value(s): 1.06834268357208. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
plot_smooth(gamm.model2a, view="measurement.no",
             rug=F, rm.ranef = T, shade = F, cond = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.5), na.rm=T), durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.75))), col = "royalblue4", add = T, lwd = 4)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; set to the value(s): -0.0524849620085245. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.637773887350503. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
plot_smooth(gamm.model2a, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.5), na.rm=T), durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.5))), col = "chartreuse4", add = T, lwd = 4)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; set to the value(s): -0.0524849620085245. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.0671853722597352. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
plot_smooth(gamm.model2a, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.5), na.rm=T), durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.25))), col = "orange", add = T, lwd = 4)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; set to the value(s): -0.0524849620085245. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.449662795901817. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
plot_smooth(gamm.model2a, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.5), na.rm=T), durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.15))), col = "red", add = T, lwd = 4)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; set to the value(s): -0.0524849620085245. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.644619456704238. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
legend("topright", legend=c("15%", "25%", "50%", "75%", "85%"), 
       col=c("red","orange", "chartreuse4", "royalblue4", "black"), lwd=4)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
dev.off()
null device 
          1 
# absolute value of durations at 25%, 50% and 75%
duration0.15 = quantile(data.ai.mas$durationZscore2, c(0.15)) * global_sdd + global_meand

duration0.25 = quantile(data.ai.mas$durationZscore2, c(0.25)) * global_sdd + global_meand

duration0.5 = quantile(data.ai.mas$durationZscore2, c(0.5)) * global_sdd + global_meand

duration0.75 = quantile(data.ai.mas$durationZscore2, c(0.75)) * global_sdd + global_meand

duration0.85 = quantile(data.ai.mas$durationZscore2, c(0.85)) * global_sdd + global_meand
png("diffduration2.png", width = 6, height = 4, units = "in", res = 1000)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_smooth(gamm.model2a, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.5), na.rm=T), durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.85))), col = "black", lwd = 4, xlab = "Time (ms)", ylab = "F1 (Hz)", font.lab = 2, transform.view = function(measurement.no) measurement.no * duration0.85 * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1, xaxt = "n", hide.label = T)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; set to the value(s): -0.0524849620085245. 
    * durationZscore2 : numeric predictor; set to the value(s): 1.06834268357208. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model2a, view="measurement.no",
             rug=F, rm.ranef = T, shade = F, cond = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.5), na.rm=T), durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.75))), col = "royalblue4", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * duration0.75 * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; set to the value(s): -0.0524849620085245. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.637773887350503. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model2a, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.5), na.rm=T), durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.5))), col = "chartreuse4", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * duration0.5 * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; set to the value(s): -0.0524849620085245. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.0671853722597352. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model2a, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.5), na.rm=T), durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.25))), col = "orange", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * duration0.25 * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; set to the value(s): -0.0524849620085245. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.449662795901817. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: X-values are transformed.
plot_smooth(gamm.model2a, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.5), na.rm=T), durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.15))), col = "red", add = T, lwd = 4, transform.view = function(measurement.no) measurement.no * duration0.15 * 0.1, transform = function(f1Zscore2) f1Zscore2 * global_sd1 + global_mean1)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; set to the value(s): -0.0524849620085245. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.644619456704238. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: X-values are transformed.
legend("topright", legend=c("15%", "25%", "50%", "75%", "85%"), 
       col=c("red","orange", "chartreuse4", "royalblue4", "black"), lwd=4)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
# Generate the high resolution image for the paper
# output combined plot of 1000 dpi
png("pred2-diff-1c.png", width = 9, height = 7.5, units = "in", res = 1000)

layout(matrix(c(1, 2), nrow = 2, byrow = TRUE), heights = c(2, 1))

par(oma = c(4, 0, 1, 0), xaxs = "i", yaxs = "i")  

x_range <- range(data.ai.mas$measurement.no, na.rm = TRUE)


par(mar = c(0.5, 4, 1.5, 2)) 
plot_diff2(gamm.model2a,
           view = c("measurement.no", "durationZscore2"),
           main = "",
           comp = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.8, 0.2), na.rm = TRUE)),
           ylim = quantile(data.ai.mas$durationZscore2, c(0.05, 0.95), na.rm = TRUE),
           xlim = x_range,
           transform.view = c(function(measurement.no) measurement.no,
                              function(durationZscore2) durationZscore2 * global_sdd + global_meand), 
           sim.ci = FALSE,
           show.diff = FALSE,
           add.color.legend = FALSE,
           rm.ranef = TRUE,  
           xlab = "", ylab = "Duration (ms)",
           font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n",
           color = mapcols_pastel, hide.label = TRUE)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * durationZscore2 : numeric predictor; with 30 values ranging from -1.043110 to 1.889298. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
abline(h = (1.2 * global_sdd + global_meand), lty = 2, lwd = 2, col = "white")

par(mar = c(2, 4, 0.5, 2))
plot_diff(gamm.model2a,
          view = "measurement.no",
          comp = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.8, 0.2), na.rm = TRUE)),
          cond = list(durationZscore2 = 1.2),
          rm.ranef = TRUE,
          shade = FALSE,
          main = "",
          xlab = "", ylab = "Diff in F1 (Z)",
          xlim = x_range,
          xaxt = "n",
          font.lab = 2, cex.lab = 1, cex.axis = 1, lwd = 2, hide.label = TRUE)
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * durationZscore2 : numeric predictor; set to the value(s): 1.2. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 

Difference is not significant.
axis(1, at = tickvals, labels = ticknames, las = 1, cex.axis = 1)

mtext("Time (Normalized)", side = 1, outer = TRUE, line = 2.5, font = 2, cex = 1.3)

dev.off()
null device 
          1 

layout(matrix(c(1, 2), nrow = 2, byrow = TRUE), heights = c(2, 1))


par(oma = c(4, 0, 1, 0), xaxs = "i", yaxs = "i")

x_range <- range(data.ai.mas$measurement.no, na.rm = TRUE)


par(mar = c(0.5, 4, 1.5, 2))
plot_diff2(gamm.model2a,
           view = c("measurement.no", "durationZscore2"),
           main = "",
           comp = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.8, 0.2), na.rm = TRUE)),
           ylim = quantile(data.ai.mas$durationZscore2, c(0.05, 0.95), na.rm = TRUE),
           xlim = x_range,
           transform.view = c(function(measurement.no) measurement.no,
                              function(durationZscore2) durationZscore2 * global_sdd + global_meand), 
           sim.ci = FALSE,
           show.diff = FALSE,
           add.color.legend = FALSE,
           rm.ranef = TRUE,  
           xlab = "", ylab = "Duration (ms)",
           font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n",
           color = mapcols_pastel, hide.label = TRUE)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * durationZscore2 : numeric predictor; with 30 values ranging from -1.043110 to 1.889298. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
abline(h = (1.2 * global_sdd + global_meand), lty = 2, lwd = 2, col = "white")

par(mar = c(2, 4, 0.5, 2))
plot_diff(gamm.model2a,
          view = "measurement.no",
          comp = list(f0Zscore2 = quantile(data.ai.mas$f0Zscore2, c(0.8, 0.2), na.rm = TRUE)),
          cond = list(durationZscore2 = 1.2),
          rm.ranef = TRUE,
          shade = FALSE,
          main = "",
          xlab = "", ylab = "Diff in F1 (Z)",
          xlim = x_range,
          xaxt = "n",
          font.lab = 2, cex.lab = 1, cex.axis = 1, lwd = 2, hide.label = TRUE)
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * durationZscore2 : numeric predictor; set to the value(s): 1.2. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 

Difference is not significant.
axis(1, at = tickvals, labels = ticknames, las = 1, cex.axis = 1)


mtext("Time (Normalized)", side = 1, outer = TRUE, line = 2.5, font = 2, cex = 1.3)

Composition of f0 contours of different tones and the output of the second model.

# Modelling F2 ~ tone, with no autocorrelation

system.time(gamm.f0model.noAR <- bam(f0Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr"),
                        
                        
                        
                        
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores)
)
utilisateur     système      écoulé 
      0.313       0.004       0.082 
r.gamm.f0model <- start_value_rho(gamm.f0model.noAR)
# Modelling F2 ~ tone

# Final model with auto-correlation

system.time(gamm.f0model <- bam(f0Zscore2 ~ toneBis.ord + 
                        # smooth
                        s(measurement.no, bs="cr") +
                          
                        # smooth by factors
                        s(measurement.no, by=toneBis.ord, bs="cr"),
                        
                        
                        
                        
                    
                      data=data.ai.mas, method="fREML", rho = r.gamm.f0model, AR.start = data.ai.mas$start, discrete = TRUE, nthreads = ncores)
)
utilisateur     système      écoulé 
      0.306       0.016       0.119 
#Plotting
### retested ordered factors

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2a, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.5))),
        ylim = quantile(data.ai.mas$f0Zscore2, c(0.05,0.95), na.rm = T),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (Normalized)", ylab = "F0 (Z)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = "bw", xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.547736 to 1.651185. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.0671853722597352. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
#gradientLegend(valRange=c(450,750), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = "bw")
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)




plot_smooth(gamm.f0model, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", ylim = quantile(data.ai.mas$f0Zscore2, c(0.05,0.95), na.rm = T),,
            lwd = 4, xlab = "", ylab = "", xaxt = "n", font.lab = 2, add = T)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(gamm.f0model, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), 
            col = "orange", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(gamm.f0model, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), 
            col = "chartreuse4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(gamm.f0model, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), 
            col = "royalblue4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * NOTE : No random effects in the model to cancel.
 
legend("bottomright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=2)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

NA
NA
NA
#Plotting
### retested ordered factors
png("composition1.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2a, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.5))),
        ylim = quantile(data.ai.mas$f0Zscore2, c(0.05,0.95), na.rm = T),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (Normalized)", ylab = "F0 (Z)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = "bw", xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.547736 to 1.651185. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.0671853722597352. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
#gradientLegend(valRange=c(450,750), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = "bw")
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)




plot_smooth(gamm.f0model, view="measurement.no",
            main = "", rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "1"), col = "red", ylim = quantile(data.ai.mas$f0Zscore2, c(0.05,0.95), na.rm = T),,
            lwd = 4, xlab = "", ylab = "", xaxt = "n", font.lab = 2, add = T)
Summary:
    * toneBis.ord : factor; set to the value(s): 1. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(gamm.f0model, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "2"), 
            col = "orange", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 2. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(gamm.f0model, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "3"), 
            col = "chartreuse4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 3. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(gamm.f0model, view="measurement.no",
            rug=F, rm.ranef = T, shade = F, cond = list(toneBis.ord = "4"), 
            col = "royalblue4", add = T, lwd = 4)
Summary:
    * toneBis.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * NOTE : No random effects in the model to cancel.
 
legend("bottomright", legend=c("Tone 1", "Tone 2", "Tone 3", "Tone 4"), 
       col=c("red","orange", "chartreuse4", "royalblue4"), lwd=2)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

dev.off()
null device 
          1 

For Appendix C: test the model with te-tensor

system.time(gamm.model2ate.noAR <- bam(f1Zscore2 ~ 
                        # te tensor
                        
                        te(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1), 
                          
                          
 
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores)
)
utilisateur     système      écoulé 
  12489.633      67.634    1024.286 
saveRDS(gamm.model2ate.noAR, paste("Gamm_model2ate_noAR.rds"))
gamm.model2ate.noAR <- 
  readRDS("Gamm_model2ate_noAR.rds")
r.gamm.model2ate <- start_value_rho(gamm.model2ate.noAR)
system.time(gamm.model2ate <- bam(f1Zscore2 ~ 
                        # te tensor
                        
                        te(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1),
                      
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores, rho = r.gamm.model2ate, AR.start = data.ai.mas$start)
)
utilisateur     système      écoulé 
  12862.409      35.754    1036.876 
saveRDS(gamm.model2ate, paste("Gamm_model2ate.rds"))
gamm.model2ate <- 
  readRDS("Gamm_model2ate.rds")
summary(gamm.model2ate, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f1Zscore2 ~ te(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
    k = c(5, 8, 12)) + s(word, bs = "re") + s(wordPos, bs = "re") + 
    s(wordLeftRightTone, bs = "re") + s(wordPos, measurement.no, 
    bs = "re") + s(wordPos, f0Zscore2, bs = "re") + s(wordPos, 
    durationZscore2, bs = "re") + s(wordLeftRightTone, measurement.no, 
    bs = "re") + s(wordLeftRightTone, f0Zscore2, bs = "re") + 
    s(wordLeftRightTone, durationZscore2, bs = "re") + s(word, 
    measurement.no, bs = "re") + s(word, f0Zscore2, bs = "re") + 
    s(word, durationZscore2, bs = "re") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1) + s(measurement.no, speakerPos, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(durationZscore2, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1) + s(durationZscore2, speakerLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1)

Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.05259    0.05057   -1.04    0.298

Approximate significance of smooth terms:
                                               edf Ref.df     F p-value    
te(measurement.no,f0Zscore2,durationZscore2) 54.32  71.92 13.15  <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.771   Deviance explained = 80.3%
fREML = 6009.3  Scale est. = 0.13463   n = 11029
gam.check(gamm.model2ate)


Method: fREML   Optimizer: perf chol
$grad
 [1]  7.212009e-13 -2.522427e-13 -1.788791e-12  3.304024e-12 -1.247003e-12 -1.829648e-12
 [7]  4.263256e-14  8.171241e-14 -5.151435e-14  6.394885e-13 -3.197442e-13 -3.215206e-13
[13] -6.288303e-13  3.552714e-15 -9.134682e-05 -9.023893e-13 -9.264209e-05 -1.367795e-13
[19] -9.264209e-05 -4.014566e-13 -9.264209e-05  1.172396e-13  5.173639e-14  0.000000e+00
[25]  1.061373e-13  1.776357e-14  4.130030e-14 -1.563194e-13  3.774758e-14  3.979039e-13
[31]  3.730349e-14 -1.385558e-13 -8.393286e-14  1.455192e-11

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]
   5.188001e+00  7.070166e-02  1.115972e-01 -1.147504e-02  9.895278e-03  3.525500e-03
   7.070166e-02  9.012753e-01  4.572425e-01  8.988453e-02  2.261362e-02  3.699769e-02
   1.115972e-01  4.572425e-01  1.850239e+00  1.608275e-01  5.109433e-02  2.520025e-02
  -1.147504e-02  8.988453e-02  1.608275e-01  1.946286e+01  4.299996e+00  3.830146e+00
   9.895278e-03  2.261362e-02  5.109433e-02  4.299996e+00  9.064811e+00  7.070647e-01
   3.525500e-03  3.699769e-02  2.520025e-02  3.830146e+00  7.070647e-01  7.531835e+00
   1.396767e-02  1.015448e-01  9.147414e-02 -7.443352e-01  6.573249e-01  1.191398e-01
  -1.567791e-03  5.247568e-02  6.785587e-03 -7.783780e-02  4.203683e-01  1.004370e-01
  -2.376092e-03 -1.975131e-02  1.076698e-03  8.104132e-01  2.859538e-01  3.205752e-01
   4.822148e-04  1.540589e-01  2.596237e-01 -3.135857e+00 -6.797270e-01 -2.317508e+00
   1.953989e-02  1.173771e-01  1.956216e-01  1.129581e-02 -8.133214e-02 -3.831317e-01
   9.154741e-03 -3.501889e-02 -6.379211e-02  5.933564e-01  2.865775e-01  6.041066e-01
   7.658543e-04  2.644431e-02  7.693600e-02 -1.316617e+00 -2.380616e-01 -2.725343e-01
   2.047425e-03  3.872940e-03  9.241259e-03  8.669250e-03  5.948245e-03  1.468515e-02
   6.492905e-07  7.584493e-07  1.101168e-06  5.555260e-05  2.305081e-05  2.587461e-05
   8.540463e-02  1.604533e-02  6.317508e-02 -7.677012e-02 -3.605730e-02 -2.156512e-02
   9.413137e-07  2.165759e-06  1.267550e-05 -1.246160e-06  4.798679e-06 -2.154672e-05
   7.555759e-04  2.421823e-03  8.521740e-03  1.031988e-01  1.876452e-02  3.568459e-02
   9.413137e-07  2.165759e-06  1.267550e-05 -1.246160e-06  4.798679e-06 -2.154672e-05
   1.558590e-02 -1.113138e-01  1.182997e-01  4.005980e-02 -1.391299e-02 -4.520616e-02
   9.413138e-07  2.165759e-06  1.267550e-05 -1.246160e-06  4.798679e-06 -2.154672e-05
   1.103605e-02 -2.607238e-02 -1.440185e-02  3.551112e-01  1.816060e-01  5.029666e-02
   1.204923e-03 -3.165195e-03 -1.101602e-02 -4.121962e-02 -7.968617e-03 -1.805989e-02
   1.112656e-02  3.392380e-02  2.834617e-02  5.944516e-01  3.532166e-01  5.319058e-01
   1.204923e-03 -3.165195e-03 -1.101602e-02 -4.121962e-02 -7.968617e-03 -1.805989e-02
   1.057317e-02 -2.812451e-02 -1.271693e-02  1.915228e-01 -2.517857e-01  7.876653e-02
   1.204923e-03 -3.165195e-03 -1.101602e-02 -4.121962e-02 -7.968616e-03 -1.805989e-02
   4.483139e-02  1.891545e-01  1.770829e-02  1.195657e-01 -5.655524e-02  2.430439e-01
   7.039883e-04  1.909300e-03  8.748746e-03  1.703776e-02  7.875045e-03 -6.890274e-02
           [,7]          [,8]          [,9]         [,10]         [,11]         [,12]
   1.396767e-02 -1.567791e-03 -2.376092e-03  4.822148e-04  1.953989e-02  9.154741e-03
   1.015448e-01  5.247568e-02 -1.975131e-02  1.540589e-01  1.173771e-01 -3.501889e-02
   9.147414e-02  6.785587e-03  1.076698e-03  2.596237e-01  1.956216e-01 -6.379211e-02
  -7.443352e-01 -7.783780e-02  8.104132e-01 -3.135857e+00  1.129581e-02  5.933564e-01
   6.573249e-01  4.203683e-01  2.859538e-01 -6.797270e-01 -8.133214e-02  2.865775e-01
   1.191398e-01  1.004370e-01  3.205752e-01 -2.317508e+00 -3.831317e-01  6.041066e-01
   1.484122e+01  4.635109e-01 -3.397288e-01  9.540342e+00  9.281281e-02 -3.065428e-01
   4.635109e-01  7.541022e+00  1.351556e-01  1.943293e-01  3.270023e+00 -2.878651e-02
  -3.397288e-01  1.351556e-01  3.584680e+00 -4.106119e-01 -2.416990e-01  1.726895e+00
   9.540342e+00  1.943293e-01 -4.106119e-01  4.315220e+01 -2.123477e-01 -3.864110e-01
   9.281281e-02  3.270023e+00 -2.416990e-01 -2.123477e-01  7.852431e+00 -3.200757e-01
  -3.065428e-01 -2.878651e-02  1.726895e+00 -3.864110e-01 -3.200757e-01  3.268123e+00
   2.912164e+00 -2.732735e-02 -1.033708e-01  7.687327e+00  1.876938e-01 -1.014930e-01
   1.550674e-02  4.179317e-01  1.986650e-02  3.003052e-02  4.907111e-01 -1.934225e-02
  -2.327439e-05  1.196505e-05  1.805820e-04 -3.343304e-05 -2.267541e-05  1.928256e-04
   8.098802e-02  2.443496e-02 -3.570246e-02  1.685606e-01  1.225256e-01  3.187835e-02
   2.859237e-06 -1.337164e-05  3.076987e-06 -7.991972e-07 -6.619546e-06 -1.629600e-05
  -4.098497e-03 -8.939429e-03 -1.943172e-02 -5.706676e-02 -1.181631e-02 -1.125223e-02
   2.859237e-06 -1.337164e-05  3.076987e-06 -7.991972e-07 -6.619546e-06 -1.629600e-05
  -4.444425e-02  5.093016e-02 -4.151662e-02 -8.489854e-02 -2.481049e-01  1.705532e-02
   2.859237e-06 -1.337164e-05  3.076987e-06 -7.991972e-07 -6.619546e-06 -1.629600e-05
  -1.443533e-01 -8.831735e-04 -5.278766e-02 -3.330908e-01  1.061155e-01 -4.849169e-02
  -2.724834e-03 -4.684749e-02 -3.789710e-02  6.493868e-03 -3.854051e-02 -7.794985e-03
  -2.741598e-01 -3.962282e-01  1.638019e-01 -8.334225e-01  1.355954e-01  1.509934e-01
  -2.724834e-03 -4.684749e-02 -3.789710e-02  6.493868e-03 -3.854051e-02 -7.794985e-03
  -2.159544e-01 -4.495118e-01  4.878371e-02 -3.881891e-01  7.156239e-02  1.840412e-01
  -2.724834e-03 -4.684749e-02 -3.789710e-02  6.493868e-03 -3.854051e-02 -7.794985e-03
   7.704296e-01  3.334790e-01  3.799677e-02  2.669121e+00  9.832643e-01  1.042509e-02
  -2.335171e-02 -3.912630e-04 -7.549618e-02  8.387261e-02 -1.839649e-02 -4.976510e-02
          [,13]         [,14]         [,15]         [,16]         [,17]         [,18]
   7.658543e-04  2.047425e-03  6.492905e-07  8.540463e-02  9.413137e-07  7.555759e-04
   2.644431e-02  3.872940e-03  7.584493e-07  1.604533e-02  2.165759e-06  2.421823e-03
   7.693600e-02  9.241259e-03  1.101168e-06  6.317508e-02  1.267550e-05  8.521740e-03
  -1.316617e+00  8.669250e-03  5.555260e-05 -7.677012e-02 -1.246160e-06  1.031988e-01
  -2.380616e-01  5.948245e-03  2.305081e-05 -3.605730e-02  4.798679e-06  1.876452e-02
  -2.725343e-01  1.468515e-02  2.587461e-05 -2.156512e-02 -2.154672e-05  3.568459e-02
   2.912164e+00  1.550674e-02 -2.327439e-05  8.098802e-02  2.859237e-06 -4.098497e-03
  -2.732735e-02  4.179317e-01  1.196505e-05  2.443496e-02 -1.337164e-05 -8.939429e-03
  -1.033708e-01  1.986650e-02  1.805820e-04 -3.570246e-02  3.076987e-06 -1.943172e-02
   7.687327e+00  3.003052e-02 -3.343304e-05  1.685606e-01 -7.991972e-07 -5.706676e-02
   1.876938e-01  4.907111e-01 -2.267541e-05  1.225256e-01 -6.619546e-06 -1.181631e-02
  -1.014930e-01 -1.934225e-02  1.928256e-04  3.187835e-02 -1.629600e-05 -1.125223e-02
   3.381713e+00 -1.118427e-02 -8.776317e-06  6.630582e-02  9.706401e-07 -6.710163e-03
  -1.118427e-02  1.015506e-01 -1.476555e-06  1.794625e-02 -2.181901e-07  1.759602e-03
  -8.776317e-06 -1.476555e-06  9.136783e-05  2.062868e-06 -2.992420e-09  1.532424e-06
   6.630582e-02  1.794625e-02  2.062868e-06  2.943206e+01  8.965843e-06 -2.558432e-03
   9.706401e-07 -2.181901e-07 -2.992420e-09  8.965843e-06  9.270400e-05  5.194029e-06
  -6.710163e-03  1.759602e-03  1.532424e-06 -2.558432e-03  5.194029e-06  1.457989e-01
   9.706401e-07 -2.181901e-07 -2.992420e-09  8.965843e-06  6.191423e-08  5.194029e-06
  -1.839253e-02  2.297464e-03 -1.960974e-06  8.176173e-03 -9.523079e-05 -2.141524e-03
   9.706401e-07 -2.181901e-07 -2.992420e-09  8.965843e-06  6.191423e-08  5.194029e-06
  -1.364824e-02  1.713675e-02 -2.616396e-06  9.186364e-01  3.469226e-06  5.542084e-03
  -4.306343e-03 -4.453118e-03 -3.942696e-07  5.025075e-03  5.194090e-05 -4.597078e-04
  -2.349707e-01 -1.118681e-02 -1.523626e-05 -1.879890e-02  2.174704e-05  7.331150e-01
  -4.306343e-03 -4.453118e-03 -3.942696e-07  5.025075e-03  5.194090e-05 -4.597078e-04
  -1.223800e-02  1.402012e-02  1.297995e-05  1.316466e-02 -3.523722e-05  8.839315e-03
  -4.306343e-03 -4.453118e-03 -3.942696e-07  5.025075e-03  5.194090e-05 -4.597078e-04
   5.623135e-01  1.277940e-02  5.329717e-07  7.341681e-01  4.296872e-06  1.091782e-02
   1.005554e-02 -7.064315e-03 -6.826775e-06 -7.623853e-04  9.606364e-06  3.571841e-04
          [,19]         [,20]         [,21]         [,22]         [,23]         [,24]
   9.413137e-07  1.558590e-02  9.413138e-07  1.103605e-02  1.204923e-03  1.112656e-02
   2.165759e-06 -1.113138e-01  2.165759e-06 -2.607238e-02 -3.165195e-03  3.392380e-02
   1.267550e-05  1.182997e-01  1.267550e-05 -1.440185e-02 -1.101602e-02  2.834617e-02
  -1.246160e-06  4.005980e-02 -1.246160e-06  3.551112e-01 -4.121962e-02  5.944516e-01
   4.798679e-06 -1.391299e-02  4.798679e-06  1.816060e-01 -7.968617e-03  3.532166e-01
  -2.154672e-05 -4.520616e-02 -2.154672e-05  5.029666e-02 -1.805989e-02  5.319058e-01
   2.859237e-06 -4.444425e-02  2.859237e-06 -1.443533e-01 -2.724834e-03 -2.741598e-01
  -1.337164e-05  5.093016e-02 -1.337164e-05 -8.831735e-04 -4.684749e-02 -3.962282e-01
   3.076987e-06 -4.151662e-02  3.076987e-06 -5.278766e-02 -3.789710e-02  1.638019e-01
  -7.991972e-07 -8.489854e-02 -7.991972e-07 -3.330908e-01  6.493868e-03 -8.334225e-01
  -6.619546e-06 -2.481049e-01 -6.619546e-06  1.061155e-01 -3.854051e-02  1.355954e-01
  -1.629600e-05  1.705532e-02 -1.629600e-05 -4.849169e-02 -7.794985e-03  1.509934e-01
   9.706401e-07 -1.839253e-02  9.706401e-07 -1.364824e-02 -4.306343e-03 -2.349707e-01
  -2.181901e-07  2.297464e-03 -2.181901e-07  1.713675e-02 -4.453118e-03 -1.118681e-02
  -2.992420e-09 -1.960974e-06 -2.992420e-09 -2.616396e-06 -3.942696e-07 -1.523626e-05
   8.965843e-06  8.176173e-03  8.965843e-06  9.186364e-01  5.025075e-03 -1.879890e-02
   6.191423e-08 -9.523079e-05  6.191423e-08  3.469226e-06  5.194090e-05  2.174704e-05
   5.194029e-06 -2.141524e-03  5.194029e-06  5.542084e-03 -4.597078e-04  7.331150e-01
   9.270400e-05 -9.523079e-05  6.191423e-08  3.469226e-06  5.194090e-05  2.174704e-05
  -9.523079e-05  1.103906e+01 -9.523079e-05  6.351649e-03 -6.777299e-02  2.260902e-02
   6.191423e-08 -9.523079e-05  9.270400e-05  3.469226e-06  5.194090e-05  2.174704e-05
   3.469226e-06  6.351649e-03  3.469226e-06  7.779513e+00 -3.974299e-02 -3.554961e-02
   5.194090e-05 -6.777299e-02  5.194090e-05 -3.974299e-02  2.129867e-01  2.935215e-02
   2.174704e-05  2.260902e-02  2.174704e-05 -3.554961e-02  2.935215e-02  1.822489e+01
   5.194090e-05 -6.777299e-02  5.194090e-05 -3.974299e-02  2.129867e-01  2.935215e-02
  -3.523722e-05  2.680778e+00 -3.523722e-05 -4.409252e-02 -6.687288e-03 -2.346036e-01
   5.194090e-05 -6.777299e-02  5.194090e-05 -3.974299e-02  2.129867e-01  2.935215e-02
   4.296872e-06 -3.474327e-02  4.296872e-06  7.237061e-01  1.297742e-02  1.392221e-01
   9.606364e-06 -5.762978e-02  9.606364e-06 -4.462874e-03  1.514256e-02  7.467411e-03
          [,25]         [,26]         [,27]         [,28]         [,29]         [,30]
   1.204923e-03  1.057317e-02  1.204923e-03  4.483139e-02  7.039883e-04 -2.245349e-03
  -3.165195e-03 -2.812451e-02 -3.165195e-03  1.891545e-01  1.909300e-03  1.386755e-01
  -1.101602e-02 -1.271693e-02 -1.101602e-02  1.770829e-02  8.748746e-03  1.835951e-01
  -4.121962e-02  1.915228e-01 -4.121962e-02  1.195657e-01  1.703776e-02  1.412183e+00
  -7.968617e-03 -2.517857e-01 -7.968616e-03 -5.655524e-02  7.875045e-03  7.290499e-01
  -1.805989e-02  7.876653e-02 -1.805989e-02  2.430439e-01 -6.890274e-02  4.009883e-01
  -2.724834e-03 -2.159544e-01 -2.724834e-03  7.704296e-01 -2.335171e-02 -2.604793e-01
  -4.684749e-02 -4.495118e-01 -4.684749e-02  3.334790e-01 -3.912630e-04 -2.387759e-01
  -3.789710e-02  4.878371e-02 -3.789710e-02  3.799677e-02 -7.549618e-02  4.678023e-01
   6.493868e-03 -3.881891e-01  6.493868e-03  2.669121e+00  8.387261e-02 -9.756334e-01
  -3.854051e-02  7.156239e-02 -3.854051e-02  9.832643e-01 -1.839649e-02 -3.102992e-01
  -7.794985e-03  1.840412e-01 -7.794985e-03  1.042509e-02 -4.976510e-02  4.793494e-01
  -4.306343e-03 -1.223800e-02 -4.306343e-03  5.623135e-01  1.005554e-02 -8.571114e-02
  -4.453118e-03  1.402012e-02 -4.453118e-03  1.277940e-02 -7.064315e-03 -1.804930e-02
  -3.942696e-07  1.297995e-05 -3.942696e-07  5.329717e-07 -6.826775e-06 -2.735796e-05
   5.025075e-03  1.316466e-02  5.025075e-03  7.341681e-01 -7.623853e-04  8.896215e-02
   5.194090e-05 -3.523722e-05  5.194090e-05  4.296872e-06  9.606364e-06  1.318269e-04
  -4.597078e-04  8.839315e-03 -4.597078e-04  1.091782e-02  3.571841e-04  1.035238e+00
   5.194090e-05 -3.523722e-05  5.194090e-05  4.296872e-06  9.606364e-06  1.318269e-04
  -6.777299e-02  2.680778e+00 -6.777299e-02 -3.474327e-02 -5.762978e-02 -2.943663e-01
   5.194090e-05 -3.523722e-05  5.194090e-05  4.296872e-06  9.606364e-06  1.318269e-04
  -3.974299e-02 -4.409252e-02 -3.974299e-02  7.237061e-01 -4.462874e-03  7.064571e-02
   2.129867e-01 -6.687288e-03  2.129867e-01  1.297742e-02  1.514256e-02  3.372954e-02
   2.935215e-02 -2.346036e-01  2.935215e-02  1.392221e-01  7.467411e-03  8.423757e+00
   2.129867e-01 -6.687288e-03  2.129867e-01  1.297742e-02  1.514256e-02  3.372954e-02
  -6.687288e-03  1.187852e+01 -6.687288e-03  2.845516e-01  2.043815e-02  9.474120e-02
   2.129867e-01 -6.687288e-03  2.129867e-01  1.297742e-02  1.514256e-02  3.372954e-02
   1.297742e-02  2.845516e-01  1.297742e-02  1.702616e+01 -2.344143e-02 -1.507471e-01
   1.514256e-02  2.043815e-02  1.514256e-02 -2.344143e-02  2.329622e-01  4.788876e-01
          [,31]         [,32]         [,33]         [,34]
   7.039883e-04  5.618612e-03  7.039883e-04 -5.985552e+00
   1.909300e-03 -7.261482e-03  1.909300e-03 -7.167102e+00
   8.748746e-03  5.937652e-02  8.748746e-03 -1.050502e+01
   1.703776e-02  9.407675e-02  1.703776e-02 -4.222852e+01
   7.875045e-03 -8.985932e-03  7.875046e-03 -2.926044e+01
  -6.890274e-02 -1.610393e-01 -6.890274e-02 -2.667084e+01
  -2.335171e-02 -8.872845e-02 -2.335171e-02 -4.544298e+01
  -3.912630e-04  1.540029e-01 -3.912630e-04 -2.715213e+01
  -7.549618e-02 -1.206844e-02 -7.549618e-02 -1.386415e+01
   8.387261e-02  2.474264e-02  8.387261e-02 -8.309164e+01
  -1.839649e-02  8.323468e-01 -1.839649e-02 -3.983799e+01
  -4.976510e-02 -9.317467e-02 -4.976510e-02 -1.503665e+01
   1.005554e-02  2.429064e-02  1.005554e-02 -1.850145e+01
  -7.064315e-03  1.597305e-02 -7.064315e-03 -2.548287e+00
  -6.826775e-06 -4.802593e-06 -6.826775e-06 -9.135131e-04
  -7.623853e-04 -1.435675e-02 -7.623853e-04 -3.577030e+01
   9.606364e-06  7.799399e-06  9.606364e-06 -5.427271e-04
   3.571841e-04  3.800697e-02  3.571841e-04 -4.330749e+00
   9.606364e-06  7.799399e-06  9.606364e-06 -5.427271e-04
  -5.762978e-02  7.943718e-01 -5.762978e-02 -2.001912e+01
   9.606364e-06  7.799399e-06  9.606364e-06 -5.427271e-04
  -4.462874e-03  4.622193e-02 -4.462874e-03 -2.222955e+01
   1.514256e-02  2.880743e-02  1.514256e-02 -1.585267e+00
   7.467411e-03  2.429561e-03  7.467411e-03 -6.974299e+01
   1.514256e-02  2.880743e-02  1.514256e-02 -1.585267e+00
   2.043815e-02  5.117225e-01  2.043815e-02 -3.090183e+01
   1.514256e-02  2.880743e-02  1.514256e-02 -1.585267e+00
  -2.344143e-02 -4.951560e-02 -2.344143e-02 -5.565884e+01
   2.329622e-01  5.057901e-02  2.329622e-01 -2.071437e+00
 [ getOption("max.print") est atteint -- 5 lignes omises ]

Model rank =  8830 / 8830 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                   k'      edf k-index p-value  
te(measurement.no,f0Zscore2,durationZscore2) 4.79e+02 5.43e+01    1.02   0.940  
s(word)                                      2.09e+02 8.45e+01      NA      NA  
s(wordPos)                                   3.31e+02 5.85e+01      NA      NA  
s(wordLeftRightTone)                         3.10e+02 5.33e+01      NA      NA  
s(measurement.no,wordPos)                    3.31e+02 9.09e+01      NA      NA  
s(f0Zscore2,wordPos)                         3.31e+02 5.43e+01      NA      NA  
s(durationZscore2,wordPos)                   3.31e+02 2.77e+01      NA      NA  
s(measurement.no,wordLeftRightTone)          3.10e+02 1.66e+02      NA      NA  
s(f0Zscore2,wordLeftRightTone)               3.10e+02 7.97e+01      NA      NA  
s(durationZscore2,wordLeftRightTone)         3.10e+02 3.01e+01      NA      NA  
s(measurement.no,word)                       2.09e+02 3.70e+01      NA      NA  
s(f0Zscore2,word)                            2.09e+02 5.10e+00      NA      NA  
s(durationZscore2,word)                      2.09e+02 2.01e-03      NA      NA  
s(measurement.no,speaker)                    1.00e+02 7.15e+01    1.03   0.990  
s(durationZscore2,speaker)                   3.00e+02 8.66e+00    0.97   0.020 *
s(f0Zscore2,speaker)                         1.00e+02 4.00e+01    1.00   0.525  
s(measurement.no,speakerPos)                 3.00e+02 4.76e+01    1.03   0.990  
s(durationZscore2,speakerPos)                9.00e+02 1.43e+02    0.97   0.025 *
s(f0Zscore2,speakerPos)                      3.00e+02 6.50e+01    1.00   0.440  
s(measurement.no,speakerLeftRightTone)       5.90e+02 1.15e+02    1.03   0.995  
s(durationZscore2,speakerLeftRightTone)      1.77e+03 2.52e+02    0.97   0.040 *
s(f0Zscore2,speakerLeftRightTone)            5.90e+02 5.63e+01    1.00   0.450  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Model 2B: /ai/ female, F1 as output

system.time(gamm.model2b.noAR <- bam(f1Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1), 
                          
                          
 
                      data=data.ai.fem, method="fREML", discrete = TRUE, nthreads = ncores)
)
utilisateur     système      écoulé 
  12326.704      31.424    1068.052 
saveRDS(gamm.model2b.noAR, paste("Gamm_model2b_noAR.rds"))
gamm.model2b.noAR <- 
  readRDS("Gamm_model2b_noAR.rds")
r.gamm.model2b <- start_value_rho(gamm.model2b.noAR)
# Auto-regressive model

system.time(gamm.model2b <- bam(f1Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1), 
 
                        
                    
                      data=data.ai.fem, method="fREML", discrete = TRUE, nthreads = ncores, rho = r.gamm.model2b, AR.start = data.ai.fem$start)
)
utilisateur     système      écoulé 
  14126.204      38.013    1250.854 
saveRDS(gamm.model2b, paste("Gamm_model2b.rds"))
gamm.model2b <- 
  readRDS("Gamm_model2b.rds")
summary(gamm.model2b, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f1Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(word, bs = "re") + s(wordPos, 
    bs = "re") + s(wordLeftRightTone, bs = "re") + s(wordPos, 
    measurement.no, bs = "re") + s(wordPos, f0Zscore2, bs = "re") + 
    s(wordPos, durationZscore2, bs = "re") + s(wordLeftRightTone, 
    measurement.no, bs = "re") + s(wordLeftRightTone, f0Zscore2, 
    bs = "re") + s(wordLeftRightTone, durationZscore2, bs = "re") + 
    s(word, measurement.no, bs = "re") + s(word, f0Zscore2, bs = "re") + 
    s(word, durationZscore2, bs = "re") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1) + s(measurement.no, speakerPos, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(durationZscore2, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1) + s(durationZscore2, speakerLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1)

Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  0.22118    0.05384   4.108 4.02e-05 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
                                                edf Ref.df       F p-value    
s(measurement.no)                             8.063  8.233 128.643  <2e-16 ***
s(f0Zscore2)                                  3.926  4.392   3.229  0.0101 *  
s(durationZscore2)                            1.000  1.000   0.217  0.6418    
ti(measurement.no,f0Zscore2,durationZscore2) 34.234 49.415   1.167  0.2020    
ti(measurement.no,durationZscore2)           11.876 14.803  10.933  <2e-16 ***
ti(measurement.no,f0Zscore2)                 16.710 19.949   9.018  <2e-16 ***
ti(f0Zscore2,durationZscore2)                 7.521 10.185   0.421  0.9402    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.821   Deviance explained = 84.6%
fREML = 6042.4  Scale est. = 0.15276   n = 10275
gam.check(gamm.model2b)


Method: fREML   Optimizer: perf chol
$grad
 [1] -1.154632e-13  8.200107e-13 -6.545912e-05  6.128431e-14  7.949197e-14  3.286260e-14 -6.084022e-14  4.307665e-14 -7.975842e-13
[10] -1.813660e-12 -2.731149e-14 -1.620926e-14 -4.547474e-13 -1.350031e-13 -4.440892e-14 -7.815970e-14  2.220446e-13  6.394885e-13
[19]  1.200817e-12 -5.950795e-14  1.776357e-14 -4.263256e-13  1.030287e-13 -4.178096e-05  4.156675e-13 -4.280935e-05 -8.402220e-05
[28] -4.280935e-05 -2.415845e-13 -4.280935e-05 -1.350031e-13 -4.307665e-14 -3.410605e-13 -4.063416e-14  1.278977e-13 -3.375078e-14
[37]  5.684342e-14 -1.114664e-13 -1.421085e-13  1.110223e-14  2.700062e-13  1.021405e-13 -2.546585e-11

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]          [,7]          [,8]          [,9]
   3.707736e+00  4.256521e-03 -3.439787e-09  2.442660e-03  3.421694e-03 -1.903607e-03 -7.502210e-04 -1.601439e-03  3.364277e-03
   4.256521e-03  9.189438e-01  3.220334e-07  1.465172e-02 -3.858111e-03 -1.517274e-02  2.721292e-03 -3.969014e-03 -1.414825e-02
  -3.439787e-09  3.220334e-07  6.545714e-05 -3.760788e-06  9.383611e-07 -3.327170e-06 -7.868513e-07 -2.210888e-06 -5.816796e-08
   2.442660e-03  1.465172e-02 -3.760788e-06  7.610624e-01  1.448069e-01  4.618826e-01 -2.883147e-02  1.840424e-02  8.912138e-04
   3.421694e-03 -3.858111e-03  9.383611e-07  1.448069e-01  1.386301e+00  5.020525e-02  2.594245e-02 -9.027530e-03 -3.089210e-03
  -1.903607e-03 -1.517274e-02 -3.327170e-06  4.618826e-01  5.020525e-02  1.687185e+00  2.371818e-02  9.679929e-02  3.334126e-02
  -7.502210e-04  2.721292e-03 -7.868513e-07 -2.883147e-02  2.594245e-02  2.371818e-02  1.338760e+00  8.540904e-02 -9.741826e-03
  -1.601439e-03 -3.969014e-03 -2.210888e-06  1.840424e-02 -9.027530e-03  9.679929e-02  8.540904e-02  1.657790e+00 -2.379495e-02
   3.364277e-03 -1.414825e-02 -5.816796e-08  8.912138e-04 -3.089210e-03  3.334126e-02 -9.741826e-03 -2.379495e-02  2.008453e+00
   1.136789e-02  5.104034e-02 -7.630238e-07  4.056002e-02  5.407520e-02  9.755006e-02 -1.873891e-02  5.874106e-03  4.425884e-01
   1.239257e-03  1.670406e-03  1.548772e-06 -5.751456e-02 -1.982868e-01 -9.729562e-02  1.562958e-02  9.763144e-03 -1.229939e-02
   1.102703e-03 -1.660704e-02  5.343195e-06 -1.984499e-02 -8.209846e-02 -5.320451e-02  3.030190e-02  1.417672e-02 -3.852315e-03
  -1.578653e-02  1.547437e-02  6.338747e-07 -1.036205e-02  3.574669e-02  5.094951e-02 -1.008657e-02  3.166873e-02 -4.212262e-02
   2.095772e-03 -3.523878e-03 -4.866094e-07 -6.211851e-03  5.345944e-02 -3.233403e-02  2.379904e-03  2.467704e-02  6.401218e-04
  -2.112522e-03  3.748217e-04 -2.005465e-07 -8.753664e-03  3.638299e-03 -1.226126e-03 -1.551054e-03 -5.584742e-03  3.312064e-03
  -5.267709e-04  5.218394e-02 -1.246325e-06 -5.760342e-02 -1.567993e-01 -8.965645e-02 -2.919315e-03 -2.412261e-02  2.464823e-03
  -4.230387e-03 -5.615988e-02  2.149096e-06  3.485224e-02 -5.334621e-02 -4.159954e-02  1.021466e-02  2.163986e-03  3.026618e-02
  -1.450772e-03  1.285785e-02  1.927457e-05 -4.754317e-02  8.315131e-02  5.437533e-02 -3.143423e-03  7.629090e-03  3.443392e-03
   5.960704e-03  3.276056e-02  6.151179e-06 -1.224078e-01  6.325730e-02 -3.480853e-02  3.261042e-02  8.454598e-02  2.489642e-02
   5.921876e-04 -1.748254e-02  3.849830e-07  1.903181e-02 -7.069135e-03  3.021515e-02  9.385444e-03  1.381304e-03  1.007014e-02
   1.282710e-03 -2.497039e-02  7.961872e-06  1.264334e-03  2.140173e-02  4.725367e-02 -8.661230e-03  1.479329e-02 -1.677438e-03
   4.188663e-03 -7.086206e-03  1.218690e-06 -7.315618e-02  1.453096e-02 -5.501964e-03 -1.695322e-03  1.051208e-02  1.364478e-02
  -9.935313e-03 -1.378086e-01  1.189511e-06  8.069501e-02 -1.085931e-02 -2.907726e-02  6.231357e-03 -2.271116e-02  4.063509e-02
          [,10]         [,11]         [,12]         [,13]         [,14]         [,15]         [,16]         [,17]         [,18]
   1.136789e-02  1.239257e-03  1.102703e-03 -1.578653e-02  2.095772e-03 -2.112522e-03 -5.267709e-04 -4.230387e-03 -1.450772e-03
   5.104034e-02  1.670406e-03 -1.660704e-02  1.547437e-02 -3.523878e-03  3.748217e-04  5.218394e-02 -5.615988e-02  1.285785e-02
  -7.630238e-07  1.548772e-06  5.343195e-06  6.338747e-07 -4.866094e-07 -2.005465e-07 -1.246325e-06  2.149096e-06  1.927457e-05
   4.056002e-02 -5.751456e-02 -1.984499e-02 -1.036205e-02 -6.211851e-03 -8.753664e-03 -5.760342e-02  3.485224e-02 -4.754317e-02
   5.407520e-02 -1.982868e-01 -8.209846e-02  3.574669e-02  5.345944e-02  3.638299e-03 -1.567993e-01 -5.334621e-02  8.315131e-02
   9.755006e-02 -9.729562e-02 -5.320451e-02  5.094951e-02 -3.233403e-02 -1.226126e-03 -8.965645e-02 -4.159954e-02  5.437533e-02
  -1.873891e-02  1.562958e-02  3.030190e-02 -1.008657e-02  2.379904e-03 -1.551054e-03 -2.919315e-03  1.021466e-02 -3.143423e-03
   5.874106e-03  9.763144e-03  1.417672e-02  3.166873e-02  2.467704e-02 -5.584742e-03 -2.412261e-02  2.163986e-03  7.629090e-03
   4.425884e-01 -1.229939e-02 -3.852315e-03 -4.212262e-02  6.401218e-04  3.312064e-03  2.464823e-03  3.026618e-02  3.443392e-03
   2.196416e+00 -3.460756e-02 -4.563079e-03  6.998535e-02  1.295302e-02  2.851291e-03  1.074017e-02  3.310892e-02 -1.497605e-02
  -3.460756e-02  4.136977e-01 -1.410149e-02 -9.617042e-03  2.584312e-02  5.081978e-04 -3.186518e-02  7.243879e-03  6.563478e-02
  -4.563079e-03 -1.410149e-02  3.356852e-01 -2.833595e-02  4.070835e-02 -6.603301e-03  1.508749e-02  1.399706e-02 -7.166678e-03
   6.998535e-02 -9.617042e-03 -2.833595e-02  3.060133e+01  3.159382e+00  3.883270e-01 -7.558851e-01  5.507709e-01  2.845231e+00
   1.295302e-02  2.584312e-02  4.070835e-02  3.159382e+00  4.066880e+00  9.823880e-02  6.603126e-03 -4.640528e-01  9.035645e-01
   2.851291e-03  5.081978e-04 -6.603301e-03  3.883270e-01  9.823880e-02  2.088139e-01  1.192619e-02 -5.773894e-03  1.153831e-01
   1.074017e-02 -3.186518e-02  1.508749e-02 -7.558851e-01  6.603126e-03  1.192619e-02  1.082043e+01  4.186514e-01  1.857964e-01
   3.310892e-02  7.243879e-03  1.399706e-02  5.507709e-01 -4.640528e-01 -5.773894e-03  4.186514e-01  2.051420e+00  6.970931e-02
  -1.497605e-02  6.563478e-02 -7.166678e-03  2.845231e+00  9.035645e-01  1.153831e-01  1.857964e-01  6.970931e-02  9.392829e+00
   4.223383e-02 -2.612511e-02 -7.654614e-02 -2.448966e+00 -4.105140e-01 -6.281418e-02  4.972201e+00  5.145318e-01 -6.467412e-01
   1.751672e-02  1.712842e-03  1.322051e-03  2.704772e-01  7.513104e-02  1.204274e-01  1.559655e-01  6.218947e-02  1.705923e-01
  -9.745778e-03  1.917097e-02 -6.132109e-03  5.992586e-01  2.239934e-01  2.165978e-03 -7.742008e-02  8.740747e-02  1.789560e+00
   2.612878e-02  1.769715e-03 -4.895969e-02 -2.051214e+00 -1.608512e-01  5.073363e-02  3.838970e+00  1.064557e-01 -2.970552e-01
   1.144204e-01  2.065354e-02  2.706421e-02  1.736339e+00  4.409520e-02  1.556678e-02  3.067167e-01  7.150232e-01  1.676066e-01
          [,19]         [,20]         [,21]         [,22]         [,23]         [,24]         [,25]         [,26]         [,27]
   5.960704e-03  5.921876e-04  1.282710e-03  4.188663e-03 -9.935313e-03 -2.927822e-09 -1.126736e-01  2.063706e-07  5.679475e-10
   3.276056e-02 -1.748254e-02 -2.497039e-02 -7.086206e-03 -1.378086e-01  2.069708e-06 -1.599335e-02 -1.424205e-06 -2.295523e-07
   6.151179e-06  3.849830e-07  7.961872e-06  1.218690e-06  1.189511e-06  8.542022e-10  6.283127e-07  1.000627e-10 -2.313943e-10
  -1.224078e-01  1.903181e-02  1.264334e-03 -7.315618e-02  8.069501e-02 -4.055333e-06  1.359483e-02  2.833859e-07 -1.032704e-07
   6.325730e-02 -7.069135e-03  2.140173e-02  1.453096e-02 -1.085931e-02  3.638271e-06  6.263286e-02  2.406207e-07  1.117282e-07
  -3.480853e-02  3.021515e-02  4.725367e-02 -5.501964e-03 -2.907726e-02  4.895228e-06 -1.638895e-02  1.265264e-06  3.374885e-08
   3.261042e-02  9.385444e-03 -8.661230e-03 -1.695322e-03  6.231357e-03 -7.945661e-07 -1.022864e-02 -4.546403e-07  2.608783e-08
   8.454598e-02  1.381304e-03  1.479329e-02  1.051208e-02 -2.271116e-02  6.371346e-07 -3.968230e-02 -4.601972e-07  4.017057e-08
   2.489642e-02  1.007014e-02 -1.677438e-03  1.364478e-02  4.063509e-02  6.680684e-07 -1.169641e-02 -1.162130e-07  9.070731e-08
   4.223383e-02  1.751672e-02 -9.745778e-03  2.612878e-02  1.144204e-01 -1.998127e-08 -5.077127e-02  1.420412e-06  1.903548e-07
  -2.612511e-02  1.712842e-03  1.917097e-02  1.769715e-03  2.065354e-02  1.141493e-06 -1.991763e-02  1.042390e-06  1.714204e-07
  -7.654614e-02  1.322051e-03 -6.132109e-03 -4.895969e-02  2.706421e-02 -4.772511e-06  1.164458e-02  5.515525e-07  2.420428e-07
  -2.448966e+00  2.704772e-01  5.992586e-01 -2.051214e+00  1.736339e+00  1.836389e-04 -1.754743e-01  7.199164e-06  8.696583e-07
  -4.105140e-01  7.513104e-02  2.239934e-01 -1.608512e-01  4.409520e-02  4.122814e-05 -4.420270e-02 -3.065338e-06  2.447069e-06
  -6.281418e-02  1.204274e-01  2.165978e-03  5.073363e-02  1.556678e-02  2.582221e-06  2.382805e-03 -7.383779e-07 -1.430373e-07
   4.972201e+00  1.559655e-01 -7.742008e-02  3.838970e+00  3.067167e-01  7.603453e-06  3.544592e-02 -1.411772e-06  1.244612e-06
   5.145318e-01  6.218947e-02  8.740747e-02  1.064557e-01  7.150232e-01  1.234079e-05  8.010500e-03  3.089144e-06 -2.148769e-07
  -6.467412e-01  1.705923e-01  1.789560e+00 -2.970552e-01  1.676066e-01  3.699203e-04  8.395095e-04  6.285854e-06  2.143050e-07
   2.381442e+01  2.875230e-01 -1.373224e-01  6.895438e+00  7.449990e-01 -3.816212e-05  1.125088e-01 -1.194895e-05  1.371771e-06
   2.875230e-01  7.154664e-01  3.946369e-02  9.198456e-02  3.303410e-01  1.402755e-05 -2.123527e-02 -2.537410e-07 -2.129906e-07
  -1.373224e-01  3.946369e-02  1.422359e+00 -6.214697e-02  1.689112e-01  1.378430e-04  3.640939e-02  3.214758e-07  2.178567e-06
   6.895438e+00  9.198456e-02 -6.214697e-02  9.064746e+00  9.947550e-02 -3.106739e-05  9.305814e-02 -5.376336e-06  1.158183e-07
   7.449990e-01  3.303410e-01  1.689112e-01  9.947550e-02  6.282353e+00  3.348708e-05  2.934651e-02 -4.049287e-06 -8.172477e-07
          [,28]         [,29]         [,30]         [,31]         [,32]         [,33]         [,34]         [,35]         [,36]
   2.063706e-07  3.882457e-03  2.063706e-07 -1.201027e-02  3.575219e-04  5.991798e-03  3.575219e-04  1.459972e-03  3.575219e-04
  -1.424205e-06  1.981334e-01 -1.424205e-06 -1.616030e-02  1.893807e-03 -5.413682e-02  1.893807e-03  6.139140e-02  1.893807e-03
   1.000627e-10 -4.814658e-07  1.000627e-10 -6.150504e-07 -1.024752e-06 -1.265386e-05 -1.024752e-06 -2.071258e-06 -1.024752e-06
   2.833859e-07 -9.504335e-03  2.833859e-07 -4.858236e-03  2.030337e-03  5.637752e-02  2.030337e-03 -1.469745e-01  2.030337e-03
   2.406207e-07  3.514388e-03  2.406207e-07 -5.775960e-02  2.358644e-04  5.221101e-02  2.358644e-04 -7.276791e-02  2.358644e-04
   1.265264e-06 -4.315125e-02  1.265264e-06 -1.072021e-01 -3.345519e-03  2.185744e-02 -3.345519e-03 -9.028374e-02 -3.345519e-03
  -4.546403e-07 -2.099338e-02 -4.546403e-07 -4.224940e-02 -4.827818e-04 -3.737540e-03 -4.827818e-04  1.759567e-02 -4.827818e-04
  -4.601972e-07  4.877339e-03 -4.601972e-07 -4.949194e-02 -4.384994e-04  4.147029e-02 -4.384994e-04  1.852035e-02 -4.384994e-04
  -1.162130e-07 -9.552986e-03 -1.162130e-07 -4.730307e-02  2.714356e-04  2.192485e-02  2.714356e-04 -2.855575e-02  2.714356e-04
   1.420412e-06  4.244325e-02  1.420412e-06 -5.468679e-03  6.848355e-03  1.453524e-03  6.848355e-03  1.193266e-01  6.848355e-03
   1.042390e-06 -5.752209e-02  1.042390e-06 -1.771742e-02  5.252320e-03  9.797827e-02  5.252320e-03  4.410153e-02  5.252320e-03
   5.515525e-07  5.603375e-03  5.515525e-07  1.247973e-02 -1.151208e-03  1.686217e-01 -1.151208e-03 -2.258599e-02 -1.151208e-03
   7.199164e-06  9.546758e-02  7.199164e-06  1.291672e-01  6.876345e-02  1.242513e+00  6.876345e-02  1.028768e-01  6.876345e-02
  -3.065338e-06  2.304229e-02 -3.065338e-06  3.707421e-02 -7.060139e-03  1.807025e-01 -7.060139e-03 -4.069938e-01 -7.060139e-03
  -7.383779e-07  3.352754e-03 -7.383779e-07 -3.584898e-03  7.647388e-03 -2.576808e-02  7.647388e-03 -1.274355e-03  7.647388e-03
  -1.411772e-06  2.575157e-02 -1.411772e-06  1.358725e-01 -9.622110e-03 -9.981120e-02 -9.622110e-03 -2.260521e-01 -9.622110e-03
   3.089144e-06 -2.834340e-02  3.089144e-06 -9.396728e-03  1.458265e-02  2.164233e-01  1.458265e-02  1.858056e-01  1.458265e-02
   6.285854e-06 -7.385295e-02  6.285854e-06  1.211209e-01  8.944856e-02  1.586626e+00  8.944856e-02  1.447643e-01  8.944856e-02
  -1.194895e-05  1.183999e-01 -1.194895e-05  4.141820e-02 -2.298850e-02 -2.146522e-01 -2.298850e-02  3.737647e-01 -2.298850e-02
  -2.537410e-07 -1.910550e-02 -2.537410e-07 -2.826044e-02 -2.842588e-06  1.873720e-02 -2.842588e-06  1.225322e-01 -2.842588e-06
   3.214758e-07 -5.139584e-02  3.214758e-07  2.836610e-02  2.668043e-02  8.316054e-01  2.668043e-02 -3.552386e-02  2.668043e-02
  -5.376336e-06 -9.337402e-04 -5.376336e-06  3.900724e-02 -1.605477e-02 -6.881064e-02 -1.605477e-02  2.453334e-01 -1.605477e-02
  -4.049287e-06  7.213868e-02 -4.049287e-06 -1.690925e-01 -3.207616e-02 -6.146330e-01 -3.207616e-02  2.494164e-01 -3.207616e-02
          [,37]         [,38]         [,39]         [,40]         [,41]         [,42]         [,43]
   1.577319e-02 -2.751835e-04 -1.000108e-03 -2.751835e-04 -3.434716e-03 -2.751835e-04 -3.531617e+00
  -1.259132e-02 -5.690304e-03 -2.238120e-02 -5.690304e-03 -1.188775e-02 -5.690304e-03 -1.462751e+00
  -2.373815e-06  1.029718e-07 -1.671917e-05  1.029718e-07 -2.918244e-06  1.029718e-07 -3.644364e-05
   8.362720e-02  2.313893e-03  6.035128e-02  2.313893e-03  2.122411e-02  2.313893e-03 -5.332093e+00
   9.492845e-02  7.694474e-03  1.255966e-01  7.694474e-03  4.262244e-03  7.694474e-03 -3.567155e+00
   1.187391e-01  1.153349e-02 -5.436739e-02  1.153349e-02  1.669989e-02  1.153349e-02 -7.717775e+00
  -3.412461e-03  1.576106e-03  7.670558e-03  1.576106e-03  9.425288e-03  1.576106e-03 -1.801526e+00
   6.458537e-03  4.180304e-05  2.908242e-02  4.180304e-05  5.071690e-02  4.180304e-05 -3.636457e+00
   8.876498e-02 -2.081839e-03  4.936132e-02 -2.081839e-03 -3.091464e-02 -2.081839e-03 -3.366687e+00
   8.792320e-02  4.636077e-03  9.053258e-02  4.636077e-03  2.238453e-02  4.636077e-03 -4.488497e+00
  -6.303788e-02  7.740886e-03  4.573763e-02  7.740886e-03  4.939773e-02  7.740886e-03 -1.522955e+00
  -1.993041e-02  4.651129e-03  9.667978e-03  4.651129e-03  4.201227e-02  4.651129e-03 -1.737318e+00
   1.409098e-01  4.241670e-02  1.393120e+00  4.241670e-02  2.900452e-01  4.241670e-02 -5.553566e+01
   2.332679e-01 -2.153071e-02  5.126337e-01 -2.153071e-02  6.951312e-02 -2.153071e-02 -1.945388e+01
  -1.142538e-02  1.509765e-02  8.690495e-02  1.509765e-02 -7.460638e-02  1.509765e-02 -2.557287e+00
   6.108820e-01 -1.268221e-02  3.518212e-01 -1.268221e-02  8.051495e-02 -1.268221e-02 -3.923389e+01
   2.640660e-01 -2.724879e-03  2.692114e-01 -2.724879e-03  8.715751e-02 -2.724879e-03 -1.180842e+01
   1.244480e-01  7.084991e-02  9.191380e-01  7.084992e-02  3.940943e-01  7.084992e-02 -3.540107e+01
   2.462195e+00  1.194610e-01 -2.940413e-01  1.194610e-01  7.824849e-01  1.194610e-01 -5.825920e+01
   1.152969e-01  3.346237e-02  1.493990e-01  3.346237e-02 -1.479669e-01  3.346237e-02 -6.572260e+00
   1.052722e-01  4.979546e-02  7.842352e-01  4.979546e-02 -2.052034e-03  4.979546e-02 -1.102390e+01
   4.932294e-01 -7.583424e-03 -1.134310e-01 -7.583424e-03  1.580448e-01 -7.583424e-03 -2.883684e+01
   1.012813e-01  5.779883e-02  7.477003e-02  5.779883e-02  4.934622e-01  5.779883e-02 -2.579244e+01
 [ getOption("max.print") est atteint -- 20 lignes omises ]

Model rank =  8663 / 8663 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                   k'      edf k-index p-value
s(measurement.no)                            9.00e+00 8.06e+00    1.01    0.64
s(f0Zscore2)                                 9.00e+00 3.93e+00    0.99    0.34
s(durationZscore2)                           2.90e+01 1.00e+00    1.00    0.43
ti(measurement.no,f0Zscore2,durationZscore2) 3.08e+02 3.42e+01    1.02    0.94
ti(measurement.no,durationZscore2)           4.40e+01 1.19e+01    1.04    1.00
ti(measurement.no,f0Zscore2)                 2.80e+01 1.67e+01    0.99    0.15
ti(f0Zscore2,durationZscore2)                7.70e+01 7.52e+00    0.99    0.34
s(word)                                      2.03e+02 1.11e+02      NA      NA
s(wordPos)                                   3.09e+02 3.89e+01      NA      NA
s(wordLeftRightTone)                         2.90e+02 5.11e+00      NA      NA
s(measurement.no,wordPos)                    3.09e+02 7.85e+01      NA      NA
s(f0Zscore2,wordPos)                         3.09e+02 2.36e+01      NA      NA
s(durationZscore2,wordPos)                   3.09e+02 7.08e+01      NA      NA
s(measurement.no,wordLeftRightTone)          2.90e+02 1.17e+02      NA      NA
s(f0Zscore2,wordLeftRightTone)               2.90e+02 1.31e+01      NA      NA
s(durationZscore2,wordLeftRightTone)         2.90e+02 2.20e+01      NA      NA
s(measurement.no,word)                       2.03e+02 5.77e+01      NA      NA
s(f0Zscore2,word)                            2.03e+02 5.16e+01      NA      NA
s(durationZscore2,word)                      2.03e+02 3.98e-03      NA      NA
s(measurement.no,speaker)                    1.00e+02 5.77e+01    1.01    0.64
s(durationZscore2,speaker)                   3.00e+02 8.78e-04    1.00    0.33
s(f0Zscore2,speaker)                         1.00e+02 3.48e+01    0.99    0.30
s(measurement.no,speakerPos)                 3.00e+02 7.22e+01    1.01    0.57
s(durationZscore2,speakerPos)                9.00e+02 1.67e+02    1.00    0.43
s(f0Zscore2,speakerPos)                      3.00e+02 6.79e+01    0.99    0.36
s(measurement.no,speakerLeftRightTone)       5.90e+02 1.13e+02    1.01    0.56
s(durationZscore2,speakerLeftRightTone)      1.77e+03 1.66e+02    1.00    0.39
s(f0Zscore2,speakerLeftRightTone)            5.90e+02 9.40e+01    0.99    0.35


duration0.25f = quantile(data.ai.fem$durationZscore2, c(0.25)) * global_sddf + global_meandf

duration0.5f = quantile(data.ai.fem$durationZscore2, c(0.5)) * global_sddf + global_meandf

duration0.75f = quantile(data.ai.fem$durationZscore2, c(0.75)) * global_sddf + global_meandf
# 3D plotting

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2b, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.fem$durationZscore2, c(0.25))),
        ylim = quantile(data.ai.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25f * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0f + global_mean0f), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1f + global_mean1f, 
        zlim = c(500,1000),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.243937 to 1.329686. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.627777955022104. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(500,1000), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.model2b, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2. = quantile(data.ai.fem$durationZscore2, c(0.5))),
        ylim = quantile(data.ai.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5f * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0f + global_mean0f), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1f + global_mean1f, 
        zlim = c(500,1000),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.243937 to 1.329686. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.0952338520379409. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(500,1000), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.model2b, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.fem$durationZscore2, c(0.75))),
        ylim = quantile(data.ai.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75f * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0f + global_mean0f),
        transform = function(f1Zscore2) f1Zscore2 * global_sd1f + global_mean1f, 
        zlim = c(500,1000),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.243937 to 1.329686. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.525044865601105. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(500,1000), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

NA
NA
NA
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_diff2(gamm.model2b, view=c("measurement.no","durationZscore2"),
           main = "",
           comp = list(f0Zscore2 = quantile(data.ai.fem$f0Zscore2, c(0.8,0.2), na.rm = T)),
           ylim = quantile(data.ai.fem$durationZscore2, c(0.05,0.95), na.rm = T),
           transform.view = c(function(measurement.no) measurement.no, function(durationZscore2) durationZscore2 * global_sddf + global_meandf), 
           #zlim = c(-0.5,0.5),
           print.summary = TRUE,
           sim.ci = F,
           show.diff = F,
           #color = "heat",
           alpha.diff = 0.5,
           #plot.type = "perp",
           #n.grid =300,
         add.color.legend = FALSE, rm.ranef = TRUE,  
        xlab = "Time (Normalized)", ylab = "Duration (ms)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, hide.label = T)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * durationZscore2 : numeric predictor; with 30 values ranging from -1.397262 to 1.834229. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
#gradientLegend(valRange=c(-50,20), length=.5, pos=.75, depth = 0.02, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

#abline(h = (1.2 * global_sdd1 + global_meand1), lty=2,lwd=2, col = "white")
# 3D plotting
 png("pred2-4.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2b, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.fem$durationZscore2, c(0.25))),
        ylim = quantile(data.ai.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25f * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0f + global_mean0f), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1f + global_mean1f, 
        zlim = c(500,1000),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.243937 to 1.329686. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.627777955022104. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(500,1000), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
 png("pred2-5.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2b, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2. = quantile(data.ai.fem$durationZscore2, c(0.5))),
        ylim = quantile(data.ai.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5f * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0f + global_mean0f), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1f + global_mean1f, 
        zlim = c(500,1000),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.243937 to 1.329686. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.0952338520379409. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(500,1000), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
 png("pred2-6.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2b, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.fem$durationZscore2, c(0.75))),
        ylim = quantile(data.ai.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75f * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0f + global_mean0f),
        transform = function(f1Zscore2) f1Zscore2 * global_sd1f + global_mean1f, 
        zlim = c(500,1000),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.243937 to 1.329686. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.525044865601105. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(500,1000), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
 png("pred2-diff-2.png", width = 6, height = 4, units = "in", res = 1000)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_diff2(gamm.model2b, view=c("measurement.no","durationZscore2"),
           main = "",
           comp = list(f0Zscore2 = quantile(data.ai.fem$f0Zscore2, c(0.8,0.2), na.rm = T)),
           ylim = quantile(data.ai.fem$durationZscore2, c(0.05,0.95), na.rm = T),
           transform.view = c(function(measurement.no) measurement.no, function(durationZscore2) durationZscore2 * global_sddf + global_meandf), 
           #zlim = c(-0.5,0.5),
           print.summary = TRUE,
           sim.ci = F,
           show.diff = F,
           #color = "heat",
           alpha.diff = 0.5,
           #plot.type = "perp",
           #n.grid =300,
         add.color.legend = FALSE, rm.ranef = TRUE,  
        xlab = "Time (Normalized)", ylab = "Duration (ms)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, hide.label = T)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * durationZscore2 : numeric predictor; with 30 values ranging from -1.397262 to 1.834229. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
#gradientLegend(valRange=c(-50,20), length=.5, pos=.75, depth = 0.02, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
#abline(h = (1.2 * global_sdd1 + global_meand1), lty=2,lwd=2, col = "white")
dev.off()
null device 
          1 

Model 2C: /au/ male, F1 as output

system.time(gamm.model2c.noAR <- bam(f1Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1), 
                          
                          
 
                      data=data.au.mas, method="fREML", discrete = TRUE, nthreads = ncores)
)
utilisateur     système      écoulé 
  42782.578      73.628    3322.641 
saveRDS(gamm.model2c.noAR, paste("Gamm_model2c_noAR.rds"))
gamm.model2c.noAR <- 
  readRDS("Gamm_model2c_noAR.rds")
r.gamm.model2c <- start_value_rho(gamm.model2c.noAR)
# Auto-regressive model

system.time(gamm.model2c <- bam(f1Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1), 
 
                        
                    
                      data=data.au.mas, method="fREML", discrete = TRUE, nthreads = ncores, rho = r.gamm.model2c, AR.start = data.au.mas$start)
)
utilisateur     système      écoulé 
  35382.552      58.781    2753.721 
saveRDS(gamm.model2c, paste("Gamm_model2c.rds"))
gamm.model2c <- 
  readRDS("Gamm_model2c.rds")
summary(gamm.model2c, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f1Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(word, bs = "re") + s(wordPos, 
    bs = "re") + s(wordLeftRightTone, bs = "re") + s(wordPos, 
    measurement.no, bs = "re") + s(wordPos, f0Zscore2, bs = "re") + 
    s(wordPos, durationZscore2, bs = "re") + s(wordLeftRightTone, 
    measurement.no, bs = "re") + s(wordLeftRightTone, f0Zscore2, 
    bs = "re") + s(wordLeftRightTone, durationZscore2, bs = "re") + 
    s(word, measurement.no, bs = "re") + s(word, f0Zscore2, bs = "re") + 
    s(word, durationZscore2, bs = "re") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1) + s(measurement.no, speakerPos, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(durationZscore2, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1) + s(durationZscore2, speakerLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1)

Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)  
(Intercept) -0.11603    0.05027  -2.308    0.021 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
                                                edf  Ref.df      F p-value    
s(measurement.no)                             7.877   8.200 75.621  <2e-16 ***
s(f0Zscore2)                                  1.000   1.000  2.632   0.105    
s(durationZscore2)                            1.000   1.000  0.081   0.776    
ti(measurement.no,f0Zscore2,durationZscore2) 77.986 103.329  1.889  <2e-16 ***
ti(measurement.no,durationZscore2)           18.835  21.871  3.609  <2e-16 ***
ti(measurement.no,f0Zscore2)                  1.001   1.002  0.710   0.400    
ti(f0Zscore2,durationZscore2)                12.782  16.359  1.115   0.294    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.704   Deviance explained = 75.3%
fREML =   9240  Scale est. = 0.27859   n = 9522
gam.check(gamm.model2c)


Method: fREML   Optimizer: perf chol
$grad
 [1]  1.509903e-14 -4.421812e-05 -5.173769e-05 -5.329071e-15  2.913225e-13  5.719869e-13 -6.661338e-14 -1.625367e-13 -4.137722e-05
[10] -7.430545e-05 -2.797762e-14  8.881784e-16 -3.019807e-13  4.263256e-14  8.810730e-13 -1.989520e-13  1.065814e-13 -2.806644e-13
[19]  1.421085e-14 -7.744916e-13  3.694822e-13  6.075140e-13 -5.943035e-05  8.615331e-14 -3.552714e-13 -4.513057e-14  1.332268e-13
[28]  2.009504e-14  9.592327e-14 -5.551115e-15 -7.105427e-15 -2.216005e-13 -6.863694e-05  1.048051e-13 -2.096101e-13  3.108624e-14
[37] -7.105427e-14  8.659740e-15 -1.563194e-13 -2.642331e-14 -5.826450e-13 -4.507505e-14  6.366463e-12

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]          [,7]          [,8]          [,9]
   3.436732e+00  1.146967e-07  2.882443e-07  1.981049e-02  5.047585e-03 -8.700809e-03 -1.286566e-03  8.758973e-03 -5.862305e-06
   1.146967e-07  4.421468e-05 -1.659474e-11 -5.374701e-07  1.115960e-06 -7.118915e-07  2.507969e-08  6.527397e-08 -2.051877e-10
   2.882443e-07 -1.659474e-11  5.174411e-05  6.824430e-06 -4.923589e-06 -6.712126e-06  4.498085e-07 -4.706856e-06 -2.690992e-11
   1.981049e-02 -5.374701e-07  6.824430e-06  3.417803e+00  3.066756e-02  5.502142e-01 -4.576287e-03  1.217636e-02  2.381049e-05
   5.047585e-03  1.115960e-06 -4.923589e-06  3.066756e-02  2.327217e+00  7.406141e-01  1.492604e-03  7.569456e-01 -2.370795e-06
  -8.700809e-03 -7.118915e-07 -6.712126e-06  5.502142e-01  7.406141e-01  3.237080e+00 -8.137149e-04  3.032156e-01  5.321780e-06
  -1.286566e-03  2.507969e-08  4.498085e-07 -4.576287e-03  1.492604e-03 -8.137149e-04  1.235990e+00  2.098012e-02 -1.463403e-06
   8.758973e-03  6.527397e-08 -4.706856e-06  1.217636e-02  7.569456e-01  3.032156e-01  2.098012e-02  2.460554e+00  4.547433e-06
  -5.862305e-06 -2.051877e-10 -2.690992e-11  2.381049e-05 -2.370795e-06  5.321780e-06 -1.463403e-06  4.547433e-06  1.825315e-05
  -2.365183e-06 -5.425586e-10  2.566724e-10  6.576532e-06 -3.111268e-06 -9.304259e-06  2.370865e-07  4.118789e-06  2.313124e-05
  -2.036204e-03 -1.843609e-07 -5.810039e-06  8.184781e-03 -1.453347e-01  5.335916e-02  3.383424e-03  3.683270e-02 -2.393962e-06
  -1.605283e-03  7.029070e-08 -6.856684e-06  1.235986e-02 -2.783766e-02  2.790303e-02  1.318383e-03 -1.790341e-02 -1.923176e-06
  -5.044123e-03  8.504241e-07  3.420854e-06 -7.902620e-03  4.143748e-03  6.607474e-02 -7.478653e-04  7.786644e-02 -8.355205e-07
  -5.170657e-03  1.260296e-07  1.170420e-06 -1.010465e-02  7.225012e-02  2.643432e-02 -1.096399e-03 -1.345364e-04 -6.305630e-06
  -3.765831e-03  7.069552e-07  7.810375e-07 -5.106029e-02  4.161716e-02  1.450322e-01 -3.421797e-03  6.458722e-02  4.447359e-06
   9.824810e-03 -1.140226e-06  1.620483e-06 -7.117713e-03  3.114254e-02  1.858161e-01 -1.104824e-02  3.523019e-02  1.062062e-05
   7.636842e-04 -7.422579e-07 -1.097526e-06 -1.301220e-02 -8.448967e-03 -3.785656e-02  1.262883e-04 -7.389672e-02  8.608780e-07
   1.792185e-03 -3.364212e-07  3.255858e-07 -1.642050e-03 -3.348531e-02  9.556300e-03  1.935456e-03 -1.325218e-02 -3.909039e-06
   3.281171e-02 -2.462839e-06  2.262868e-05  1.455296e-01  2.173006e-01  2.586209e-01 -1.338227e-02  2.317473e-01  1.188044e-05
   5.950808e-03 -4.126734e-07  1.206912e-06  1.286570e-01  1.635486e-01  1.661803e-01  1.621363e-03 -6.516093e-02  7.180822e-06
  -2.423714e-03 -6.516604e-07  1.517338e-05 -4.596442e-03 -2.228014e-02 -5.952660e-03  3.110299e-03 -4.185397e-02 -3.770343e-06
   1.279447e-02 -8.036689e-07  1.176031e-05  1.845857e-02  7.865775e-03  1.095766e-01 -2.844596e-03  1.319172e-01 -2.949513e-06
   2.154697e-07 -4.678510e-11  3.379692e-10  5.635054e-07 -9.493168e-07  9.339618e-07  1.044315e-08 -1.008587e-06 -1.701829e-10
          [,10]         [,11]         [,12]         [,13]         [,14]         [,15]         [,16]         [,17]         [,18]
  -2.365183e-06 -2.036204e-03 -1.605283e-03 -5.044123e-03 -5.170657e-03 -3.765831e-03  9.824810e-03  7.636842e-04  1.792185e-03
  -5.425586e-10 -1.843609e-07  7.029070e-08  8.504241e-07  1.260296e-07  7.069552e-07 -1.140226e-06 -7.422579e-07 -3.364212e-07
   2.566724e-10 -5.810039e-06 -6.856684e-06  3.420854e-06  1.170420e-06  7.810375e-07  1.620483e-06 -1.097526e-06  3.255858e-07
   6.576532e-06  8.184781e-03  1.235986e-02 -7.902620e-03 -1.010465e-02 -5.106029e-02 -7.117713e-03 -1.301220e-02 -1.642050e-03
  -3.111268e-06 -1.453347e-01 -2.783766e-02  4.143748e-03  7.225012e-02  4.161716e-02  3.114254e-02 -8.448967e-03 -3.348531e-02
  -9.304259e-06  5.335916e-02  2.790303e-02  6.607474e-02  2.643432e-02  1.450322e-01  1.858161e-01 -3.785656e-02  9.556300e-03
   2.370865e-07  3.383424e-03  1.318383e-03 -7.478653e-04 -1.096399e-03 -3.421797e-03 -1.104824e-02  1.262883e-04  1.935456e-03
   4.118789e-06  3.683270e-02 -1.790341e-02  7.786644e-02 -1.345364e-04  6.458722e-02  3.523019e-02 -7.389672e-02 -1.325218e-02
   2.313124e-05 -2.393962e-06 -1.923176e-06 -8.355205e-07 -6.305630e-06  4.447359e-06  1.062062e-05  8.608780e-07 -3.909039e-06
   5.115512e-05 -9.165367e-08 -1.135160e-06  3.282546e-06 -8.745094e-06  4.913114e-06  2.399194e-06 -1.002320e-05 -2.721852e-06
  -9.165367e-08  3.336908e-01  2.742291e-02  1.844626e-02  4.107130e-02  8.746249e-02  6.931733e-02  1.788144e-02 -1.558030e-03
  -1.135160e-06  2.742291e-02  5.975948e-01  4.152910e-02  4.315394e-02  9.255732e-02  4.197034e-02  2.724728e-02  9.215226e-03
   3.282546e-06  1.844626e-02  4.152910e-02  4.418184e+00  1.714447e+00  6.726898e+00 -3.780560e-01  6.024339e-01  1.902889e-01
  -8.745094e-06  4.107130e-02  4.315394e-02  1.714447e+00  4.933483e+00  4.115198e+00 -9.747848e-01  3.984492e-01  3.839881e-01
   4.913114e-06  8.746249e-02  9.255732e-02  6.726898e+00  4.115198e+00  2.496460e+01 -8.019937e-01  1.290693e+00  1.013514e+00
   2.399194e-06  6.931733e-02  4.197034e-02 -3.780560e-01 -9.747848e-01 -8.019937e-01  1.404195e+01  1.434227e+00 -1.295892e-01
  -1.002320e-05  1.788144e-02  2.724728e-02  6.024339e-01  3.984492e-01  1.290693e+00  1.434227e+00  6.299845e+00 -4.218351e-02
  -2.721852e-06 -1.558030e-03  9.215226e-03  1.902889e-01  3.839881e-01  1.013514e+00 -1.295892e-01 -4.218351e-02  1.451908e+00
  -1.712841e-05  9.812755e-02 -6.759184e-02 -1.525436e+00 -5.812829e-01 -4.405254e+00  6.073460e+00  3.009789e-01  7.592186e-02
  -5.675088e-06  8.736228e-02  5.570510e-02  8.964667e-01  6.216553e-01  1.536906e+00  2.277931e-01  3.308957e+00  2.937632e-01
  -3.311862e-06 -3.641578e-02  5.855254e-02  7.870165e-01  7.543510e-01  3.905927e+00 -3.287134e-01  3.102669e-01  1.429415e+00
  -1.197719e-05  1.736657e-02 -3.308422e-02 -8.514886e-01 -1.948560e-01 -1.309466e+00  3.268214e+00  2.639827e-04 -3.958702e-03
  -3.338137e-10 -7.920326e-08 -7.798039e-07  1.806656e-05  1.523651e-05  4.266632e-05  4.049010e-08  7.413654e-05  2.330967e-06
          [,19]         [,20]         [,21]         [,22]         [,23]         [,24]         [,25]         [,26]         [,27]
   3.281171e-02  5.950808e-03 -2.423714e-03  1.279447e-02  2.154697e-07 -3.572752e-04 -1.675342e-02 -3.426797e-04 -3.474186e-05
  -2.462839e-06 -4.126734e-07 -6.516604e-07 -8.036689e-07 -4.678510e-11 -7.339471e-08 -4.039322e-08  1.121224e-08 -5.304256e-07
   2.262868e-05  1.206912e-06  1.517338e-05  1.176031e-05  3.379692e-10  4.082134e-06  2.888079e-06  9.577434e-07 -2.451360e-05
   1.455296e-01  1.286570e-01 -4.596442e-03  1.845857e-02  5.635054e-07  2.959160e-03  3.189405e-02  4.985454e-03 -8.172980e-03
   2.173006e-01  1.635486e-01 -2.228014e-02  7.865775e-03 -9.493168e-07 -8.113518e-04  3.985790e-02  7.431636e-03 -4.880679e-02
   2.586209e-01  1.661803e-01 -5.952660e-03  1.095766e-01  9.339618e-07  4.522631e-03  1.338516e-01  4.389577e-03 -5.472110e-03
  -1.338227e-02  1.621363e-03  3.110299e-03 -2.844596e-03  1.044315e-08  4.272748e-04 -1.193198e-02 -1.128676e-04  1.540164e-03
   2.317473e-01 -6.516093e-02 -4.185397e-02  1.319172e-01 -1.008587e-06 -5.316706e-03  1.217512e-02 -4.750286e-04  8.015042e-03
   1.188044e-05  7.180822e-06 -3.770343e-06 -2.949513e-06 -1.701829e-10 -3.939274e-07 -1.131271e-06  4.737034e-08  1.142241e-06
  -1.712841e-05 -5.675088e-06 -3.311862e-06 -1.197719e-05 -3.338137e-10 -3.854477e-08  2.095554e-06  2.061933e-07  2.998105e-06
   9.812755e-02  8.736228e-02 -3.641578e-02  1.736657e-02 -7.920326e-08 -7.264632e-03  1.287412e-02 -2.296304e-04  3.517107e-02
  -6.759184e-02  5.570510e-02  5.855254e-02 -3.308422e-02 -7.798039e-07  4.699685e-03  9.819803e-03  2.997151e-04  1.436125e-02
  -1.525436e+00  8.964667e-01  7.870165e-01 -8.514886e-01  1.806656e-05  1.390401e-01  3.107447e-02  7.258587e-03  1.080013e-01
  -5.812829e-01  6.216553e-01  7.543510e-01 -1.948560e-01  1.523651e-05  4.432182e-02 -3.683349e-02 -3.031052e-03 -5.463816e-02
  -4.405254e+00  1.536906e+00  3.905927e+00 -1.309466e+00  4.266632e-05  2.289523e-01  1.464152e-01  2.567387e-02  2.008312e-02
   6.073460e+00  2.277931e-01 -3.287134e-01  3.268214e+00  4.049010e-08 -3.860953e-02 -8.838208e-02  2.057097e-02 -5.233080e-03
   3.009789e-01  3.308957e+00  3.102669e-01  2.639827e-04  7.413654e-05  8.287341e-03  6.025999e-02 -6.490604e-03  2.030272e-02
   7.592186e-02  2.937632e-01  1.429415e+00 -3.958702e-03  2.330967e-06  2.951279e-01  2.207357e-02 -6.408460e-03  2.277430e-01
   3.914752e+01  1.246009e+00 -3.577944e-01  8.532207e+00  1.574717e-05  1.282669e-02 -7.573968e-02 -2.120945e-02  2.651579e-01
   1.246009e+00  1.446358e+01  2.407992e-01  2.689129e-02  1.731932e-04  1.346013e-02  6.045905e-02  1.414884e-03  1.078129e-01
  -3.577944e-01  2.407992e-01  5.954430e+00 -2.572411e-02  7.813866e-06  5.232229e-01  6.948562e-02  5.913931e-03  5.143314e-01
   8.532207e+00  2.689129e-02 -2.572411e-02  5.124133e+00  2.355977e-06 -1.289592e-02 -3.788700e-02 -1.555894e-03  2.496553e-02
   1.574717e-05  1.731932e-04  7.813866e-06  2.355977e-06  5.943642e-05  7.173093e-07  1.083062e-06 -1.844158e-07  2.431223e-06
          [,28]         [,29]         [,30]         [,31]         [,32]         [,33]         [,34]         [,35]         [,36]
  -3.426797e-04  5.900069e-04 -3.426797e-04 -4.118181e-03  4.697898e-04  2.978866e-06  4.697898e-04 -6.569226e-03  4.697898e-04
   1.121224e-08 -1.625384e-05  1.121224e-08  1.083401e-06  1.440190e-07 -9.052728e-11  1.440190e-07 -1.797516e-06  1.440190e-07
   9.577434e-07 -2.105010e-06  9.577434e-07  3.744783e-07  2.728049e-06  2.156991e-09  2.728049e-06 -5.237113e-06  2.728049e-06
   4.985454e-03 -6.869081e-03  4.985454e-03  3.389692e-02  1.383244e-02 -1.370360e-05  1.383244e-02 -3.856958e-02  1.383244e-02
   7.431636e-03  1.183344e-01  7.431636e-03  9.408878e-02  1.025509e-02 -8.450354e-06  1.025509e-02  9.472155e-02  1.025509e-02
   4.389577e-03 -8.360569e-02  4.389577e-03 -1.214277e-01 -4.757924e-03  5.844013e-05 -4.757924e-03  5.123134e-02 -4.757924e-03
  -1.128676e-04 -2.723718e-04 -1.128676e-04  1.463968e-05 -2.951403e-04  1.246718e-06 -2.951403e-04  2.776112e-03 -2.951403e-04
  -4.750286e-04  4.016303e-02 -4.750286e-04  1.280036e-01  1.291575e-03 -3.163894e-05  1.291575e-03  5.771936e-02  1.291575e-03
   4.737034e-08  1.258828e-05  4.737034e-08 -2.428938e-05 -5.142980e-07 -2.069469e-09 -5.142980e-07  2.828756e-07 -5.142980e-07
   2.061933e-07  1.076834e-05  2.061933e-07 -1.759840e-05  5.279717e-07  5.008835e-10  5.279717e-07 -3.800829e-06  5.279717e-07
  -2.296304e-04  2.155815e-02 -2.296304e-04 -7.138344e-02  8.089754e-03  1.118953e-05  8.089754e-03 -3.894895e-03  8.089754e-03
   2.997151e-04  1.324112e-01  2.997151e-04 -5.158876e-02  7.121909e-03  3.288369e-05  7.121909e-03  4.184381e-02  7.121909e-03
   7.258587e-03  1.301775e-01  7.258587e-03  3.960042e-02 -1.028662e-03  1.624656e-04 -1.028662e-03  2.386837e-01 -1.028662e-03
  -3.031052e-03  1.771407e-01 -3.031052e-03 -5.075032e-03 -2.932551e-02 -1.054670e-05 -2.932551e-02  1.821882e-01 -2.932551e-02
   2.567387e-02  2.255219e-01  2.567387e-02  6.637041e-02  9.118218e-02  3.088108e-04  9.118219e-02  3.457531e-01  9.118219e-02
   2.057097e-02  1.231381e-01  2.057097e-02 -2.468397e-01  3.652727e-02 -1.763624e-05  3.652727e-02  4.562811e-02  3.652727e-02
  -6.490604e-03  2.696703e-01 -6.490604e-03 -1.285211e-02  7.768605e-02  1.260467e-04  7.768605e-02  4.901127e-01  7.768605e-02
  -6.408460e-03  7.451391e-03 -6.408460e-03 -1.529099e-02 -6.430168e-03  4.048850e-06 -6.430168e-03  1.558641e-04 -6.430168e-03
  -2.120945e-02  1.618256e-01 -2.120945e-02 -4.421387e-01 -1.276759e-01  1.534479e-05 -1.276759e-01  5.359392e-02 -1.276759e-01
   1.414884e-03  4.440862e-02  1.414884e-03 -1.116422e-01  3.203428e-02  1.449917e-04  3.203428e-02  3.055103e-01  3.203428e-02
   5.913931e-03  4.410556e-02  5.913931e-03  2.974036e-02  1.406145e-02  4.797451e-04  1.406145e-02  1.584431e-01  1.406145e-02
  -1.555894e-03 -9.600259e-03 -1.555894e-03  5.911798e-03 -6.617797e-03 -1.438953e-05 -6.617797e-03 -1.665766e-02 -6.617797e-03
  -1.844158e-07 -2.052361e-06 -1.844158e-07  1.316931e-06 -8.564653e-07  2.282220e-09 -8.564654e-07 -6.947652e-07 -8.564654e-07
          [,37]         [,38]         [,39]         [,40]         [,41]         [,42]         [,43]
  -2.167503e-02 -7.975354e-04 -3.949385e-03 -7.975354e-04 -8.273465e-03 -7.975354e-04 -3.438352e+00
   2.771373e-07 -7.530748e-08 -6.445237e-07 -7.530748e-08 -2.961145e-06 -7.530748e-08 -2.184837e-05
   3.355455e-06  1.948591e-06  4.821005e-06  1.948591e-06 -2.509218e-06  1.948591e-06 -9.596625e-05
   3.519740e-01  6.781569e-03  1.609680e-02  6.781569e-03 -1.967145e-01  6.781569e-03 -1.578435e+01
   2.445473e-01  9.472491e-03  4.031329e-02  9.472491e-03  1.658772e-01  9.472491e-03 -1.062259e+01
   6.049784e-02  1.233805e-02 -5.986449e-02  1.233805e-02  1.744240e-01  1.233805e-02 -1.208621e+01
  -5.480168e-02  2.550335e-04  1.201860e-02  2.550335e-04 -3.866488e-03  2.550335e-04 -2.487165e+00
  -8.656911e-02 -3.387216e-03  3.734572e-02 -3.387216e-03 -5.526570e-02 -3.387216e-03 -6.430418e+00
  -5.856668e-05 -1.047904e-06  7.314227e-06 -1.047904e-06 -4.937067e-07 -1.047904e-06 -1.980775e-04
  -3.100401e-05 -1.335578e-07  1.016292e-05 -1.335578e-07 -9.720280e-06 -1.335578e-07 -2.254982e-04
   1.441558e-01 -7.227866e-03  1.293271e-01 -7.227866e-03  1.742858e-02 -7.227866e-03 -3.009853e+00
  -8.043607e-04  1.598544e-04  6.084896e-02  1.598544e-04  1.066139e-01  1.598544e-04 -2.881024e+00
   3.978378e-01 -2.913428e-03  5.887078e-01 -2.913428e-03  1.156186e-01 -2.913428e-03 -2.423717e+01
   1.431061e-01 -2.455773e-02  6.401911e-01 -2.455773e-02  2.420734e-01 -2.455773e-02 -2.426736e+01
   3.113665e-01  7.232662e-02  2.357553e+00  7.232662e-02 -8.046154e-02  7.232662e-02 -7.428494e+01
   1.115090e+00 -1.369217e-03 -3.422448e-01 -1.369217e-03  5.566745e-01 -1.369217e-03 -5.096893e+01
   1.210017e-01 -3.405074e-02  6.129902e-01 -3.405074e-02  1.202833e+00 -3.405074e-02 -3.088692e+01
  -3.209561e-02  1.081309e-02  1.554538e+00  1.081309e-02 -6.915617e-02  1.081309e-02 -1.148205e+01
   6.991887e+00  3.765918e-02  2.211238e-01  3.765918e-02  8.668306e-01  3.765918e-02 -9.470367e+01
  -9.291237e-02 -3.954164e-02  1.249711e+00 -3.954164e-02 -3.559875e-01 -3.954164e-02 -4.353874e+01
   1.180762e-01  1.385454e-02  1.436396e+00  1.385454e-02 -2.597710e-01  1.385454e-02 -2.590247e+01
   1.030678e+00 -6.382651e-03  5.136963e-03 -6.382651e-03  2.263691e-01 -6.382651e-03 -2.594514e+01
  -5.650191e-06 -8.451229e-08  3.475033e-05 -8.451229e-08  1.879795e-05 -8.451229e-08 -7.427970e-04
 [ getOption("max.print") est atteint -- 20 lignes omises ]

Model rank =  10417 / 10417 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                   k'      edf k-index p-value  
s(measurement.no)                            9.00e+00 7.88e+00    1.02    0.90  
s(f0Zscore2)                                 9.00e+00 1.00e+00    1.00    0.50  
s(durationZscore2)                           2.90e+01 1.00e+00    1.02    0.89  
ti(measurement.no,f0Zscore2,durationZscore2) 3.08e+02 7.80e+01    0.98    0.08 .
ti(measurement.no,durationZscore2)           4.40e+01 1.88e+01    1.03    0.97  
ti(measurement.no,f0Zscore2)                 2.80e+01 1.00e+00    1.02    0.82  
ti(f0Zscore2,durationZscore2)                7.70e+01 1.28e+01    0.99    0.37  
s(word)                                      3.19e+02 4.85e+01      NA      NA  
s(wordPos)                                   4.66e+02 4.85e+01      NA      NA  
s(wordLeftRightTone)                         4.43e+02 1.49e+02      NA      NA  
s(measurement.no,wordPos)                    4.66e+02 1.02e+02      NA      NA  
s(f0Zscore2,wordPos)                         4.66e+02 6.18e+01      NA      NA  
s(durationZscore2,wordPos)                   4.66e+02 2.30e+01      NA      NA  
s(measurement.no,wordLeftRightTone)          4.43e+02 1.89e+02      NA      NA  
s(f0Zscore2,wordLeftRightTone)               4.43e+02 8.71e+01      NA      NA  
s(durationZscore2,wordLeftRightTone)         4.43e+02 5.18e+01      NA      NA  
s(measurement.no,word)                       3.19e+02 5.19e+01      NA      NA  
s(f0Zscore2,word)                            3.19e+02 1.60e-03      NA      NA  
s(durationZscore2,word)                      3.19e+02 4.88e+00      NA      NA  
s(measurement.no,speaker)                    1.00e+02 3.70e+01    1.02    0.91  
s(durationZscore2,speaker)                   3.00e+02 3.19e+01    1.02    0.86  
s(f0Zscore2,speaker)                         1.00e+02 3.83e+01    1.00    0.53  
s(measurement.no,speakerPos)                 3.00e+02 6.18e+01    1.02    0.91  
s(durationZscore2,speakerPos)                9.00e+02 4.10e+00    1.02    0.90  
s(f0Zscore2,speakerPos)                      3.00e+02 4.09e+01    1.00    0.47  
s(measurement.no,speakerLeftRightTone)       6.00e+02 1.55e+02    1.02    0.85  
s(durationZscore2,speakerLeftRightTone)      1.80e+03 1.64e+02    1.02    0.90  
s(f0Zscore2,speakerLeftRightTone)            6.00e+02 1.12e+02    1.00    0.47  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1


duration0.25au = quantile(data.au.mas$durationZscore2, c(0.25)) * global_sddau + global_meandau

duration0.5au = quantile(data.au.mas$durationZscore2, c(0.5)) * global_sddau + global_meandau

duration0.75au = quantile(data.au.mas$durationZscore2, c(0.75)) * global_sddau + global_meandau
# 3D plotting

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2c, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.mas$durationZscore2, c(0.25))),
        ylim = quantile(data.au.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25au * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0au + global_mean0au), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1au + global_mean1au, 
        zlim = c(490,720),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.253736 to 1.355745. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.680380067515762. 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(490,720), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.model2c, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2. = quantile(data.au.mas$durationZscore2, c(0.5))),
        ylim = quantile(data.au.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5au * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0au + global_mean0au), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1au + global_mean1au, 
        zlim = c(490,720),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.253736 to 1.355745. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.0990769355270091. 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(490,720), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.model2c, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.mas$durationZscore2, c(0.75))),
        ylim = quantile(data.au.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75au * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0au + global_mean0au),
        transform = function(f1Zscore2) f1Zscore2 * global_sd1au + global_mean1au, 
        zlim = c(490,720),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.253736 to 1.355745. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.530017553918074. 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(490,720), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

NA
NA
NA
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_diff2(gamm.model2c, view=c("measurement.no","durationZscore2"),
           main = "",
           comp = list(f0Zscore2 = quantile(data.au.mas$f0Zscore2, c(0.8,0.2), na.rm = T)),
           ylim = quantile(data.au.mas$durationZscore2, c(0.05,0.95), na.rm = T),
           transform.view = c(function(measurement.no) measurement.no, function(durationZscore2) durationZscore2 * global_sddau + global_meandau), 
           #zlim = c(-0.5,0.5),
           print.summary = TRUE,
           sim.ci = F,
           show.diff = F,
           #color = "heat",
           alpha.diff = 0.5,
           #plot.type = "perp",
           #n.grid =300,
         add.color.legend = FALSE, rm.ranef = TRUE,  
        xlab = "Time (Normalized)", ylab = "Duration (ms)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, hide.label = T)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * durationZscore2 : numeric predictor; with 30 values ranging from -1.441948 to 1.867158. 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
#gradientLegend(valRange=c(-50,20), length=.5, pos=.75, depth = 0.02, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

#abline(h = (1.2 * global_sdd1 + global_meand1), lty=2,lwd=2, col = "white")
# 3D plotting
 png("pred2-7.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2c, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.mas$durationZscore2, c(0.25))),
        ylim = quantile(data.au.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25au * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0au + global_mean0au), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1au + global_mean1au, 
        zlim = c(490,720),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.253736 to 1.355745. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.680380067515762. 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(490,720), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
png("pred2-8.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2c, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2. = quantile(data.au.mas$durationZscore2, c(0.5))),
        ylim = quantile(data.au.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5au * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0au + global_mean0au), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1au + global_mean1au, 
        zlim = c(490,720),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.253736 to 1.355745. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.0990769355270091. 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(490,720), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
png("pred2-9.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2c, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.mas$durationZscore2, c(0.75))),
        ylim = quantile(data.au.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75au * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0au + global_mean0au),
        transform = function(f1Zscore2) f1Zscore2 * global_sd1au + global_mean1au, 
        zlim = c(490,720),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.253736 to 1.355745. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.530017553918074. 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(490,720), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
 png("pred2-diff-3.png", width = 6, height = 4, units = "in", res = 1000)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_diff2(gamm.model2c, view=c("measurement.no","durationZscore2"),
           main = "",
           comp = list(f0Zscore2 = quantile(data.au.mas$f0Zscore2, c(0.8,0.2), na.rm = T)),
           ylim = quantile(data.au.mas$durationZscore2, c(0.05,0.95), na.rm = T),
           transform.view = c(function(measurement.no) measurement.no, function(durationZscore2) durationZscore2 * global_sddau + global_meandau), 
           #zlim = c(-0.5,0.5),
           print.summary = TRUE,
           sim.ci = F,
           show.diff = F,
           #color = "heat",
           alpha.diff = 0.5,
           #plot.type = "perp",
           #n.grid =300,
         add.color.legend = FALSE, rm.ranef = TRUE,  
        xlab = "Time (Normalized)", ylab = "Duration (ms)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, hide.label = T)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * durationZscore2 : numeric predictor; with 30 values ranging from -1.441948 to 1.867158. 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
#gradientLegend(valRange=c(-50,20), length=.5, pos=.75, depth = 0.02, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
#abline(h = (1.2 * global_sdd1 + global_meand1), lty=2,lwd=2, col = "white")
dev.off()
null device 
          1 

Model 2D: /au/ female, F1 as output

system.time(gamm.model2d.noAR <- bam(f1Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1), 
                          
                          
 
                      data=data.au.fem, method="fREML", discrete = TRUE, nthreads = ncores)
)
utilisateur     système      écoulé 
  24863.935      54.302    2032.469 
saveRDS(gamm.model2d.noAR, paste("Gamm_model2d_noAR.rds"))
gamm.model2d.noAR <- 
  readRDS("Gamm_model2d_noAR.rds")
r.gamm.model2d <- start_value_rho(gamm.model2d.noAR)
# Auto-regressive model

system.time(gamm.model2d <- bam(f1Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1), 
 
                        
                    
                      data=data.au.fem, method="fREML", discrete = TRUE, nthreads = ncores, rho = r.gamm.model2d, AR.start = data.au.fem$start)
)
utilisateur     système      écoulé 
  26137.251      48.744    2033.995 
saveRDS(gamm.model2d, paste("Gamm_model2d.rds"))
gamm.model2d <- 
  readRDS("Gamm_model2d.rds")
summary(gamm.model2d, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f1Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(word, bs = "re") + s(wordPos, 
    bs = "re") + s(wordLeftRightTone, bs = "re") + s(wordPos, 
    measurement.no, bs = "re") + s(wordPos, f0Zscore2, bs = "re") + 
    s(wordPos, durationZscore2, bs = "re") + s(wordLeftRightTone, 
    measurement.no, bs = "re") + s(wordLeftRightTone, f0Zscore2, 
    bs = "re") + s(wordLeftRightTone, durationZscore2, bs = "re") + 
    s(word, measurement.no, bs = "re") + s(word, f0Zscore2, bs = "re") + 
    s(word, durationZscore2, bs = "re") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1) + s(measurement.no, speakerPos, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(durationZscore2, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1) + s(durationZscore2, speakerLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1)

Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)
(Intercept)  0.01375    0.04473   0.307    0.759

Approximate significance of smooth terms:
                                                edf Ref.df       F p-value    
s(measurement.no)                             8.169  8.388 122.102  <2e-16 ***
s(f0Zscore2)                                  1.996  2.172   0.769   0.523    
s(durationZscore2)                            1.000  1.000   0.358   0.550    
ti(measurement.no,f0Zscore2,durationZscore2) 28.296 42.725   0.934   0.597    
ti(measurement.no,durationZscore2)           11.748 14.646   5.500  <2e-16 ***
ti(measurement.no,f0Zscore2)                  9.712 12.616   6.688  <2e-16 ***
ti(f0Zscore2,durationZscore2)                12.318 15.965   1.024   0.429    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.763   Deviance explained = 79.9%
fREML = 7714.8  Scale est. = 0.22484   n = 9332
gam.check(gamm.model2d)


Method: fREML   Optimizer: perf chol
$grad
 [1] -7.638334e-14 -3.141931e-14 -3.569072e-05  2.842171e-14 -9.858780e-14 -5.684342e-14 -1.798561e-14  1.585398e-13  1.549871e-13
[10]  1.794120e-13  8.393286e-14 -1.207923e-13  9.947598e-14 -5.263191e-05 -6.483702e-14  3.836931e-13 -1.243450e-13 -9.059420e-14
[19] -6.963319e-13 -2.842171e-14  9.237056e-14  5.258016e-13 -5.385358e-05 -6.177734e-05  1.598721e-13 -3.620603e-05 -1.723066e-13
[28] -3.620603e-05  5.009326e-13 -3.620603e-05 -3.268497e-13  7.194245e-14  2.273737e-13 -3.530509e-14 -1.207923e-13 -8.970602e-14
[37]  3.979039e-13  1.012523e-13  1.278977e-13  7.904788e-14  1.492140e-13 -2.753353e-13 -3.183231e-11

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]          [,7]          [,8]          [,9]
   3.693811e+00 -1.293109e-03  7.074668e-09  6.300282e-03 -2.113894e-03 -1.858520e-03 -3.537795e-03  2.630167e-03  8.150346e-03
  -1.293109e-03  2.194398e-01 -1.300687e-07  1.434675e-03  5.037439e-03 -1.865275e-03 -1.622780e-04 -5.084841e-03 -4.105654e-02
   7.074668e-09 -1.300687e-07  3.568931e-05 -2.014656e-07 -2.062342e-07 -2.340776e-07 -1.601955e-07 -1.096702e-06 -4.627279e-08
   6.300282e-03  1.434675e-03 -2.014656e-07  1.398911e+00 -7.652754e-02 -1.340451e-02  4.959838e-02 -4.927767e-02 -1.865503e-02
  -2.113894e-03  5.037439e-03 -2.062342e-07 -7.652754e-02  7.858723e-01  1.452559e-01 -2.421809e-03  1.414499e-01 -8.700575e-03
  -1.858520e-03 -1.865275e-03 -2.340776e-07 -1.340451e-02  1.452559e-01  7.364177e-01  5.780542e-04  3.834754e-02 -1.126091e-02
  -3.537795e-03 -1.622780e-04 -1.601955e-07  4.959838e-02 -2.421809e-03  5.780542e-04  8.029237e-01  5.159074e-01  7.038664e-03
   2.630167e-03 -5.084841e-03 -1.096702e-06 -4.927767e-02  1.414499e-01  3.834754e-02  5.159074e-01  1.187402e+00 -2.911643e-02
   8.150346e-03 -4.105654e-02 -4.627279e-08 -1.865503e-02 -8.700575e-03 -1.126091e-02  7.038664e-03 -2.911643e-02  7.062269e-01
   2.242578e-03  2.077654e-02  2.843806e-08 -1.493708e-02 -1.364056e-02 -5.340625e-03  8.976371e-03  4.740459e-03  3.257803e-01
  -2.531066e-04 -3.035689e-03 -1.760637e-06 -3.594216e-02 -7.968544e-03  4.059835e-02 -5.193109e-03  1.036725e-02 -1.319765e-03
  -1.404753e-03 -5.531223e-03 -1.672625e-06  3.456931e-03  1.446608e-02  1.064430e-01 -2.022717e-02 -1.382336e-01  1.904896e-03
  -2.825061e-02 -6.197482e-04 -1.486449e-06  4.183666e-02 -1.464845e-02  2.632387e-03  7.815647e-04 -6.659160e-03  1.805454e-02
  -1.132987e-07 -4.145418e-07  1.165927e-11  1.434485e-06 -3.626290e-06 -3.993923e-06  2.689860e-07 -9.479245e-08  6.508174e-07
  -2.287224e-03  4.470919e-04  2.448806e-09  7.466808e-03  3.405113e-03  5.052973e-03  1.732338e-03  1.699026e-03  2.415114e-03
   3.823419e-03  2.821802e-02 -3.143066e-07  5.604196e-02 -3.314030e-02 -6.214901e-02  1.481188e-02  8.436779e-02  3.940296e-02
   7.307307e-03  2.291743e-03 -1.349935e-07  2.754456e-02  4.878053e-02  2.903468e-02  1.880453e-03  2.286371e-02 -3.329043e-02
  -1.769562e-04  2.680812e-03 -3.009771e-06 -1.257206e-02 -4.579390e-04  2.732203e-03  7.961150e-03  3.338596e-02 -1.228551e-03
   7.049977e-03  1.281553e-01 -2.776881e-07  6.063706e-02  1.744228e-02  3.830774e-03  1.477099e-03  2.945211e-02  1.967571e-02
   1.175073e-02  1.438189e-03 -4.978680e-08 -4.996891e-02  1.263396e-02  8.229128e-02  3.538243e-02 -2.409386e-02  3.762773e-02
   1.710928e-04 -4.627713e-03 -4.084055e-06  1.580290e-02  2.407712e-02  1.294446e-02  7.608580e-03  8.868046e-03 -4.963780e-03
   8.471170e-03  3.480302e-02 -2.645565e-08  4.756441e-02  1.542074e-02  5.357954e-02 -1.197748e-02  2.465842e-02  4.574251e-02
   2.032989e-06 -4.571933e-06 -9.543631e-11 -9.925387e-06  1.135209e-05  5.842666e-06  1.088793e-05 -9.811830e-07  1.222769e-05
          [,10]         [,11]         [,12]         [,13]         [,14]         [,15]         [,16]         [,17]         [,18]
   2.242578e-03 -2.531066e-04 -1.404753e-03 -2.825061e-02 -1.132987e-07 -2.287224e-03  3.823419e-03  7.307307e-03 -1.769562e-04
   2.077654e-02 -3.035689e-03 -5.531223e-03 -6.197482e-04 -4.145418e-07  4.470919e-04  2.821802e-02  2.291743e-03  2.680812e-03
   2.843806e-08 -1.760637e-06 -1.672625e-06 -1.486449e-06  1.165927e-11  2.448806e-09 -3.143066e-07 -1.349935e-07 -3.009771e-06
  -1.493708e-02 -3.594216e-02  3.456931e-03  4.183666e-02  1.434485e-06  7.466808e-03  5.604196e-02  2.754456e-02 -1.257206e-02
  -1.364056e-02 -7.968544e-03  1.446608e-02 -1.464845e-02 -3.626290e-06  3.405113e-03 -3.314030e-02  4.878053e-02 -4.579390e-04
  -5.340625e-03  4.059835e-02  1.064430e-01  2.632387e-03 -3.993923e-06  5.052973e-03 -6.214901e-02  2.903468e-02  2.732203e-03
   8.976371e-03 -5.193109e-03 -2.022717e-02  7.815647e-04  2.689860e-07  1.732338e-03  1.481188e-02  1.880453e-03  7.961150e-03
   4.740459e-03  1.036725e-02 -1.382336e-01 -6.659160e-03 -9.479245e-08  1.699026e-03  8.436779e-02  2.286371e-02  3.338596e-02
   3.257803e-01 -1.319765e-03  1.904896e-03  1.805454e-02  6.508174e-07  2.415114e-03  3.940296e-02 -3.329043e-02 -1.228551e-03
   1.830347e+00  9.775003e-03  5.473488e-05 -4.233450e-02  2.638659e-06 -2.847150e-03  2.181303e-01  1.529037e-02 -1.933922e-03
   9.775003e-03  2.017259e-01  9.277563e-02  5.284732e-02  3.945202e-06  7.683969e-03 -9.222560e-02 -1.553589e-02  1.747518e-02
   5.473488e-05  9.277563e-02  4.921835e-01  6.780803e-02  4.142837e-06  4.134518e-04  1.277405e-02  1.794541e-02  3.251301e-02
  -4.233450e-02  5.284732e-02  6.780803e-02  4.121370e+01  2.098707e-04  1.346828e+00 -1.970201e+00  8.467952e-01  1.796074e+00
   2.638659e-06  3.945202e-06  4.142837e-06  2.098707e-04  5.264541e-05  1.709625e-05  5.560039e-05  5.408541e-05  3.760439e-05
  -2.847150e-03  7.683969e-03  4.134518e-04  1.346828e+00  1.709625e-05  1.981955e-01 -9.170871e-02  8.497324e-02  8.725251e-02
   2.181303e-01 -9.222560e-02  1.277405e-02 -1.970201e+00  5.560039e-05 -9.170871e-02  2.484061e+01  1.068712e+00  2.437450e-01
   1.529037e-02 -1.553589e-02  1.794541e-02  8.467952e-01  5.408541e-05  8.497324e-02  1.068712e+00  3.954661e+00  7.034213e-02
  -1.933922e-03  1.747518e-02  3.251301e-02  1.796074e+00  3.760439e-05  8.725251e-02  2.437450e-01  7.034213e-02  2.775935e+00
   4.780138e-02  1.004379e-02 -1.222640e-02 -2.790637e+00 -2.920820e-05  9.940070e-03  7.053991e+00  5.585878e-01 -1.736453e-01
   7.397851e-02  2.100707e-02  1.666081e-01  1.789642e+00 -2.009365e-05  1.242494e-01  1.206986e+00  3.852502e+00  1.301961e-01
   1.688211e-02  7.185994e-03  2.988403e-02  1.917280e+00  3.752566e-05  1.222239e-01  7.162070e-01  1.811268e-01  1.112223e+00
  -1.661694e-02  1.798724e-02 -5.961522e-02 -3.329156e+00 -2.759203e-05 -7.698211e-02  6.903767e+00  3.129644e-01 -1.064590e-01
  -2.892372e-07  4.262671e-06  2.349473e-05  3.059248e-04 -7.639956e-09  9.085043e-06  1.787077e-04  6.572387e-04  4.128209e-06
          [,19]         [,20]         [,21]         [,22]         [,23]         [,24]         [,25]         [,26]         [,27]
   7.049977e-03  1.175073e-02  1.710928e-04  8.471170e-03  2.032989e-06  6.605885e-08 -4.203142e-02  1.018275e-06  2.072727e-03
   1.281553e-01  1.438189e-03 -4.627713e-03  3.480302e-02 -4.571933e-06  1.912264e-09 -3.027832e-03  2.848966e-08 -8.939348e-03
  -2.776881e-07 -4.978680e-08 -4.084055e-06 -2.645565e-08 -9.543631e-11 -1.498799e-10 -5.668779e-08 -8.723724e-11 -5.848275e-06
   6.063706e-02 -4.996891e-02  1.580290e-02  4.756441e-02 -9.925387e-06  1.524397e-06 -2.544738e-02 -4.127585e-06  4.282252e-03
   1.744228e-02  1.263396e-02  2.407712e-02  1.542074e-02  1.135209e-05  2.001639e-06  5.467154e-03  2.673399e-06 -1.352331e-02
   3.830774e-03  8.229128e-02  1.294446e-02  5.357954e-02  5.842666e-06  1.532361e-08 -2.427352e-02  9.063456e-06 -3.058686e-02
   1.477099e-03  3.538243e-02  7.608580e-03 -1.197748e-02  1.088793e-05  3.667870e-07 -2.602896e-02  3.862345e-06 -2.980062e-03
   2.945211e-02 -2.409386e-02  8.868046e-03  2.465842e-02 -9.811830e-07  1.483118e-06 -1.773744e-02 -5.404395e-06  1.777407e-03
   1.967571e-02  3.762773e-02 -4.963780e-03  4.574251e-02  1.222769e-05 -4.275927e-07 -2.193403e-02 -9.614784e-07 -8.427449e-03
   4.780138e-02  7.397851e-02  1.688211e-02 -1.661694e-02 -2.892372e-07  3.242257e-07 -6.405357e-03 -2.996745e-06  9.485546e-03
   1.004379e-02  2.100707e-02  7.185994e-03  1.798724e-02  4.262671e-06  1.475583e-06  2.061423e-03  2.533949e-06 -9.488510e-03
  -1.222640e-02  1.666081e-01  2.988403e-02 -5.961522e-02  2.349473e-05  1.631695e-06 -1.805444e-02  5.437235e-06 -5.568753e-02
  -2.790637e+00  1.789642e+00  1.917280e+00 -3.329156e+00  3.059248e-04  1.141830e-04  3.317148e-02  5.117850e-05  2.359596e-01
  -2.920820e-05 -2.009365e-05  3.752566e-05 -2.759203e-05 -7.639956e-09  1.414896e-09  2.707820e-06  1.893742e-10  6.664545e-06
   9.940070e-03  1.242494e-01  1.222239e-01 -7.698211e-02  9.085043e-06  4.603143e-06  1.737144e-03  1.468346e-06  3.180275e-02
   7.053991e+00  1.206986e+00  7.162070e-01  6.903767e+00  1.787077e-04  4.418792e-05  1.293779e-01 -5.722926e-06 -6.767317e-02
   5.585878e-01  3.852502e+00  1.811268e-01  3.129644e-01  6.572387e-04  5.469031e-06  7.676558e-03  5.178052e-05  1.151279e-01
  -1.736453e-01  1.301961e-01  1.112223e+00 -1.064590e-01  4.128209e-06  4.828541e-05  1.500117e-02  5.315529e-06  1.674212e-01
   2.432811e+01  1.385623e+00  4.537777e-02  9.535978e+00  2.159451e-04  5.801488e-06  1.379741e-02 -1.261651e-04 -1.566236e-01
   1.385623e+00  1.583574e+01  2.864884e-01  5.912890e-01  1.804665e-03  1.235761e-05 -2.017468e-02  2.315930e-05  9.968562e-02
   4.537777e-02  2.864884e-01  3.265159e+00 -1.765892e-01  3.689874e-05  8.612842e-05  2.495518e-02 -1.299168e-05  3.123129e-01
   9.535978e+00  5.912890e-01 -1.765892e-01  1.143712e+01  9.888860e-05 -6.456625e-06  3.604611e-02 -2.794716e-05 -1.768277e-02
   2.159451e-04  1.804665e-03  3.689874e-05  9.888860e-05  5.422293e-05  1.475226e-09 -1.094904e-05 -5.619199e-09 -1.249313e-05
          [,28]         [,29]         [,30]         [,31]         [,32]         [,33]         [,34]         [,35]         [,36]
   1.018275e-06 -4.372825e-03  1.018275e-06 -1.385982e-02  3.389515e-04  7.726551e-03  3.389515e-04  7.103197e-04  3.389515e-04
   2.848966e-08  8.293042e-02  2.848966e-08  1.402268e-02 -6.271047e-04 -3.498037e-02 -6.271047e-04  9.269839e-03 -6.271047e-04
  -8.723724e-11 -8.134251e-08 -8.723724e-11  1.257083e-07 -6.065322e-09 -6.884602e-06 -6.065322e-09 -2.350812e-07 -6.065322e-09
  -4.127585e-06 -2.811938e-02 -4.127585e-06  1.161764e-01 -6.511501e-04  1.723055e-03 -6.511501e-04 -3.587591e-02 -6.511501e-04
   2.673399e-06 -6.134909e-03  2.673399e-06  5.964604e-02  8.710931e-04 -1.932493e-02  8.710931e-04  1.906095e-02  8.710931e-04
   9.063456e-06 -5.621221e-02  9.063456e-06 -2.108326e-02  3.500532e-03 -1.143800e-02  3.500532e-03 -2.009814e-02  3.500532e-03
   3.862345e-06 -1.426849e-02  3.862345e-06  2.899256e-03 -1.386158e-03  1.789674e-02 -1.386158e-03 -4.912638e-03 -1.386158e-03
  -5.404395e-06 -2.033902e-02 -5.404395e-06  3.701481e-02 -1.166805e-03 -3.960796e-02 -1.166805e-03 -2.228652e-02 -1.166805e-03
  -9.614784e-07 -5.290427e-02 -9.614784e-07  2.660998e-02  1.048228e-03 -2.140103e-02  1.048228e-03 -3.224757e-02  1.048228e-03
  -2.996745e-06  2.633004e-02 -2.996745e-06 -2.211772e-02 -2.359295e-03  5.337264e-02 -2.359295e-03 -3.879344e-02 -2.359295e-03
   2.533949e-06  5.006321e-02  2.533949e-06  5.322684e-02 -1.479645e-03 -1.028497e-02 -1.479645e-03 -2.616268e-02 -1.479645e-03
   5.437235e-06  2.090253e-02  5.437235e-06  3.712809e-02  5.969998e-03 -1.858466e-01  5.969998e-03 -1.210287e-02  5.969998e-03
   5.117850e-05 -4.153107e-03  5.117850e-05  1.042753e-01 -3.533928e-02  8.666140e-01 -3.533928e-02  1.754822e-01 -3.533928e-02
   1.893742e-10 -1.559287e-06  1.893742e-10  4.654388e-06 -3.400834e-06  7.566639e-05 -3.400834e-06 -2.118735e-05 -3.400834e-06
   1.468346e-06  9.978841e-03  1.468346e-06  3.910451e-02 -7.995427e-03  1.254902e-01 -7.995427e-03 -3.713318e-02 -7.995427e-03
  -5.722926e-06  4.166987e-01 -5.722926e-06 -4.208512e-01 -1.331573e-02 -2.938254e-01 -1.331573e-02 -7.662415e-02 -1.331573e-02
   5.178052e-05  1.895511e-01  5.178052e-05  1.085705e-01  3.035147e-02  7.779273e-01  3.035147e-02  1.519828e-02  3.035147e-02
   5.315529e-06 -1.450386e-01  5.315529e-06  2.287510e-02 -8.296763e-03  4.540896e-01 -8.296763e-03 -3.442227e-02 -8.296763e-03
  -1.261651e-04  1.548172e-01 -1.261651e-04  2.215770e-02 -1.417913e-02  9.626192e-02 -1.417912e-02  2.688760e-01 -1.417912e-02
   2.315930e-05  2.033363e-01  2.315930e-05  9.680274e-04  2.038789e-02  8.345274e-01  2.038789e-02 -9.665322e-02  2.038789e-02
  -1.299168e-05  9.820455e-02 -1.299168e-05  3.966300e-02  2.156311e-02  7.922995e-01  2.156311e-02  1.182360e-02  2.156311e-02
  -2.794716e-05  3.769855e-02 -2.794716e-05 -5.690763e-02 -5.216437e-03 -1.716680e-01 -5.216437e-03  4.375077e-03 -5.216437e-03
  -5.619199e-09 -5.550326e-05 -5.619199e-09  3.041693e-05  1.264864e-06  5.827101e-05  1.264864e-06 -2.239107e-05  1.264864e-06
          [,37]         [,38]         [,39]         [,40]         [,41]         [,42]         [,43]
   3.034540e-02  1.854930e-03  1.726933e-03  1.854930e-03 -6.492316e-03  1.854930e-03 -3.584358e+00
   5.233935e-02 -7.379720e-03 -3.604561e-02 -7.379720e-03  4.032329e-02 -7.379719e-03 -4.979314e-01
   2.590630e-07 -2.292569e-08 -3.721626e-06 -2.292569e-08 -5.367256e-08 -2.292569e-08 -3.995173e-06
   8.230710e-03 -1.337555e-03  2.459634e-02 -1.337555e-03 -1.828582e-02 -1.337555e-03 -4.224295e+00
  -1.859498e-02  1.386181e-03 -6.034788e-02  1.386181e-03  4.872964e-02  1.386181e-03 -4.992701e+00
  -7.125620e-02 -3.775344e-05 -3.660959e-03 -3.775343e-05  3.554889e-02 -3.775343e-05 -4.430823e+00
   1.963645e-02  5.601187e-03  1.694717e-02  5.601187e-03  2.547934e-02  5.601187e-03 -1.778852e+00
   5.699814e-02 -3.529290e-03  2.362316e-02 -3.529290e-03 -2.874923e-03 -3.529290e-03 -3.594938e+00
   1.073117e-02  1.761930e-04 -1.519782e-02  1.761930e-04 -2.392031e-02  1.761930e-04 -1.890926e+00
  -6.156893e-02 -2.644516e-03 -9.967163e-03 -2.644516e-03  1.653575e-02 -2.644516e-03 -2.465184e+00
   7.335508e-02 -7.585769e-03 -5.588337e-02 -7.585769e-03  2.233629e-02 -7.585769e-03 -2.888071e+00
   4.052034e-02 -1.243587e-02 -9.023810e-03 -1.243587e-02  4.874589e-03 -1.243587e-02 -2.770857e+00
   4.255857e-01  1.660893e-01  1.527786e+00  1.660893e-01  5.655430e-01  1.660893e-01 -7.420494e+01
  -4.068997e-06  1.443652e-06  2.084108e-05  1.443652e-06 -9.354291e-07  1.443652e-06 -1.405915e-03
  -9.837447e-02  5.669977e-02  1.165786e-01  5.669977e-02  1.029714e-01  5.669977e-02 -5.567671e+00
   8.932004e-01 -7.371447e-02 -8.956084e-02 -7.371447e-02 -1.842095e-01 -7.371447e-02 -6.784043e+01
   3.830638e-02 -4.039447e-02  3.403796e-01 -4.039447e-02  2.309060e-01 -4.039447e-02 -2.488542e+01
   4.945708e-02 -1.093331e-02  4.745003e-01 -1.093331e-02  1.906744e-01 -1.093331e-02 -1.469753e+01
   2.048780e+00  1.914477e-01 -5.244093e-02  1.914477e-01  4.951434e-01  1.914477e-01 -6.996221e+01
   2.072210e-01 -8.054736e-02  1.056413e+00 -8.054736e-02  1.384455e+00 -8.054736e-02 -5.483706e+01
   1.011093e-01 -8.843048e-02  1.408717e+00 -8.843048e-02  1.935702e-01 -8.843048e-02 -1.749645e+01
   8.572205e-01  1.724803e-02  4.018319e-02  1.724803e-02  2.227686e-01  1.724803e-02 -4.127840e+01
   1.931595e-06 -1.880187e-05  8.405210e-05 -1.880187e-05  1.480453e-04 -1.880187e-05 -6.502722e-03
 [ getOption("max.print") est atteint -- 20 lignes omises ]

Model rank =  10181 / 10181 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                   k'      edf k-index p-value  
s(measurement.no)                            9.00e+00 8.17e+00    0.99   0.300  
s(f0Zscore2)                                 9.00e+00 2.00e+00    1.00   0.530  
s(durationZscore2)                           2.90e+01 1.00e+00    1.02   0.855  
ti(measurement.no,f0Zscore2,durationZscore2) 3.08e+02 2.83e+01    0.98   0.075 .
ti(measurement.no,durationZscore2)           4.40e+01 1.17e+01    1.01   0.655  
ti(measurement.no,f0Zscore2)                 2.80e+01 9.71e+00    0.98   0.135  
ti(f0Zscore2,durationZscore2)                7.70e+01 1.23e+01    1.02   0.905  
s(word)                                      3.10e+02 1.48e+02      NA      NA  
s(wordPos)                                   4.62e+02 2.92e-03      NA      NA  
s(wordLeftRightTone)                         4.22e+02 1.11e+01      NA      NA  
s(measurement.no,wordPos)                    4.62e+02 1.36e+02      NA      NA  
s(f0Zscore2,wordPos)                         4.62e+02 4.98e+01      NA      NA  
s(durationZscore2,wordPos)                   4.62e+02 2.94e+01      NA      NA  
s(measurement.no,wordLeftRightTone)          4.22e+02 1.40e+02      NA      NA  
s(f0Zscore2,wordLeftRightTone)               4.22e+02 1.10e+02      NA      NA  
s(durationZscore2,wordLeftRightTone)         4.22e+02 3.50e+01      NA      NA  
s(measurement.no,word)                       3.10e+02 8.26e+01      NA      NA  
s(f0Zscore2,word)                            3.10e+02 1.31e-02      NA      NA  
s(durationZscore2,word)                      3.10e+02 1.47e-03      NA      NA  
s(measurement.no,speaker)                    1.00e+02 5.13e+01    0.99   0.270  
s(durationZscore2,speaker)                   3.00e+02 2.03e+01    1.02   0.875  
s(f0Zscore2,speaker)                         1.00e+02 4.41e+01    1.00   0.530  
s(measurement.no,speakerPos)                 3.00e+02 5.14e+01    0.99   0.435  
s(durationZscore2,speakerPos)                9.00e+02 8.25e+01    1.02   0.910  
s(f0Zscore2,speakerPos)                      3.00e+02 3.78e+01    1.00   0.525  
s(measurement.no,speakerLeftRightTone)       5.80e+02 1.07e+02    0.99   0.330  
s(durationZscore2,speakerLeftRightTone)      1.74e+03 9.60e+01    1.02   0.885  
s(f0Zscore2,speakerLeftRightTone)            5.80e+02 8.20e+01    1.00   0.535  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1


duration0.25auf = quantile(data.au.fem$durationZscore2, c(0.25)) * global_sddauf + global_meandauf

duration0.5auf = quantile(data.au.fem$durationZscore2, c(0.5)) * global_sddauf + global_meandauf

duration0.75auf = quantile(data.au.fem$durationZscore2, c(0.75)) * global_sddauf + global_meandauf
# 3D plotting

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2d, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.fem$durationZscore2, c(0.25))),
        ylim = quantile(data.au.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25auf * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0auf + global_mean0auf), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1auf + global_mean1auf, 
        zlim = c(500,900),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.270026 to 1.307646. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.65512883823603. 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(500,900), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.model2d, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2. = quantile(data.au.fem$durationZscore2, c(0.5))),
        ylim = quantile(data.au.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5auf * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0auf + global_mean0auf), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1auf + global_mean1auf, 
        zlim = c(500,900),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.270026 to 1.307646. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.135002585755248. 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(500,900), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.model2d, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.fem$durationZscore2, c(0.75))),
        ylim = quantile(data.au.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75auf * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0auf + global_mean0auf),
        transform = function(f1Zscore2) f1Zscore2 * global_sd1auf + global_mean1auf, 
        zlim = c(500,900),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.270026 to 1.307646. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.536034051323852. 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(500,900), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

NA
NA
NA
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_diff2(gamm.model2d, view=c("measurement.no","durationZscore2"),
           main = "",
           comp = list(f0Zscore2 = quantile(data.au.fem$f0Zscore2, c(0.8,0.2), na.rm = T)),
           ylim = quantile(data.au.fem$durationZscore2, c(0.05,0.95), na.rm = T),
           transform.view = c(function(measurement.no) measurement.no, function(durationZscore2) durationZscore2 * global_sddauf + global_meandauf), 
           #zlim = c(-0.5,0.5),
           print.summary = TRUE,
           sim.ci = F,
           show.diff = F,
           #color = "heat",
           alpha.diff = 0.5,
           #plot.type = "perp",
           #n.grid =300,
         add.color.legend = FALSE, rm.ranef = TRUE,  
        xlab = "Time (Normalized)", ylab = "Duration (ms)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, hide.label = T)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * durationZscore2 : numeric predictor; with 30 values ranging from -1.395442 to 1.808743. 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
#gradientLegend(valRange=c(-50,20), length=.5, pos=.75, depth = 0.02, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)

#abline(h = (1.2 * global_sdd1 + global_meand1), lty=2,lwd=2, col = "white")
# 3D plotting
 png("pred2-10.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2d, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.fem$durationZscore2, c(0.25))),
        ylim = quantile(data.au.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25auf * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0auf + global_mean0auf), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1auf + global_mean1auf, 
        zlim = c(500,900),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.270026 to 1.307646. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.65512883823603. 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(500,900), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
 png("pred2-11.png", width = 6, height = 4, units = "in", res = 1000)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2d, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2. = quantile(data.au.fem$durationZscore2, c(0.5))),
        ylim = quantile(data.au.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5auf * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0auf + global_mean0auf), 
        transform = function(f1Zscore2) f1Zscore2 * global_sd1auf + global_mean1auf, 
        zlim = c(500,900),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.270026 to 1.307646. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.135002585755248. 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(500,900), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
 png("pred2-12.png", width = 6, height = 4, units = "in", res = 1000)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2d, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.fem$durationZscore2, c(0.75))),
        ylim = quantile(data.au.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75auf * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0auf + global_mean0auf),
        transform = function(f1Zscore2) f1Zscore2 * global_sd1auf + global_mean1auf, 
        zlim = c(500,900),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.270026 to 1.307646. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.536034051323852. 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(500,900), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
 png("pred2-diff-4.png", width = 6, height = 4, units = "in", res = 1000)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
plot_diff2(gamm.model2d, view=c("measurement.no","durationZscore2"),
           main = "",
           comp = list(f0Zscore2 = quantile(data.au.fem$f0Zscore2, c(0.8,0.2), na.rm = T)),
           ylim = quantile(data.au.fem$durationZscore2, c(0.05,0.95), na.rm = T),
           transform.view = c(function(measurement.no) measurement.no, function(durationZscore2) durationZscore2 * global_sddauf + global_meandauf), 
           #zlim = c(-0.5,0.5),
           print.summary = TRUE,
           sim.ci = F,
           show.diff = F,
           #color = "heat",
           alpha.diff = 0.5,
           #plot.type = "perp",
           #n.grid =300,
         add.color.legend = FALSE, rm.ranef = TRUE,  
        xlab = "Time (Normalized)", ylab = "Duration (ms)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, hide.label = T)
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * durationZscore2 : numeric predictor; with 30 values ranging from -1.395442 to 1.808743. 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
#gradientLegend(valRange=c(-50,20), length=.5, pos=.75, depth = 0.02, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols)
axis(1, at=tickvals, labels=ticknames, las=1, cex.axis=1)
#abline(h = (1.2 * global_sdd1 + global_meand1), lty=2,lwd=2, col = "white")
dev.off()
null device 
          1 

Model 2E: /ai/ male, F2 as output

system.time(gamm.model2e.noAR <- bam(f2Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1), 
                          
                          
 
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores)
)
utilisateur     système      écoulé 
  18045.285      47.693    1592.257 
saveRDS(gamm.model2e.noAR, paste("Gamm_model2e_noAR.rds"))
gamm.model2e.noAR <- 
  readRDS("Gamm_model2e_noAR.rds")
r.gamm.model2e <- start_value_rho(gamm.model2e.noAR)
system.time(gamm.model2e <- bam(f2Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1),
                      
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores, rho = r.gamm.model2e, AR.start = data.ai.mas$start)
)
utilisateur     système      écoulé 
  16770.395      44.513    1413.492 
saveRDS(gamm.model2e, paste("Gamm_model2e.rds"))
gamm.model2e <- 
  readRDS("Gamm_model2e.rds")
summary(gamm.model2e, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f2Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(word, bs = "re") + s(wordPos, 
    bs = "re") + s(wordLeftRightTone, bs = "re") + s(wordPos, 
    measurement.no, bs = "re") + s(wordPos, f0Zscore2, bs = "re") + 
    s(wordPos, durationZscore2, bs = "re") + s(wordLeftRightTone, 
    measurement.no, bs = "re") + s(wordLeftRightTone, f0Zscore2, 
    bs = "re") + s(wordLeftRightTone, durationZscore2, bs = "re") + 
    s(word, measurement.no, bs = "re") + s(word, f0Zscore2, bs = "re") + 
    s(word, durationZscore2, bs = "re") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1) + s(measurement.no, speakerPos, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(durationZscore2, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1) + s(durationZscore2, speakerLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1)

Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.03309    0.06372  -0.519    0.603

Approximate significance of smooth terms:
                                                edf Ref.df      F p-value    
s(measurement.no)                             6.587  7.036 42.221 < 2e-16 ***
s(f0Zscore2)                                  1.001  1.001  0.704 0.40177    
s(durationZscore2)                            1.000  1.000  0.070 0.79155    
ti(measurement.no,f0Zscore2,durationZscore2) 43.112 63.333  1.502 0.00624 ** 
ti(measurement.no,durationZscore2)            8.124 10.520  8.408 < 2e-16 ***
ti(measurement.no,f0Zscore2)                  9.596 12.833  1.324 0.18437    
ti(f0Zscore2,durationZscore2)                 4.004  5.519  0.724 0.58084    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.762   Deviance explained = 79.6%
fREML = 7659.4  Scale est. = 0.1865    n = 11029
gam.check(gamm.model2e)


Method: fREML   Optimizer: perf chol
$grad
 [1] -6.466605e-11 -1.099589e-04 -8.205627e-05 -9.580248e-11 -5.427037e-11  2.728839e-11 -3.064549e-11 -5.168244e-11  7.965251e-11
[10] -1.480534e-09 -2.779021e-11 -2.173628e-11  2.299601e-10 -1.102833e-10  2.218954e-10 -3.369180e-10 -1.183778e-09  1.015632e-12
[19] -7.514487e-10 -1.523663e-09  7.680612e-11 -8.705854e-10 -7.873306e-10 -6.887912e-11  3.979395e-11 -4.629656e-05  2.742766e-10
[28] -4.629656e-05 -6.677240e-05 -4.629656e-05 -1.087983e-10 -8.439471e-12  2.441283e-10 -8.387957e-12 -6.500755e-11 -8.248069e-12
[37] -1.099849e-10 -5.539125e-12  2.314096e-10 -5.528911e-12 -1.287361e-10 -5.548895e-12  1.035460e-08

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]          [,7]          [,8]          [,9]
   2.499957e+00 -1.856674e-06 -1.653204e-08 -1.508445e-02 -1.672591e-03  4.329405e-03  4.331140e-03  4.650016e-03 -6.754962e-02
  -1.856674e-06  1.099444e-04  1.020838e-11  1.393029e-05  3.427163e-06  3.938975e-06 -4.040920e-06  1.819914e-06  3.413605e-06
  -1.653204e-08  1.020838e-11  8.204896e-05 -1.815967e-07 -2.755302e-07 -2.001405e-07  8.574229e-08 -8.465774e-07 -3.572615e-08
  -1.508445e-02  1.393029e-05 -1.815967e-07  2.017139e+00  2.915528e-01  2.097776e-01  1.252796e-04 -6.317605e-02 -4.054230e-02
  -1.672591e-03  3.427163e-06 -2.755302e-07  2.915528e-01  1.362692e+00 -2.210867e-02  6.593857e-03  4.478569e-03 -3.364210e-02
   4.329405e-03  3.938975e-06 -2.001405e-07  2.097776e-01 -2.210867e-02  1.227583e+00 -5.263585e-03 -5.290433e-02  1.008190e-02
   4.331140e-03 -4.040920e-06  8.574229e-08  1.252796e-04  6.593857e-03 -5.263585e-03  8.333206e-01  2.867781e-01 -3.340592e-02
   4.650016e-03  1.819914e-06 -8.465774e-07 -6.317605e-02  4.478569e-03 -5.290433e-02  2.867781e-01  7.909208e-01 -1.490027e-02
  -6.754962e-02  3.413605e-06 -3.572615e-08 -4.054230e-02 -3.364210e-02  1.008190e-02 -3.340592e-02 -1.490027e-02  6.294332e-01
  -2.746060e-02 -6.276876e-05  6.140013e-08  4.948368e-03 -3.964251e-02 -8.079063e-03  9.786722e-05  1.553199e-02  4.819707e-02
   3.353791e-03 -2.192985e-06  2.788012e-08 -7.919451e-03 -1.590065e-02  4.658552e-03 -1.651135e-02  3.210911e-02  6.092042e-04
   1.429716e-04 -6.574118e-07  1.851162e-07  4.083438e-03 -1.125033e-04 -1.252218e-02 -1.212269e-02  9.956261e-02  3.256245e-03
   1.694969e-02  3.095005e-05 -4.186345e-07 -8.227189e-03 -2.994921e-02 -2.731581e-02 -2.615180e-04  5.693877e-02 -1.983557e-02
   5.032234e-03  1.543397e-05 -4.960672e-07 -8.758516e-03  1.935703e-02  3.199550e-02  5.345708e-03  3.775872e-02 -7.938288e-03
  -5.214725e-03  1.899218e-05 -8.057912e-07 -3.949872e-02 -4.525950e-02 -2.620752e-02  1.215210e-02  2.274698e-02 -3.310704e-02
  -6.913185e-03  1.691916e-05  1.296798e-07 -1.682020e-02 -1.317589e-01 -1.532159e-01 -3.759230e-02 -7.200230e-02 -5.290230e-03
   1.378823e-03  2.730559e-07  1.393753e-07  6.044157e-03  2.064937e-02  2.916193e-02  8.434014e-03  6.628455e-02  5.072443e-04
   5.526265e-04 -6.456164e-08 -2.763226e-07  1.337846e-03  1.023882e-03  2.879178e-03 -1.877102e-03 -3.381944e-03  1.018394e-03
  -2.965836e-03 -6.754807e-06 -6.707781e-07  4.890695e-02  4.617717e-02 -8.166221e-02 -1.426889e-02  2.553092e-02  2.861862e-03
   4.854050e-03 -2.822043e-05 -6.249795e-08 -3.139520e-03 -8.841150e-03 -7.316079e-03 -9.275157e-04  2.923955e-02 -3.600278e-03
   5.816375e-04  2.658009e-06 -4.966738e-07 -1.814490e-02 -3.599721e-02  9.226216e-03 -2.901920e-03  8.961434e-03  3.555450e-03
   1.355703e-03  3.064987e-05 -1.731879e-07  3.849314e-02  7.538344e-02  4.284783e-03 -1.920635e-02 -2.025780e-03 -4.753179e-03
   1.187339e-03 -5.531510e-06 -3.605175e-08  3.622007e-03  7.054614e-03 -1.193543e-03  3.086482e-04  9.034116e-03  2.125985e-03
          [,10]         [,11]         [,12]         [,13]         [,14]         [,15]         [,16]         [,17]         [,18]
  -2.746060e-02  3.353791e-03  1.429716e-04  1.694969e-02  5.032234e-03 -5.214725e-03 -6.913185e-03  1.378823e-03  5.526265e-04
  -6.276876e-05 -2.192985e-06 -6.574118e-07  3.095005e-05  1.543397e-05  1.899218e-05  1.691916e-05  2.730559e-07 -6.456164e-08
   6.140013e-08  2.788012e-08  1.851162e-07 -4.186345e-07 -4.960672e-07 -8.057912e-07  1.296798e-07  1.393753e-07 -2.763226e-07
   4.948368e-03 -7.919451e-03  4.083438e-03 -8.227189e-03 -8.758516e-03 -3.949872e-02 -1.682020e-02  6.044157e-03  1.337846e-03
  -3.964251e-02 -1.590065e-02 -1.125033e-04 -2.994921e-02  1.935703e-02 -4.525950e-02 -1.317589e-01  2.064937e-02  1.023882e-03
  -8.079063e-03  4.658552e-03 -1.252218e-02 -2.731581e-02  3.199550e-02 -2.620752e-02 -1.532159e-01  2.916193e-02  2.879178e-03
   9.786722e-05 -1.651135e-02 -1.212269e-02 -2.615180e-04  5.345708e-03  1.215210e-02 -3.759230e-02  8.434014e-03 -1.877102e-03
   1.553199e-02  3.210911e-02  9.956261e-02  5.693877e-02  3.775872e-02  2.274698e-02 -7.200230e-02  6.628455e-02 -3.381944e-03
   4.819707e-02  6.092042e-04  3.256245e-03 -1.983557e-02 -7.938288e-03 -3.310704e-02 -5.290230e-03  5.072443e-04  1.018394e-03
   7.703904e-01  3.379696e-03 -2.868638e-03 -1.700091e-02  4.597510e-02 -1.203136e-02 -1.597394e-02  7.573611e-02  1.006841e-03
   3.379696e-03  2.282145e-01 -3.494891e-02  1.889486e-02 -4.540753e-03  2.171057e-02 -2.642886e-02  1.666895e-02  3.606706e-04
  -2.868638e-03 -3.494891e-02  1.823850e-01  7.550811e-04 -3.243549e-02 -1.284960e-03 -1.164307e-02 -1.637415e-02 -2.367336e-03
  -1.700091e-02  1.889486e-02  7.550811e-04  1.176055e+01  2.893151e+00  6.447481e+00 -3.067810e-01 -1.751399e-01  3.898712e-02
   4.597510e-02 -4.540753e-03 -3.243549e-02  2.893151e+00  6.383884e+00  2.325093e+00 -5.542282e-01 -3.873579e-01  7.410274e-02
  -1.203136e-02  2.171057e-02 -1.284960e-03  6.447481e+00  2.325093e+00  1.048642e+01 -2.555864e-01  3.753112e-01  8.773066e-02
  -1.597394e-02 -2.642886e-02 -1.164307e-02 -3.067810e-01 -5.542282e-01 -2.555864e-01  1.612029e+01  6.738540e-01  2.298189e-04
   7.573611e-02  1.666895e-02 -1.637415e-02 -1.751399e-01 -3.873579e-01  3.753112e-01  6.738540e-01  6.509617e+00  6.212265e-03
   1.006841e-03  3.606706e-04 -2.367336e-03  3.898712e-02  7.410274e-02  8.773066e-02  2.298189e-04  6.212265e-03  1.066605e-01
   9.728462e-04  1.569699e-02  9.885661e-03 -1.049705e+00 -2.240141e-01 -1.419817e+00  4.547464e+00  8.984995e-01 -3.152354e-02
   2.969544e-02 -3.644373e-02 -2.764809e-02 -1.850446e-01  2.635104e-01 -2.895171e-01  4.792072e-01  1.518106e+00  4.063479e-04
   4.483759e-02  6.976701e-03 -7.968751e-03  9.682716e-01  5.523419e-01  1.327565e+00 -1.701616e-01  1.643012e-01  3.321198e-01
   2.531893e-02 -5.890767e-03 -1.981867e-02 -2.414355e+00 -4.426306e-01 -1.365744e+00  6.367220e+00  7.546993e-01 -9.244719e-03
   7.922852e-03 -2.470322e-03 -4.434760e-03 -8.462770e-02  2.198132e-02 -6.749337e-02  9.126940e-02  2.848854e-01 -6.796088e-04
          [,19]         [,20]         [,21]         [,22]         [,23]         [,24]         [,25]         [,26]         [,27]
  -2.965836e-03  4.854050e-03  5.816375e-04  1.355703e-03  1.187339e-03 -4.113183e-04  1.179468e-01 -9.216466e-09  2.800647e-03
  -6.754807e-06 -2.822043e-05  2.658009e-06  3.064987e-05 -5.531510e-06  1.114552e-05 -4.198774e-06 -4.922388e-11  2.162462e-05
  -6.707781e-07 -6.249795e-08 -4.966738e-07 -1.731879e-07 -3.605175e-08 -4.551041e-07 -5.725667e-08  1.461538e-12 -4.703093e-05
   4.890695e-02 -3.139520e-03 -1.814490e-02  3.849314e-02  3.622007e-03 -6.336813e-03  1.588425e-02 -2.985631e-08 -1.456310e-02
   4.617717e-02 -8.841150e-03 -3.599721e-02  7.538344e-02  7.054614e-03 -9.779795e-03  3.648288e-02 -9.442748e-07  2.713929e-02
  -8.166221e-02 -7.316079e-03  9.226216e-03  4.284783e-03 -1.193543e-03  2.021668e-02  2.152976e-02 -2.573275e-07  3.946902e-02
  -1.426889e-02 -9.275157e-04 -2.901920e-03 -1.920635e-02  3.086482e-04 -2.157306e-03 -3.405775e-02  1.433783e-07 -1.076043e-03
   2.553092e-02  2.923955e-02  8.961434e-03 -2.025780e-03  9.034116e-03  2.782671e-03 -1.725456e-02  1.321984e-07 -3.254683e-02
   2.861862e-03 -3.600278e-03  3.555450e-03 -4.753179e-03  2.125985e-03 -9.964253e-04  3.418556e-02  1.081611e-08 -6.979799e-03
   9.728462e-04  2.969544e-02  4.483759e-02  2.531893e-02  7.922852e-03  9.094830e-03  2.656654e-02 -4.111322e-07  5.350468e-02
   1.569699e-02 -3.644373e-02  6.976701e-03 -5.890767e-03 -2.470322e-03  5.758473e-03  1.252263e-02 -1.627739e-07 -7.337454e-04
   9.885661e-03 -2.764809e-02 -7.968751e-03 -1.981867e-02 -4.434760e-03  1.176595e-02  7.202086e-03  5.162879e-07 -1.369324e-02
  -1.049705e+00 -1.850446e-01  9.682716e-01 -2.414355e+00 -8.462770e-02  3.820800e-01 -3.589259e-02  3.066801e-06 -9.840155e-02
  -2.240141e-01  2.635104e-01  5.523419e-01 -4.426306e-01  2.198132e-02  1.925209e-01  7.960997e-03 -4.887124e-06  2.754215e-01
  -1.419817e+00 -2.895171e-01  1.327565e+00 -1.365744e+00 -6.749337e-02  3.957605e-01 -2.796403e-02 -5.532141e-06 -6.764319e-01
   4.547464e+00  4.792072e-01 -1.701616e-01  6.367220e+00  9.126940e-02 -6.887171e-02 -1.079157e-01 -1.669948e-07 -4.633759e-04
   8.984995e-01  1.518106e+00  1.643012e-01  7.546993e-01  2.848854e-01  3.398392e-02  4.603974e-02  2.568205e-06 -3.958268e-01
  -3.152354e-02  4.063479e-04  3.321198e-01 -9.244719e-03 -6.796088e-04  1.261166e-01  3.436145e-03  1.335572e-06 -2.048565e-02
   2.015258e+01  5.381509e-01 -6.705676e-02  1.032069e+01  1.461645e-01  3.839646e-02  9.593669e-02 -2.622182e-06 -1.804629e-01
   5.381509e-01  6.691412e+00 -2.040013e-01  9.735683e-01  3.976005e-01  3.186987e-02  4.370745e-02  5.159481e-06 -3.477845e-01
  -6.705676e-02 -2.040013e-01  5.841671e+00 -2.685912e-01 -2.157379e-02  1.675604e+00 -2.941483e-02 -5.771912e-06  7.393674e-02
   1.032069e+01  9.735683e-01 -2.685912e-01  2.197759e+01  1.639967e-01 -1.187732e-01 -7.048013e-02 -5.741389e-06 -9.436945e-03
   1.461645e-01  3.976005e-01 -2.157379e-02  1.639967e-01  6.879833e-02 -1.976820e-02  8.858230e-03  7.976469e-07 -5.537464e-02
          [,28]         [,29]         [,30]         [,31]         [,32]         [,33]         [,34]         [,35]         [,36]
  -9.216466e-09 -9.006027e-07 -9.216466e-09  1.299888e-02 -1.274186e-03 -6.974913e-03 -1.274186e-03 -9.110549e-03 -1.274186e-03
  -4.922388e-11  8.084504e-09 -4.922388e-11 -3.472017e-05  4.427124e-07  3.429839e-05  4.427124e-07  1.552924e-05  4.427124e-07
   1.461538e-12  2.661908e-12  1.461538e-12 -4.532750e-08 -1.071649e-07 -7.178954e-06 -1.071649e-07 -1.058516e-07 -1.071649e-07
  -2.985631e-08  2.877597e-06 -2.985631e-08  1.814238e-01  1.409829e-03  4.507227e-02  1.409829e-03  5.968943e-03  1.409829e-03
  -9.442748e-07  2.611616e-06 -9.442748e-07  8.798849e-03 -3.288914e-03  7.475304e-02 -3.288914e-03 -1.551687e-02 -3.288914e-03
  -2.573275e-07  4.426154e-06 -2.573275e-07  4.079009e-02  4.386275e-03  3.081703e-02  4.386275e-03 -6.150698e-02  4.386275e-03
   1.433783e-07 -7.931023e-07  1.433783e-07 -2.918637e-02 -2.913713e-04 -4.001222e-03 -2.913713e-04 -1.565574e-02 -2.913713e-04
   1.321984e-07 -8.861353e-07  1.321984e-07 -6.168220e-02 -1.748836e-03 -5.455243e-03 -1.748836e-03  1.191002e-02 -1.748836e-03
   1.081611e-08 -1.930117e-06  1.081611e-08 -1.518104e-01  2.577302e-04 -1.277058e-02  2.577302e-04  1.175876e-02  2.577302e-04
  -4.111322e-07 -2.322118e-05 -4.111322e-07  4.380061e-02 -6.757586e-04  6.210171e-02 -6.757586e-04 -1.254586e-01 -6.757586e-04
  -1.627739e-07 -1.238859e-06 -1.627739e-07 -8.847527e-03  4.274908e-04  2.358910e-02  4.274908e-04 -3.278009e-02  4.274908e-04
   5.162879e-07  3.422432e-06  5.162879e-07 -1.261428e-02 -1.805992e-03 -2.896514e-02 -1.805992e-03  3.293708e-02 -1.805992e-03
   3.066801e-06  1.600609e-05  3.066801e-06 -6.049806e-02 -4.458479e-02  6.073267e-01 -4.458479e-02  6.202832e-02 -4.458479e-02
  -4.887124e-06  1.134016e-05 -4.887124e-06 -7.852471e-02 -1.755001e-01  2.115692e-01 -1.755001e-01  1.616274e-02 -1.755001e-01
  -5.532141e-06  3.954329e-05 -5.532141e-06 -4.530259e-03 -4.110957e-02  1.102678e+00 -4.110957e-02  4.341969e-01 -4.110957e-02
  -1.669948e-07  2.277366e-05 -1.669948e-07  1.322945e-01 -3.370702e-02 -4.220903e-01 -3.370702e-02  2.302064e-01 -3.370702e-02
   2.568205e-06  9.832117e-06  2.568205e-06 -6.217306e-02 -2.650030e-02  3.264588e-01 -2.650031e-02  1.251803e-01 -2.650031e-02
   1.335572e-06  2.518505e-06  1.335572e-06  1.172713e-02  2.350061e-02  8.291029e-02  2.350061e-02  4.849956e-02  2.350061e-02
  -2.622182e-06 -1.464153e-05 -2.622182e-06 -4.460914e-01 -4.639843e-02 -1.771732e-01 -4.639843e-02 -2.267621e-01 -4.639843e-02
   5.159481e-06 -1.439540e-05  5.159481e-06  1.435004e-01  4.630446e-02 -5.291383e-01  4.630446e-02 -5.288312e-02  4.630446e-02
  -5.771912e-06  1.050941e-05 -5.771912e-06 -7.510610e-03 -4.545618e-03 -1.449367e-01 -4.545618e-03  3.732697e-01 -4.545618e-03
  -5.741389e-06  1.353912e-05 -5.741389e-06  2.257074e-02 -2.649811e-02 -1.374628e-01 -2.649811e-02  3.958191e-02 -2.649811e-02
   7.976469e-07 -2.506289e-07  7.976469e-07  1.136349e-02  8.714734e-04 -6.151112e-02  8.714734e-04  5.677868e-03  8.714734e-04
          [,37]         [,38]         [,39]         [,40]         [,41]         [,42]         [,43]
   7.517359e-02  2.776337e-04 -6.855362e-03  2.776337e-04 -5.089686e-03  2.776337e-04 -2.793525e+00
   3.317663e-07  1.675043e-06  2.341829e-05  1.675043e-06  1.130294e-05  1.675043e-06 -2.912291e-04
   1.014351e-07 -1.833834e-07 -1.480195e-05 -1.833834e-07 -8.691400e-07 -1.833834e-07 -1.088927e-05
  -1.897037e-01  5.312938e-03 -5.373390e-02  5.312938e-03  7.018265e-02  5.312938e-03 -7.328433e+00
   5.623876e-02 -2.768893e-04  1.785247e-02 -2.768893e-04  1.096926e-01 -2.768893e-04 -7.928704e+00
  -1.610249e-02 -1.815318e-03 -5.325442e-02 -1.815318e-03  4.768910e-02 -1.815318e-03 -5.798656e+00
  -4.172417e-02  1.291744e-03  1.405670e-04  1.291744e-03  2.407981e-03  1.291744e-03 -1.568555e+00
  -2.682772e-02  7.789009e-03 -8.839564e-03  7.789009e-03  6.169620e-02  7.789009e-03 -1.993330e+00
  -8.278395e-03 -1.615842e-03 -6.759531e-02 -1.615842e-03 -3.107265e-02 -1.615842e-03 -1.753660e+00
  -2.052793e-02  5.569134e-03  4.839447e-02  5.569134e-03 -1.322024e-01  5.569134e-03 -2.544212e+00
  -3.585578e-02 -5.556687e-03  1.618409e-02 -5.556687e-03  4.154559e-02 -5.556687e-03 -7.021839e-01
  -1.134391e-02 -4.965415e-03 -1.819228e-02 -4.965415e-03  6.003034e-02 -4.965415e-03 -7.998985e-01
   2.027300e-01 -4.465192e-03 -4.038961e-01 -4.465192e-03  2.733135e-02 -4.465192e-03 -3.200164e+01
  -7.797114e-02  3.589740e-02  1.388210e-01  3.589740e-02  1.918560e-01  3.589740e-02 -2.324852e+01
   9.813057e-02 -2.262473e-02 -9.669716e-01 -2.262473e-02 -8.764547e-02 -2.262473e-02 -3.533263e+01
  -3.364522e-01 -3.115238e-02  1.712298e-01 -3.115238e-02  8.236267e-02 -3.115238e-02 -4.425150e+01
   3.036085e-01  2.073216e-02  6.482705e-02  2.073216e-02  1.304600e-01  2.073216e-02 -2.586444e+01
   1.147328e-02  1.004829e-02  1.573968e-01  1.004829e-02  2.991350e-03  1.004829e-02 -2.044627e+00
   2.486090e-01 -3.430846e-02 -2.822484e-01 -3.430846e-02 -1.485171e-01 -3.430846e-02 -4.964285e+01
  -3.092739e-01  1.370718e-02  2.567141e-01  1.370718e-02  3.114682e-01  1.370718e-02 -2.372548e+01
   8.471697e-02  1.515179e-02  1.790485e+00  1.515179e-02  5.428370e-02  1.515179e-02 -2.202967e+01
   2.816684e-01 -1.389207e-02 -4.396930e-01 -1.389207e-02 -2.355564e-02 -1.389207e-02 -4.977567e+01
   2.006597e-02 -7.143762e-04 -3.748551e-02 -7.143761e-04  2.813589e-02 -7.143761e-04 -2.466024e+00
 [ getOption("max.print") est atteint -- 20 lignes omises ]

Model rank =  8855 / 8855 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                   k'      edf k-index p-value  
s(measurement.no)                            9.00e+00 6.59e+00    0.98    0.10  
s(f0Zscore2)                                 9.00e+00 1.00e+00    0.98    0.14  
s(durationZscore2)                           2.90e+01 1.00e+00    1.01    0.77  
ti(measurement.no,f0Zscore2,durationZscore2) 3.08e+02 4.31e+01    0.99    0.17  
ti(measurement.no,durationZscore2)           4.40e+01 8.12e+00    1.03    0.99  
ti(measurement.no,f0Zscore2)                 2.80e+01 9.60e+00    1.01    0.67  
ti(f0Zscore2,durationZscore2)                7.70e+01 4.00e+00    0.98    0.11  
s(word)                                      2.09e+02 6.40e+01      NA      NA  
s(wordPos)                                   3.31e+02 4.65e+01      NA      NA  
s(wordLeftRightTone)                         3.10e+02 7.07e+01      NA      NA  
s(measurement.no,wordPos)                    3.31e+02 8.85e+01      NA      NA  
s(f0Zscore2,wordPos)                         3.31e+02 5.17e+01      NA      NA  
s(durationZscore2,wordPos)                   3.31e+02 4.09e+00      NA      NA  
s(measurement.no,wordLeftRightTone)          3.10e+02 9.93e+01      NA      NA  
s(f0Zscore2,wordLeftRightTone)               3.10e+02 4.75e+01      NA      NA  
s(durationZscore2,wordLeftRightTone)         3.10e+02 4.41e+01      NA      NA  
s(measurement.no,word)                       2.09e+02 9.96e+01      NA      NA  
s(f0Zscore2,word)                            2.09e+02 4.93e+00      NA      NA  
s(durationZscore2,word)                      2.09e+02 1.42e+01      NA      NA  
s(measurement.no,speaker)                    1.00e+02 3.84e+01    0.98    0.10  
s(durationZscore2,speaker)                   3.00e+02 1.04e+02    1.01    0.73  
s(f0Zscore2,speaker)                         1.00e+02 4.19e-03    0.98    0.13  
s(measurement.no,speakerPos)                 3.00e+02 7.37e+01    0.98    0.08 .
s(durationZscore2,speakerPos)                9.00e+02 1.05e+02    1.01    0.78  
s(f0Zscore2,speakerPos)                      3.00e+02 6.74e+01    0.98    0.13  
s(measurement.no,speakerLeftRightTone)       5.90e+02 1.17e+02    0.98    0.09 .
s(durationZscore2,speakerLeftRightTone)      1.77e+03 2.59e+02    1.01    0.77  
s(f0Zscore2,speakerLeftRightTone)            5.90e+02 1.11e+02    0.98    0.18  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

# Plotting
# 3D plot 
# png("pred2b-1.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2e, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.25))),
        ylim = quantile(data.ai.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25 * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0 + global_mean0), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2 + global_mean2, 
        zlim = c(1400,1900),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.266227 to 1.296824. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.449662795901817. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1400,1900), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
# dev.off()
# png("pred2b-2.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.model2e, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.5))),
        ylim = quantile(data.ai.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5 * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0 + global_mean0), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2 + global_mean2, 
        zlim = c(1400,1900),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.266227 to 1.296824. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.0671853722597352. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1400,1900), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
# dev.off()
# png("pred2b-3.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.model2e, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.75))),
        ylim = quantile(data.ai.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75 * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0 + global_mean0), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2 + global_mean2, 
        zlim = c(1400,1900),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.266227 to 1.296824. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.637773887350503. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1400,1900), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

# dev.off()
# Plotting
# 3D plot 
png("pred2b-1.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2e, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.25))),
        ylim = quantile(data.ai.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25 * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0 + global_mean0), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2 + global_mean2, 
        zlim = c(1400,1900),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.266227 to 1.296824. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.449662795901817. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1400,1900), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
png("pred2b-2.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2e, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.5))),
        ylim = quantile(data.ai.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5 * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0 + global_mean0), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2 + global_mean2, 
        zlim = c(1400,1900),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.266227 to 1.296824. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.0671853722597352. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1400,1900), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
png("pred2b-3.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2e, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.mas$durationZscore2, c(0.75))),
        ylim = quantile(data.ai.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75 * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0 + global_mean0), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2 + global_mean2, 
        zlim = c(1400,1900),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.266227 to 1.296824. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.637773887350503. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Deb. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 H H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0011. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0006 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0002 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1400,1900), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 

Model 2F: /ai/ female, F2 as output

system.time(gamm.model2f.noAR <- bam(f2Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1), 
                          
                          
 
                      data=data.ai.fem, method="fREML", discrete = TRUE, nthreads = ncores)
)
saveRDS(gamm.model2f.noAR, paste("Gamm_model2f_noAR.rds"))
gamm.model2f.noAR <- 
  readRDS("Gamm_model2f_noAR.rds")
r.gamm.model2f <- start_value_rho(gamm.model2f.noAR)
system.time(gamm.model2f <- bam(f2Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1),
                      
                      data=data.ai.fem, method="fREML", discrete = TRUE, nthreads = ncores, rho = r.gamm.model2f, AR.start = data.ai.fem$start)
)
utilisateur     système      écoulé 
  15528.395     196.980    1394.229 
saveRDS(gamm.model2f, paste("Gamm_model2f.rds"))
gamm.model2f <- 
  readRDS("Gamm_model2f.rds")
summary(gamm.model2f, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f2Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(word, bs = "re") + s(wordPos, 
    bs = "re") + s(wordLeftRightTone, bs = "re") + s(wordPos, 
    measurement.no, bs = "re") + s(wordPos, f0Zscore2, bs = "re") + 
    s(wordPos, durationZscore2, bs = "re") + s(wordLeftRightTone, 
    measurement.no, bs = "re") + s(wordLeftRightTone, f0Zscore2, 
    bs = "re") + s(wordLeftRightTone, durationZscore2, bs = "re") + 
    s(word, measurement.no, bs = "re") + s(word, f0Zscore2, bs = "re") + 
    s(word, durationZscore2, bs = "re") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1) + s(measurement.no, speakerPos, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(durationZscore2, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1) + s(durationZscore2, speakerLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1)

Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.001353   0.068175    0.02    0.984

Approximate significance of smooth terms:
                                                edf Ref.df      F  p-value    
s(measurement.no)                             1.000  1.000 43.012  < 2e-16 ***
s(f0Zscore2)                                  1.299  1.383  1.414   0.3345    
s(durationZscore2)                            1.000  1.000  1.746   0.1864    
ti(measurement.no,f0Zscore2,durationZscore2)  7.153 11.575  0.330   0.9841    
ti(measurement.no,durationZscore2)           11.826 15.816  3.599 1.74e-06 ***
ti(measurement.no,f0Zscore2)                  6.133  8.041  2.059   0.0377 *  
ti(f0Zscore2,durationZscore2)                 1.990  2.644  0.067   0.9769    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.565   Deviance explained = 61.7%
fREML =  10576  Scale est. = 0.39103   n = 10275
gam.check(gamm.model2f)


Method: fREML   Optimizer: perf chol
$grad
 [1] -4.059069e-05 -3.621745e-11 -6.621412e-05 -2.511880e-12  9.776513e-12  1.672240e-11
 [7]  2.539258e-11 -2.151834e-11  8.259393e-12  2.543565e-11 -4.782791e-11 -4.194253e-11
[13] -1.131390e-09 -1.109672e-10 -6.864180e-10  3.423395e-11 -2.213056e-10 -8.591172e-10
[19]  1.992291e-10 -7.025869e-05 -8.696881e-05  5.742606e-11 -3.369820e-10 -3.685521e-10
[25] -2.665956e-11 -1.379341e-12 -3.918283e-05 -1.368031e-12  8.075673e-11 -1.376385e-12
[31]  5.211120e-11  1.643352e-12  4.817480e-12  1.604161e-12  6.907186e-11  1.598943e-12
[37]  3.115730e-11  3.152856e-11  2.128644e-10  3.161116e-11 -6.675549e-11  3.155920e-11
[43]  1.219723e-08

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]
   4.058776e-05 -6.835414e-08 -9.255582e-13  2.124997e-07  3.148291e-08  1.198916e-07
  -6.835414e-08  2.801906e-02  1.807924e-08  1.082223e-03 -1.231766e-03 -7.797321e-04
  -9.255582e-13  1.807924e-08  6.620930e-05  1.722044e-08 -2.723727e-08  1.565426e-08
   2.124997e-07  1.082223e-03  1.722044e-08  1.617203e-01 -6.588701e-03 -7.053157e-02
   3.148291e-08 -1.231766e-03 -2.723727e-08 -6.588701e-03  4.733013e-02 -1.261378e-02
   1.198916e-07 -7.797321e-04  1.565426e-08 -7.053157e-02 -1.261378e-02  1.346989e-01
  -3.751491e-07 -2.451471e-03 -5.063545e-08 -1.820261e-02  4.434096e-03  4.297510e-03
   5.056158e-08 -3.457879e-03 -9.382181e-08  1.523970e-02 -9.960437e-03  3.423857e-02
  -1.556535e-06 -1.321340e-02  6.583246e-09  6.572580e-04  1.978154e-03  2.442259e-03
  -4.379806e-06 -1.230206e-02 -5.874370e-08  5.920278e-03 -2.842395e-03  1.214910e-03
  -6.493615e-08  1.564333e-03  1.502420e-07  1.022127e-03 -3.001984e-03 -1.724736e-03
  -1.361317e-08  5.427404e-04  3.029203e-07 -2.461989e-03  1.180844e-03  1.696576e-03
  -1.180111e-07 -2.900070e-03 -1.358259e-06 -1.086932e-03 -5.657394e-03 -2.791764e-04
  -1.617118e-08  2.275393e-03 -1.429857e-07 -6.714172e-04 -1.612705e-04  2.683702e-03
   8.847983e-08  3.311472e-04 -9.386240e-08  2.777844e-04 -3.248269e-04  3.041690e-04
  -4.817675e-07  7.485082e-03 -1.800745e-07  1.433210e-02 -3.394547e-02 -2.315925e-02
   5.433134e-07 -3.232879e-02  7.058079e-07 -7.211679e-03 -2.501599e-04  4.433364e-03
  -1.147321e-07 -3.633317e-03 -6.520884e-06  5.540289e-04  5.520110e-03  8.934579e-03
  -5.873207e-07  1.450407e-02 -2.362378e-07  1.410898e-02  1.023451e-02  2.017473e-03
  -7.685524e-12  5.768272e-07 -5.237494e-11 -5.825577e-07  1.029048e-06  1.552167e-07
  -5.853066e-11 -6.104601e-07 -1.460963e-09 -1.830255e-06  1.026413e-06 -4.958978e-07
  -4.538810e-07  3.648839e-03 -1.607981e-06 -1.112204e-03 -2.281638e-02 -8.067152e-03
  -1.852631e-07 -1.378429e-02  7.145217e-07  5.412647e-04 -1.309286e-02  4.607944e-03
           [,7]          [,8]          [,9]         [,10]         [,11]         [,12]
  -3.751491e-07  5.056158e-08 -1.556535e-06 -4.379806e-06 -6.493615e-08 -1.361317e-08
  -2.451471e-03 -3.457879e-03 -1.321340e-02 -1.230206e-02  1.564333e-03  5.427404e-04
  -5.063545e-08 -9.382181e-08  6.583246e-09 -5.874370e-08  1.502420e-07  3.029203e-07
  -1.820261e-02  1.523970e-02  6.572580e-04  5.920278e-03  1.022127e-03 -2.461989e-03
   4.434096e-03 -9.960437e-03  1.978154e-03 -2.842395e-03 -3.001984e-03  1.180844e-03
   4.297510e-03  3.423857e-02  2.442259e-03  1.214910e-03 -1.724736e-03  1.696576e-03
   1.194557e+00  3.119124e-01 -9.322738e-03  4.072969e-03 -3.372672e-03  6.963684e-05
   3.119124e-01  1.250384e+00 -1.504501e-03 -7.159884e-03  6.555813e-04  7.716564e-03
  -9.322738e-03 -1.504501e-03  4.868940e-01  2.418944e-01 -1.253205e-03  5.609250e-05
   4.072969e-03 -7.159884e-03  2.418944e-01  4.087111e-01 -3.579560e-03 -3.454027e-04
  -3.372672e-03  6.555813e-04 -1.253205e-03 -3.579560e-03  1.044992e-02 -6.487705e-03
   6.963684e-05  7.716564e-03  5.609250e-05 -3.454027e-04 -6.487705e-03  1.162602e-02
   8.148794e-03  6.568174e-02  1.462764e-02  7.507283e-02 -1.320430e-03 -1.067867e-04
  -1.820404e-02 -3.266952e-03  7.660801e-05  1.352387e-03  2.002429e-03  4.741298e-03
   2.790342e-04 -7.764825e-03 -7.104994e-04 -6.644612e-03 -7.117255e-04 -4.295141e-04
   4.784249e-04  1.624133e-01  4.185889e-03  3.590664e-02  1.085290e-02  1.375038e-03
   2.551981e-02 -1.094667e-02  2.127187e-02 -1.812703e-02  5.740033e-03  5.506141e-03
  -1.512218e-02  1.676564e-02 -2.613643e-04 -1.175214e-02 -2.205535e-03 -1.087743e-02
   1.127844e-02  4.474944e-02 -5.739211e-03  2.774524e-02  1.145524e-02 -1.037996e-03
  -1.126665e-06 -5.372108e-06  4.236203e-07  1.481589e-06 -6.388545e-07  2.308774e-08
  -6.740442e-06  4.303934e-06 -1.619065e-07 -3.899809e-06  1.795139e-06 -8.741417e-07
  -2.225024e-02  6.111324e-02 -4.203095e-03  3.695766e-02  2.885622e-03 -1.584840e-03
   2.018895e-02  7.504466e-03  6.099616e-03 -1.076531e-02  5.540443e-03  4.223108e-03
          [,13]         [,14]         [,15]         [,16]         [,17]         [,18]
  -1.180111e-07 -1.617118e-08  8.847983e-08 -4.817675e-07  5.433134e-07 -1.147321e-07
  -2.900070e-03  2.275393e-03  3.311472e-04  7.485082e-03 -3.232879e-02 -3.633317e-03
  -1.358259e-06 -1.429857e-07 -9.386240e-08 -1.800745e-07  7.058079e-07 -6.520884e-06
  -1.086932e-03 -6.714172e-04  2.777844e-04  1.433210e-02 -7.211679e-03  5.540289e-04
  -5.657394e-03 -1.612705e-04 -3.248269e-04 -3.394547e-02 -2.501599e-04  5.520110e-03
  -2.791764e-04  2.683702e-03  3.041690e-04 -2.315925e-02  4.433364e-03  8.934579e-03
   8.148794e-03 -1.820404e-02  2.790342e-04  4.784249e-04  2.551981e-02 -1.512218e-02
   6.568174e-02 -3.266952e-03 -7.764825e-03  1.624133e-01 -1.094667e-02  1.676564e-02
   1.462764e-02  7.660801e-05 -7.104994e-04  4.185889e-03  2.127187e-02 -2.613643e-04
   7.507283e-02  1.352387e-03 -6.644612e-03  3.590664e-02 -1.812703e-02 -1.175214e-02
  -1.320430e-03  2.002429e-03 -7.117255e-04  1.085290e-02  5.740033e-03 -2.205535e-03
  -1.067867e-04  4.741298e-03 -4.295141e-04  1.375038e-03  5.506141e-03 -1.087743e-02
   1.459165e+01  1.902873e+00  4.431315e-01 -5.705216e-01  9.354388e-01  9.516980e-01
   1.902873e+00  3.268664e+00  3.643153e-02  4.998851e-01 -1.039178e-01  1.715275e-01
   4.431315e-01  3.643153e-02  2.121039e-01  2.261631e-02  5.541849e-02  1.149004e-01
  -5.705216e-01  4.998851e-01  2.261631e-02  2.013791e+01  1.449042e+00 -3.929527e-01
   9.354388e-01 -1.039178e-01  5.541849e-02  1.449042e+00  9.538980e+00  6.206695e-01
   9.516980e-01  1.715275e-01  1.149004e-01 -3.929527e-01  6.206695e-01  3.296439e+00
  -8.679371e-01 -2.590166e-01 -1.214385e-01  4.201246e+00  4.972705e-01 -2.236343e-02
   2.608423e-05 -4.435716e-08  1.268650e-05 -5.343321e-06  2.593156e-05  1.242025e-05
   1.643075e-04  5.587662e-05 -1.222296e-05 -4.150983e-06  4.645168e-05  3.270579e-04
  -1.862341e+00 -2.323828e-01 -4.783230e-02  6.204254e+00  7.180152e-01 -9.428536e-02
   6.307587e-01  1.541098e-01 -6.366158e-04  1.982266e-01  2.760731e+00  1.881498e-01
          [,19]         [,20]         [,21]         [,22]         [,23]         [,24]
  -5.873207e-07 -7.685524e-12 -5.853066e-11 -4.538810e-07 -1.852631e-07 -1.995891e-08
   1.450407e-02  5.768272e-07 -6.104601e-07  3.648839e-03 -1.378429e-02  1.651868e-06
  -2.362378e-07 -5.237494e-11 -1.460963e-09 -1.607981e-06  7.145217e-07 -5.733993e-07
   1.410898e-02 -5.825577e-07 -1.830255e-06 -1.112204e-03  5.412647e-04 -1.444551e-04
   1.023451e-02  1.029048e-06  1.026413e-06 -2.281638e-02 -1.309286e-02 -1.261630e-03
   2.017473e-03  1.552167e-07 -4.958978e-07 -8.067152e-03  4.607944e-03 -3.042817e-04
   1.127844e-02 -1.126665e-06 -6.740442e-06 -2.225024e-02  2.018895e-02 -5.193177e-04
   4.474944e-02 -5.372108e-06  4.303934e-06  6.111324e-02  7.504466e-03  3.276579e-03
  -5.739211e-03  4.236203e-07 -1.619065e-07 -4.203095e-03  6.099616e-03 -6.186873e-05
   2.774524e-02  1.481589e-06 -3.899809e-06  3.695766e-02 -1.076531e-02 -9.311176e-04
   1.145524e-02 -6.388545e-07  1.795139e-06  2.885622e-03  5.540443e-03  4.547342e-04
  -1.037996e-03  2.308774e-08 -8.741417e-07 -1.584840e-03  4.223108e-03 -6.005400e-04
  -8.679371e-01  2.608423e-05  1.643075e-04 -1.862341e+00  6.307587e-01  1.064780e-01
  -2.590166e-01 -4.435716e-08  5.587662e-05 -2.323828e-01  1.541098e-01  6.631936e-04
  -1.214385e-01  1.268650e-05 -1.222296e-05 -4.783230e-02 -6.366158e-04  1.154977e-02
   4.201246e+00 -5.343321e-06 -4.150983e-06  6.204254e+00  1.982266e-01 -3.222782e-02
   4.972705e-01  2.593156e-05  4.645168e-05  7.180152e-01  2.760731e+00  2.517874e-02
  -2.236343e-02  1.242025e-05  3.270579e-04 -9.428536e-02  1.881498e-01  2.030834e-01
   2.033196e+01  2.395834e-05 -1.232484e-05  8.753931e+00  2.736612e-01 -2.682660e-03
   2.395834e-05  7.025797e-05 -4.081471e-09 -5.898835e-07  3.023141e-05  3.949858e-07
  -1.232484e-05 -4.081471e-09  8.698871e-05 -4.534432e-06  4.142141e-05  5.488032e-05
   8.753931e+00 -5.898835e-07 -4.534432e-06  1.490760e+01  4.303033e-01 -7.513833e-03
   2.736612e-01  3.023141e-05  4.142141e-05  4.303033e-01  3.258479e+00  4.458894e-03
          [,25]         [,26]         [,27]         [,28]         [,29]         [,30]
  -1.200739e-05 -4.723865e-10 -5.557988e-13 -4.723865e-10 -7.158549e-08 -4.723865e-10
  -3.651729e-03  1.301933e-05 -2.973608e-08  1.301933e-05  5.634651e-02  1.301933e-05
  -2.733974e-08 -3.078659e-09 -2.899777e-10 -3.078659e-09 -1.492172e-08 -3.078659e-09
  -7.701303e-03  4.063392e-05 -1.958458e-08  4.063391e-05 -5.289316e-03  4.063391e-05
   6.714412e-04  1.660672e-04  1.168403e-07  1.660672e-04 -1.218616e-02  1.660672e-04
  -1.303073e-03  3.625641e-04  1.808565e-07  3.625641e-04 -3.699236e-02  3.625641e-04
   6.055852e-03  1.833099e-05 -6.298191e-08  1.833099e-05 -6.699553e-02  1.833099e-05
   2.317523e-02 -4.248413e-04  1.021437e-07 -4.248413e-04 -7.604221e-02 -4.248413e-04
   7.145677e-02  1.060776e-06  6.100304e-08  1.060776e-06 -2.703012e-02  1.060776e-06
  -1.042423e-02 -2.421610e-04  6.348219e-08 -2.421610e-04  2.356735e-02 -2.421610e-04
  -1.393432e-03  9.763462e-05  1.679740e-08  9.763462e-05 -3.711875e-03  9.763462e-05
  -1.838163e-03  1.571946e-05 -4.297755e-08  1.571946e-05 -1.051006e-02  1.571946e-05
  -1.972778e-02 -1.625717e-03  4.212569e-06 -1.625717e-03 -1.227684e-01 -1.625717e-03
  -2.363023e-02  2.457792e-03 -2.841081e-07  2.457792e-03  1.439113e-02  2.457792e-03
   1.461398e-02  1.176743e-04 -1.790083e-07  1.176743e-04  1.047972e-02  1.176743e-04
  -1.521591e-01 -1.747439e-03  4.823040e-07 -1.747439e-03  2.097532e-02 -1.747439e-03
   1.712137e-01 -7.201126e-03 -1.414438e-06 -7.201126e-03 -1.976255e-02 -7.201126e-03
   5.467412e-02 -2.953599e-03  1.754523e-06 -2.953599e-03 -8.152549e-02 -2.953599e-03
  -1.136062e-02 -4.688517e-03  2.210305e-06 -4.688517e-03  3.596685e-01 -4.688517e-03
   9.776983e-07 -5.436585e-08 -3.161632e-11 -5.436585e-08  5.619420e-06 -5.436585e-08
   1.464269e-05  8.385178e-08 -3.757786e-10  8.385178e-08 -9.413876e-06  8.385178e-08
  -1.297027e-01 -2.610450e-03 -8.819002e-07 -2.610450e-03  1.119170e-01 -2.610450e-03
  -2.300952e-02 -2.798848e-03  4.384795e-07 -2.798848e-03  5.672466e-02 -2.798848e-03
          [,31]         [,32]         [,33]         [,34]         [,35]         [,36]
  -1.442855e-06  2.064283e-08 -2.869540e-07  2.064283e-08  1.694545e-08  2.064283e-08
  -8.010721e-03  6.247605e-04  7.383497e-03  6.247605e-04 -5.215962e-05  6.247605e-04
  -3.921845e-07  4.573161e-09 -2.051854e-05  4.573161e-09  6.646263e-07  4.573161e-09
   1.102660e-02 -2.722202e-04 -2.554748e-02 -2.722202e-04  9.496156e-03 -2.722202e-04
  -6.439294e-03  2.107252e-04 -2.843185e-02  2.107252e-04 -1.433799e-02  2.107252e-04
   1.654930e-02  8.312763e-04 -1.382463e-02  8.312763e-04 -1.324787e-02  8.312763e-04
   2.749962e-02  1.974851e-03  2.400890e-02  1.974851e-03 -4.317661e-03  1.974851e-03
   5.490611e-02  1.245795e-03  4.617678e-02  1.245795e-03 -2.789863e-02  1.245795e-03
  -3.218281e-02  1.036232e-03  1.030730e-02  1.036232e-03  2.094064e-02  1.036232e-03
  -1.057850e-02 -1.141307e-03 -1.175262e-02 -1.141307e-03  2.237277e-02 -1.141307e-03
  -4.351585e-03  8.267097e-04 -3.795412e-03  8.267097e-04 -1.134956e-02  8.267097e-04
  -7.628076e-03  5.031705e-04 -1.082069e-02  5.031705e-04 -5.153669e-03  5.031705e-04
  -6.463396e-02  8.638910e-03  4.181867e-01  8.638910e-03  3.022208e-02  8.638909e-03
  -5.883933e-02 -4.743485e-05 -1.329131e-01 -4.743485e-05  4.180930e-02 -4.743485e-05
   3.516354e-03  7.139913e-03  3.719543e-02  7.139913e-03  2.610360e-02  7.139913e-03
   1.881322e-01 -2.375697e-02 -2.856285e-01 -2.375697e-02  6.611823e-02 -2.375697e-02
   2.119787e-02 -2.222549e-02 -9.514765e-02 -2.222549e-02 -3.439864e-01 -2.222549e-02
   6.626745e-02  4.461932e-03  2.197801e-01  4.461932e-03  4.600066e-02  4.461932e-03
  -1.235922e-01 -2.811537e-02  1.151265e-01 -2.811537e-02  2.064333e-01 -2.811537e-02
  -1.567984e-06  5.037461e-07 -1.346804e-05  5.037461e-07  3.579519e-06  5.037461e-07
   4.472862e-06  7.753363e-07  2.155098e-04  7.753362e-07  4.350311e-05  7.753362e-07
   6.304050e-02 -3.183822e-02 -2.193641e-01 -3.183822e-02  1.005136e-02 -3.183822e-02
   1.079031e-01 -1.273432e-02 -1.016659e-01 -1.273432e-02  1.027159e-01 -1.273432e-02
          [,37]         [,38]         [,39]         [,40]         [,41]         [,42]
  -2.355174e-06  3.746502e-08  2.567077e-07  3.746502e-08 -5.047977e-08  3.746502e-08
   8.905210e-03  9.545980e-04  8.272806e-03  9.545980e-04  1.792717e-02  9.545980e-04
   1.582531e-07  1.735046e-08 -2.102696e-05  1.735046e-08  4.700635e-07  1.735046e-08
   1.820813e-02 -8.865944e-05 -5.603346e-03 -8.865944e-05  6.202788e-03 -8.865944e-05
   1.036345e-02  2.014739e-03  2.988353e-02  2.014739e-03  3.726011e-03  2.014739e-03
   1.628755e-02  1.250722e-03  2.714633e-02  1.250722e-03  8.180883e-03  1.250722e-03
  -6.609396e-02  5.814416e-03  4.953492e-02  5.814416e-03  8.360095e-02  5.814416e-03
   2.728893e-02  1.277839e-03  1.063570e-01  1.277839e-03 -8.030345e-02  1.277839e-03
  -3.725881e-02  2.750189e-03  2.566467e-03  2.750189e-03 -1.775884e-02  2.750189e-03
  -1.604958e-02  4.341278e-03  4.589217e-02  4.341278e-03 -1.729495e-02  4.341278e-03
  -5.598287e-05 -5.696725e-04  7.848316e-04 -5.696725e-04  1.743347e-02 -5.696725e-04
  -1.768843e-03  1.058570e-04  1.421523e-02  1.058570e-04  1.830551e-02  1.058570e-04
   1.383733e-01 -1.543944e-02  4.372202e-01 -1.543944e-02 -1.357168e-01 -1.543944e-02
   4.719865e-02  1.457266e-02  1.727387e-01  1.457266e-02 -7.422392e-02  1.457266e-02
  -4.092469e-02  8.190201e-04 -1.554662e-01  8.190201e-04 -5.434497e-03  8.190201e-04
  -1.251299e-01  9.712825e-02  2.496001e-02  9.712825e-02  2.167738e-01  9.712825e-02
  -2.267620e-01 -4.018950e-02 -8.049615e-01 -4.018950e-02  2.460837e-01 -4.018950e-02
   1.346285e-01 -1.511220e-02  3.178864e-01 -1.511220e-02 -1.666556e-01 -1.511220e-02
  -1.912494e-01 -1.766386e-01 -7.311826e-01 -1.766386e-01  2.367257e-01 -1.766386e-01
  -1.584603e-06  4.743486e-07 -1.235287e-05  4.743486e-07  1.746024e-05  4.743486e-07
   5.573328e-05 -5.663561e-06  6.961738e-05 -5.663561e-06  7.516810e-06 -5.663561e-06
  -1.733565e-01 -3.382266e-02 -4.885975e-01 -3.382266e-02  1.222144e-01 -3.382266e-02
   1.482106e-01  1.408333e-02  8.745991e-02  1.408333e-02  2.004322e-01  1.408333e-02
          [,43]
  -1.607589e-05
  -1.496071e-01
  -1.346904e-05
  -8.367940e-01
  -9.458253e-01
  -1.293794e+00
  -2.180152e+00
  -3.232756e+00
  -1.196251e+00
  -1.370127e+00
  -2.512830e-01
  -2.437146e-01
  -3.504332e+01
  -1.313519e+01
  -3.235735e+00
  -4.640936e+01
  -3.537426e+01
  -1.571325e+01
  -4.916784e+01
  -5.001692e-04
  -3.279942e-03
  -3.980497e+01
  -1.760626e+01
 [ getOption("max.print") est atteint -- 20 lignes omises ]

Model rank =  8663 / 8663 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                   k'      edf k-index p-value  
s(measurement.no)                            9.00e+00 1.00e+00    1.03   0.960  
s(f0Zscore2)                                 9.00e+00 1.30e+00    1.00   0.390  
s(durationZscore2)                           2.90e+01 1.00e+00    1.00   0.475  
ti(measurement.no,f0Zscore2,durationZscore2) 3.08e+02 7.15e+00    1.01   0.745  
ti(measurement.no,durationZscore2)           4.40e+01 1.18e+01    1.01   0.855  
ti(measurement.no,f0Zscore2)                 2.80e+01 6.13e+00    1.03   0.975  
ti(f0Zscore2,durationZscore2)                7.70e+01 1.99e+00    0.98   0.065 .
s(word)                                      2.03e+02 7.01e+01      NA      NA  
s(wordPos)                                   3.09e+02 2.63e+01      NA      NA  
s(wordLeftRightTone)                         2.90e+02 6.47e+00      NA      NA  
s(measurement.no,wordPos)                    3.09e+02 9.28e+01      NA      NA  
s(f0Zscore2,wordPos)                         3.09e+02 7.07e+01      NA      NA  
s(durationZscore2,wordPos)                   3.09e+02 3.14e+01      NA      NA  
s(measurement.no,wordLeftRightTone)          2.90e+02 9.83e+01      NA      NA  
s(f0Zscore2,wordLeftRightTone)               2.90e+02 1.14e-03      NA      NA  
s(durationZscore2,wordLeftRightTone)         2.90e+02 6.73e-03      NA      NA  
s(measurement.no,word)                       2.03e+02 7.96e+01      NA      NA  
s(f0Zscore2,word)                            2.03e+02 3.52e+01      NA      NA  
s(durationZscore2,word)                      2.03e+02 2.21e+00      NA      NA  
s(measurement.no,speaker)                    1.00e+02 5.00e+01    1.03   0.950  
s(durationZscore2,speaker)                   3.00e+02 1.52e-01    1.00   0.400  
s(f0Zscore2,speaker)                         1.00e+02 3.44e+01    1.00   0.370  
s(measurement.no,speakerPos)                 3.00e+02 4.09e+01    1.03   0.965  
s(durationZscore2,speakerPos)                9.00e+02 1.34e+02    1.00   0.360  
s(f0Zscore2,speakerPos)                      3.00e+02 4.96e+01    1.00   0.390  
s(measurement.no,speakerLeftRightTone)       5.90e+02 7.93e+01    1.03   0.970  
s(durationZscore2,speakerLeftRightTone)      1.77e+03 2.35e+02    1.00   0.435  
s(f0Zscore2,speakerLeftRightTone)            5.90e+02 7.52e+01    1.00   0.410  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

# Plotting
# 3D plot 
# png("pred2b-1.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2f, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.fem$durationZscore2, c(0.25))),
        ylim = quantile(data.ai.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25f * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0f + global_mean0f), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2f + global_mean2f, 
        zlim = c(1700,2100),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.243937 to 1.329686. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.627777955022104. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1700,2100), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
# dev.off()
# png("pred2b-2.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.model2f, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.fem$durationZscore2, c(0.5))),
        ylim = quantile(data.ai.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5f * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0f + global_mean0f), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2f + global_mean2f, 
        zlim = c(1700,2100),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.243937 to 1.329686. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.0941417149129249. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1700,2100), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
# dev.off()
# png("pred2b-3.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.model2f, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.fem$durationZscore2, c(0.75))),
        ylim = quantile(data.ai.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75f * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0f + global_mean0f), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2f + global_mean2f, 
        zlim = c(1700,2100),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.243937 to 1.329686. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.525044865601105. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1700,2100), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

# dev.off()
# Plotting
# 3D plot 
png("pred2b-4.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2f, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.fem$durationZscore2, c(0.25))),
        ylim = quantile(data.ai.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25f * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0f + global_mean0f), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2f + global_mean2f, 
        zlim = c(1700,2100),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.243937 to 1.329686. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.627777955022104. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1700,2100), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
png("pred2b-5.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2f, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.fem$durationZscore2, c(0.5))),
        ylim = quantile(data.ai.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5f * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0f + global_mean0f), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2f + global_mean2f, 
        zlim = c(1700,2100),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.243937 to 1.329686. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.0941417149129249. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1700,2100), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
png("pred2b-6.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2f, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.ai.fem$durationZscore2, c(0.75))),
        ylim = quantile(data.ai.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75f * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0f + global_mean0f), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2f + global_mean2f, 
        zlim = c(1700,2100),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.243937 to 1.329686. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.525044865601105. 
    * word : factor; set to the value(s): 在. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 在 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 在 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0130. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0130 Med. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0130 H H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1700,2100), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 

Model 2G: /au/ male, F2 as output

system.time(gamm.model2g.noAR <- bam(f2Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1), 
                          
                          
 
                      data=data.au.mas, method="fREML", discrete = TRUE, nthreads = ncores)
)
utilisateur     système      écoulé 
  36035.752     111.296    2876.619 
saveRDS(gamm.model2g.noAR, paste("Gamm_model2g_noAR.rds"))
gamm.model2g.noAR <- 
  readRDS("Gamm_model2g_noAR.rds")
r.gamm.model2g <- start_value_rho(gamm.model2g.noAR)
# Auto-regressive model

system.time(gamm.model2g <- bam(f2Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1), 
 
                        
                    
                      data=data.au.mas, method="fREML", discrete = TRUE, nthreads = ncores, rho = r.gamm.model2g, AR.start = data.au.mas$start)
)
utilisateur     système      écoulé 
  25088.441      75.113    1980.169 
saveRDS(gamm.model2g, paste("Gamm_model2g.rds"))
gamm.model2g <- 
  readRDS("Gamm_model2g.rds")
summary(gamm.model2g, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f2Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(word, bs = "re") + s(wordPos, 
    bs = "re") + s(wordLeftRightTone, bs = "re") + s(wordPos, 
    measurement.no, bs = "re") + s(wordPos, f0Zscore2, bs = "re") + 
    s(wordPos, durationZscore2, bs = "re") + s(wordLeftRightTone, 
    measurement.no, bs = "re") + s(wordLeftRightTone, f0Zscore2, 
    bs = "re") + s(wordLeftRightTone, durationZscore2, bs = "re") + 
    s(word, measurement.no, bs = "re") + s(word, f0Zscore2, bs = "re") + 
    s(word, durationZscore2, bs = "re") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1) + s(measurement.no, speakerPos, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(durationZscore2, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1) + s(durationZscore2, speakerLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1)

Parametric coefficients:
             Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.007337   0.065831  -0.111    0.911

Approximate significance of smooth terms:
                                                edf Ref.df      F  p-value    
s(measurement.no)                             6.857  7.407 50.956  < 2e-16 ***
s(f0Zscore2)                                  1.001  1.001  3.625  0.05699 .  
s(durationZscore2)                            1.000  1.000  6.844  0.00891 ** 
ti(measurement.no,f0Zscore2,durationZscore2) 64.111 88.432  1.371  0.01136 *  
ti(measurement.no,durationZscore2)           12.116 14.981  7.821  < 2e-16 ***
ti(measurement.no,f0Zscore2)                 12.808 16.209  3.462 3.87e-06 ***
ti(f0Zscore2,durationZscore2)                14.751 18.368  1.484  0.07181 .  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.768   Deviance explained = 80.9%
fREML = 7928.2  Scale est. = 0.20584   n = 9522
gam.check(gamm.model2g)


Method: fREML   Optimizer: perf chol
$grad
 [1] -1.141309e-13 -3.841662e-05 -6.293743e-05  4.643397e-12  7.320367e-12 -2.765788e-12
 [7] -9.481305e-13 -4.125589e-13  1.794120e-13  3.249845e-12 -3.369616e-11 -2.640821e-11
[13] -1.170974e-11  3.801404e-13  8.483880e-12  9.634959e-12 -4.114042e-12 -2.496847e-11
[19] -3.993250e-12 -5.382361e-12 -1.030642e-11  1.278977e-13  6.455281e-12 -4.361409e-05
[25] -2.280842e-12 -3.716393e-05 -1.524150e-10 -3.716393e-05 -2.188028e-12 -3.716393e-05
[31] -8.494538e-12 -6.433230e-05 -4.732925e-11 -6.433230e-05 -2.837908e-11 -6.433230e-05
[37] -8.242296e-12 -1.193712e-12 -4.510525e-11 -1.203038e-12 -2.599876e-11 -1.390443e-12
[43]  8.312782e-10

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]
   3.239324e+00  2.803062e-06 -1.026331e-07 -4.655971e-03 -9.861335e-03  2.215723e-03
   2.803062e-06  3.847401e-05  5.962317e-10 -2.055206e-05 -2.561212e-06  7.009368e-06
  -1.026331e-07  5.962317e-10  6.293238e-05  2.308040e-06 -2.817846e-06 -3.740611e-06
  -4.655971e-03 -2.055206e-05  2.308040e-06  3.319261e+00  2.982327e-01  4.989480e-01
  -9.861335e-03 -2.561212e-06 -2.817846e-06  2.982327e-01  2.257936e+00  6.166996e-01
   2.215723e-03  7.009368e-06 -3.740611e-06  4.989480e-01  6.166996e-01  9.645158e-01
   4.674075e-04  5.529732e-07  2.272228e-07 -1.209624e-01 -1.952613e-02  1.835863e-02
   1.018885e-02  5.475692e-06  4.871991e-06  2.421874e-01  1.502908e-01 -1.001684e-03
   9.897251e-02  1.561510e-05 -1.923879e-08 -4.852528e-02  1.930068e-02 -7.094371e-03
   1.166017e-02 -1.688647e-05  4.682951e-07 -9.901070e-02  3.460362e-02 -1.274637e-02
   2.718922e-03  2.027371e-05 -6.222980e-06 -1.059420e-01 -2.342412e-01 -5.845164e-02
  -1.330583e-03  1.740423e-05 -1.284109e-05  1.858594e-02 -3.025115e-01  2.347332e-02
   2.034268e-02  1.506556e-05  1.411397e-05  1.428543e-01  3.612044e-02  2.906467e-01
   7.999936e-03 -1.422714e-05 -1.230792e-06  3.448183e-02  8.722206e-02  7.191428e-02
   7.855587e-03  2.162046e-05 -9.116873e-07  7.716402e-02  9.254695e-02  2.333290e-01
  -1.400190e-02  3.745601e-05  1.019634e-05  3.282320e-02  3.265219e-03 -8.068774e-02
   9.642688e-03  2.224439e-05  1.119093e-06 -6.071376e-02  6.617266e-02  6.670798e-02
   1.818988e-04  1.174916e-05 -2.701533e-06 -9.309382e-03  1.054132e-01  3.295768e-02
   1.546280e-03  6.194585e-06  4.539471e-06  1.733448e-01  9.707207e-02  8.584662e-03
   3.682494e-03 -1.084039e-05 -5.422156e-07  5.353464e-02  3.134386e-02  6.493362e-02
  -2.343230e-05  3.066585e-06  1.331614e-07 -5.768927e-03  9.865061e-03 -2.067698e-03
  -6.335387e-03  2.337854e-05  5.269652e-06  4.808203e-02  1.351251e-01  2.859955e-01
   1.040901e-02  3.745908e-05  3.801050e-07 -6.311519e-02 -3.838522e-03  5.339741e-03
           [,7]          [,8]          [,9]         [,10]         [,11]         [,12]
   4.674075e-04  1.018885e-02  9.897251e-02  1.166017e-02  2.718922e-03 -1.330583e-03
   5.529732e-07  5.475692e-06  1.561510e-05 -1.688647e-05  2.027371e-05  1.740423e-05
   2.272228e-07  4.871991e-06 -1.923879e-08  4.682951e-07 -6.222980e-06 -1.284109e-05
  -1.209624e-01  2.421874e-01 -4.852528e-02 -9.901070e-02 -1.059420e-01  1.858594e-02
  -1.952613e-02  1.502908e-01  1.930068e-02  3.460362e-02 -2.342412e-01 -3.025115e-01
   1.835863e-02 -1.001684e-03 -7.094371e-03 -1.274637e-02 -5.845164e-02  2.347332e-02
   1.313680e+00  5.163769e-01 -2.089642e-02 -1.216766e-02 -5.945603e-03 -1.386949e-02
   5.163769e-01  2.276831e+00 -2.332673e-02 -1.635226e-02  1.450436e-01  1.245454e-01
  -2.089642e-02 -2.332673e-02  1.074505e+00  3.118834e-01 -2.179636e-02 -8.154970e-03
  -1.216766e-02 -1.635226e-02  3.118834e-01  1.888598e+00  1.491555e-03 -2.101002e-03
  -5.945603e-03  1.450436e-01 -2.179636e-02  1.491555e-03  1.018173e+00  1.195982e-01
  -1.386949e-02  1.245454e-01 -8.154970e-03 -2.101002e-03  1.195982e-01  8.367502e-01
   1.365251e-02  1.078804e-01  2.973563e-02  8.206079e-02  1.562365e-02  8.754933e-02
  -1.389344e-03  5.877991e-03 -1.080819e-02 -1.771091e-02  2.320134e-02 -7.321984e-02
   8.283178e-04 -1.894889e-02  1.254596e-02  6.615848e-03  5.011303e-02  3.325485e-02
   1.907175e-02 -1.676053e-01  1.798975e-02 -1.398332e-01 -7.032886e-03 -3.382396e-02
   1.706888e-02  6.069855e-02 -1.649276e-02 -6.559100e-02  6.978992e-04  7.623568e-02
  -5.993919e-03 -4.630091e-03 -4.789433e-04 -2.694208e-02  5.569214e-02  6.867418e-03
   3.171094e-02 -1.668040e-01  1.750513e-02 -2.087469e-02 -1.185052e-02  1.249112e-01
  -6.177510e-04  5.992361e-03 -1.622999e-02 -1.823780e-02  6.293489e-02  1.054980e-01
  -5.174763e-04 -3.479095e-03  2.190981e-03 -7.144739e-03 -1.939257e-03  2.172193e-03
   1.828289e-02 -7.824412e-02  1.439726e-02 -1.057301e-02  6.244597e-02  1.552664e-01
  -1.176498e-02  1.824831e-02  3.139731e-04 -7.282526e-02  8.982698e-02  1.175569e-01
          [,13]         [,14]         [,15]         [,16]         [,17]         [,18]
   2.034268e-02  7.999936e-03  7.855587e-03 -1.400190e-02  9.642688e-03  1.818988e-04
   1.506556e-05 -1.422714e-05  2.162046e-05  3.745601e-05  2.224439e-05  1.174916e-05
   1.411397e-05 -1.230792e-06 -9.116873e-07  1.019634e-05  1.119093e-06 -2.701533e-06
   1.428543e-01  3.448183e-02  7.716402e-02  3.282320e-02 -6.071376e-02 -9.309382e-03
   3.612044e-02  8.722206e-02  9.254695e-02  3.265219e-03  6.617266e-02  1.054132e-01
   2.906467e-01  7.191428e-02  2.333290e-01 -8.068774e-02  6.670798e-02  3.295768e-02
   1.365251e-02 -1.389344e-03  8.283178e-04  1.907175e-02  1.706888e-02 -5.993919e-03
   1.078804e-01  5.877991e-03 -1.894889e-02 -1.676053e-01  6.069855e-02 -4.630091e-03
   2.973563e-02 -1.080819e-02  1.254596e-02  1.798975e-02 -1.649276e-02 -4.789433e-04
   8.206079e-02 -1.771091e-02  6.615848e-03 -1.398332e-01 -6.559100e-02 -2.694208e-02
   1.562365e-02  2.320134e-02  5.011303e-02 -7.032886e-03  6.978992e-04  5.569214e-02
   8.754933e-02 -7.321984e-02  3.325485e-02 -3.382396e-02  7.623568e-02  6.867418e-03
   6.806033e+01  5.513000e+00  5.270563e+00 -3.671312e+00  9.943905e-01  1.056249e+00
   5.513000e+00  5.418338e+00  1.436004e+00 -2.431270e+00  2.771824e-01  7.497548e-01
   5.270563e+00  1.436004e+00  7.891373e+00 -5.043487e-01  7.460292e-01  8.166589e-01
  -3.671312e+00 -2.431270e+00 -5.043487e-01  3.645773e+01  6.884865e-01 -6.045563e-02
   9.943905e-01  2.771824e-01  7.460292e-01  6.884865e-01  1.111065e+01  1.498566e-01
   1.056249e+00  7.497548e-01  8.166589e-01 -6.045563e-02  1.498566e-01  3.087727e+00
  -3.596606e+00 -7.318534e-01 -3.570245e+00  7.430528e+00  1.325755e-01 -2.556191e-01
   6.318349e-01  2.565299e-01 -2.175935e-02 -1.150282e-01  2.336562e+00 -1.280794e-01
   3.938966e-02  9.195528e-02  1.561159e-02  1.887339e-02  2.606203e-02  2.988804e-01
  -6.767114e+00 -4.101492e-01 -5.039288e-01  1.167780e+01  1.680130e-01  3.763661e-02
   1.650057e+00  8.955661e-03  1.634812e-01 -3.418297e-01  3.363876e+00 -8.824409e-02
          [,19]         [,20]         [,21]         [,22]         [,23]         [,24]
   1.546280e-03  3.682494e-03 -2.343230e-05 -6.335387e-03  1.040901e-02  3.620778e-08
   6.194585e-06 -1.084039e-05  3.066585e-06  2.337854e-05  3.745908e-05  3.078347e-10
   4.539471e-06 -5.422156e-07  1.331614e-07  5.269652e-06  3.801050e-07  4.077985e-11
   1.733448e-01  5.353464e-02 -5.768927e-03  4.808203e-02 -6.311519e-02 -1.943278e-07
   9.707207e-02  3.134386e-02  9.865061e-03  1.351251e-01 -3.838522e-03  3.407026e-06
   8.584662e-03  6.493362e-02 -2.067698e-03  2.859955e-01  5.339741e-03  1.941815e-07
   3.171094e-02 -6.177510e-04 -5.174763e-04  1.828289e-02 -1.176498e-02 -6.090496e-08
  -1.668040e-01  5.992361e-03 -3.479095e-03 -7.824412e-02  1.824831e-02  2.020301e-07
   1.750513e-02 -1.622999e-02  2.190981e-03  1.439726e-02  3.139731e-04  2.863060e-07
  -2.087469e-02 -1.823780e-02 -7.144739e-03 -1.057301e-02 -7.282526e-02 -3.638717e-07
  -1.185052e-02  6.293489e-02 -1.939257e-03  6.244597e-02  8.982698e-02  2.205705e-06
   1.249112e-01  1.054980e-01  2.172193e-03  1.552664e-01  1.175569e-01 -5.127111e-08
  -3.596606e+00  6.318349e-01  3.938966e-02 -6.767114e+00  1.650057e+00  2.838380e-05
  -7.318534e-01  2.565299e-01  9.195528e-02 -4.101492e-01  8.955661e-03  1.050621e-05
  -3.570245e+00 -2.175935e-02  1.561159e-02 -5.039288e-01  1.634812e-01  9.584520e-06
   7.430528e+00 -1.150282e-01  1.887339e-02  1.167780e+01 -3.418297e-01 -9.637132e-07
   1.325755e-01  2.336562e+00  2.606203e-02  1.680130e-01  3.363876e+00  2.847775e-06
  -2.556191e-01 -1.280794e-01  2.988804e-01  3.763661e-02 -8.824409e-02  3.021544e-05
   2.844958e+01  4.151879e-01 -4.623409e-02  1.318504e+01  2.203544e-03 -2.592027e-06
   4.151879e-01  3.201967e+00 -1.214434e-02  7.204437e-02  1.586393e+00 -6.816009e-07
  -4.623409e-02 -1.214434e-02  1.863646e-01  2.458068e-02 -1.979537e-02  9.433006e-06
   1.318504e+01  7.204437e-02  2.458068e-02  2.421742e+01  3.993770e-01  2.284533e-06
   2.203544e-03  1.586393e+00 -1.979537e-02  3.993770e-01  5.685375e+00 -2.363626e-06
          [,25]         [,26]         [,27]         [,28]         [,29]         [,30]
  -9.685577e-02  3.005054e-08 -1.589186e-04  3.005054e-08  2.589768e-04  3.005054e-08
  -2.512951e-06  5.927509e-10  7.474214e-06  5.927509e-10  7.005194e-06  5.927509e-10
  -2.173012e-07 -1.346886e-10 -1.056814e-05 -1.346886e-10 -1.650155e-07 -1.346886e-10
  -7.259500e-02 -4.831440e-07 -6.792238e-03 -4.831440e-07 -5.638543e-03 -4.831440e-07
   1.467679e-02 -1.024895e-07 -2.886798e-02 -1.024895e-07 -1.410026e-03 -1.024895e-07
  -3.541286e-02  4.165546e-06 -2.757134e-02  4.165546e-06  6.014370e-03  4.165546e-06
   1.812157e-02 -2.225425e-07 -2.174313e-04 -2.225425e-07  8.338413e-04 -2.225425e-07
  -3.267900e-02 -2.445570e-07  1.063137e-02 -2.445570e-07  3.670315e-03 -2.445570e-07
  -3.256057e-02 -2.491455e-07  2.965075e-03 -2.491455e-07 -3.029114e-03 -2.491455e-07
  -7.749177e-03 -7.781771e-07 -2.420821e-02 -7.781771e-07 -4.495596e-03 -7.781771e-07
   4.620239e-02  5.451343e-07  2.027159e-02  5.451343e-07 -1.617003e-03  5.451343e-07
   2.261266e-02 -2.551712e-06 -6.151003e-03 -2.551712e-06  2.522864e-03 -2.551712e-06
  -4.554702e-04  7.605095e-06 -7.899810e-02  7.605095e-06 -9.827437e-03  7.605095e-06
  -4.504978e-02 -8.846752e-07  1.518926e-02 -8.846752e-07  6.059504e-03 -8.846752e-07
  -4.031859e-03 -3.819007e-06 -1.015480e-01 -3.819007e-06  4.327357e-03 -3.819007e-06
  -7.433937e-02 -1.496415e-05 -1.478104e-01 -1.496415e-05 -1.252884e-02 -1.496415e-05
   7.532108e-02 -2.733200e-06  5.136703e-02 -2.733200e-06 -1.185679e-02 -2.733200e-06
   8.480762e-03  5.743898e-06  4.299691e-01  5.743898e-06  3.133858e-03  5.743898e-06
  -6.063706e-02  1.286188e-05 -5.139720e-02  1.286188e-05  1.278736e-02  1.286188e-05
  -1.951910e-02 -5.250567e-06  9.235259e-02 -5.250567e-06 -3.341871e-03 -5.250567e-06
   2.865653e-03 -2.255914e-06  9.504020e-02 -2.255914e-06 -8.063697e-04 -2.255914e-06
  -7.676435e-02 -2.040872e-06 -6.330361e-03 -2.040872e-06 -1.295330e-02 -2.040872e-06
   5.663015e-02 -3.174914e-06 -9.705308e-02 -3.174914e-06 -7.608014e-03 -3.174914e-06
          [,31]         [,32]         [,33]         [,34]         [,35]         [,36]
  -2.399594e-02 -5.370128e-08  7.591378e-03 -5.370128e-08  4.014155e-03 -5.370128e-08
  -1.095698e-05  8.994257e-10  4.988482e-06  8.994257e-10  7.447891e-05  8.994257e-10
  -7.788173e-08 -2.141209e-10 -1.517430e-05 -2.141209e-10 -3.819572e-06 -2.141209e-10
   1.071179e-01 -6.547804e-07 -6.072059e-02 -6.547804e-07 -3.845532e-02 -6.547804e-07
   6.099236e-02 -1.747208e-06  1.015925e-02 -1.747208e-06 -1.665329e-02 -1.747208e-06
   2.658481e-01  3.569838e-06 -5.593690e-02  3.569838e-06  8.406758e-02  3.569838e-06
   8.683306e-03 -1.923825e-07 -3.296350e-03 -1.923825e-07  4.250631e-02 -1.923825e-07
   4.390346e-03  9.283889e-07  5.471059e-02  9.283889e-07  9.096991e-03  9.283889e-07
  -2.518079e-02  5.240570e-07  7.251065e-03  5.240570e-07 -4.513590e-02  5.240570e-07
  -1.360236e-02 -2.977474e-06 -4.228874e-02 -2.977474e-06 -6.824874e-02 -2.977474e-06
  -1.326625e-02  4.268984e-06  7.554551e-02  4.268984e-06  7.760056e-02  4.268984e-06
   9.512365e-02  2.983049e-06  6.295328e-02  2.983049e-06  1.759578e-01  2.983049e-06
   2.444763e-01 -4.213360e-06  5.171391e-01 -4.213360e-06 -4.513175e-01 -4.213360e-06
   2.956199e-02 -2.772122e-05  3.575002e-01 -2.772122e-05 -2.914186e-01 -2.772122e-05
  -4.756851e-02  2.383848e-05 -7.572409e-03  2.383848e-05  2.384651e-01  2.383848e-05
  -2.000054e-01 -5.655520e-05  4.145791e-01 -5.655520e-05 -4.082250e-01 -5.655520e-05
  -6.690333e-02 -8.812674e-06 -5.870370e-02 -8.812674e-06 -1.209799e+00 -8.812674e-06
   8.844048e-02  9.103638e-06  6.246060e-01  9.103638e-06  1.282953e-01  9.103638e-06
  -2.921554e-01 -1.071737e-05 -2.702772e-01 -1.071737e-05  2.915477e-01 -1.071737e-05
  -2.844092e-02  3.894293e-06 -2.869911e-01  3.894293e-06 -2.329327e-01  3.894293e-06
   3.505500e-02 -1.140261e-05  1.300857e-01 -1.140261e-05  2.433661e-02 -1.140261e-05
  -2.091751e-01 -1.673767e-05  6.633227e-02 -1.673767e-05  6.797890e-02 -1.673767e-05
  -3.901309e-02  1.862357e-05 -2.931420e-01  1.862357e-05 -1.486983e-01  1.862357e-05
          [,37]         [,38]         [,39]         [,40]         [,41]         [,42]
   5.148202e-03  2.227418e-03 -3.520200e-03  2.227418e-03 -2.896279e-03  2.227418e-03
  -2.007979e-05  2.584984e-06  3.337298e-05  2.584984e-06 -2.199942e-05  2.584984e-06
  -1.547831e-06 -1.391614e-06 -6.480514e-06 -1.391614e-06 -3.158484e-07 -1.391614e-06
   3.330571e-01  9.366132e-04  9.359706e-03  9.366132e-04  2.154394e-02  9.366132e-04
   8.137558e-02  8.994266e-03  2.307253e-01  8.994266e-03 -1.004802e-01  8.994266e-03
  -1.587983e-01  3.839453e-03  1.617428e-02  3.839453e-03  3.931150e-01  3.839453e-03
  -5.640048e-03  9.295586e-04 -8.900323e-03  9.295586e-04 -4.664057e-03  9.295586e-04
  -6.229886e-02 -4.133885e-03  3.383276e-02 -4.133885e-03  6.653201e-02 -4.133885e-03
  -8.170712e-02  4.813851e-04  2.330849e-02  4.813851e-04  1.740057e-02  4.813851e-04
   7.111882e-02 -9.192905e-03 -5.669800e-02 -9.192905e-03  2.471772e-02 -9.192905e-03
   9.235468e-02  1.158516e-04  7.365949e-02  1.158516e-04  6.458454e-02  1.158516e-04
   2.162964e-02 -4.297287e-03 -1.322587e-01 -4.297287e-03  1.315309e-01 -4.297287e-03
   1.026749e+00  1.253306e-01  1.227346e+00  1.253306e-01  2.967928e-01  1.253306e-01
   1.344217e-01 -4.758047e-02  1.065684e+00 -4.758047e-02  8.218931e-02 -4.758047e-02
   1.034430e+00  5.055142e-02  2.968229e-01  5.055142e-02  5.457636e-01  5.055142e-02
   5.826416e-01 -1.074587e-01  2.061789e-01 -1.074587e-01 -4.650944e-01 -1.074587e-01
   1.457277e-01  6.749625e-02  4.043666e-01  6.749625e-02 -8.500097e-01  6.749625e-02
   7.036980e-02 -3.700545e-02  1.642709e+00 -3.700545e-02  9.810573e-02 -3.700545e-02
   6.568612e-01 -3.725213e-02 -4.530174e-01 -3.725213e-02 -5.731572e-01 -3.725213e-02
   4.291094e-02  8.098445e-03  1.816126e-01  8.098445e-03 -1.972566e-02  8.098445e-03
   4.224093e-02  2.712163e-03  3.576262e-01  2.712163e-03 -3.615675e-02  2.712163e-03
   7.746138e-01 -3.269082e-02 -3.546063e-02 -3.269082e-02 -2.544120e-01 -3.269082e-02
   1.527755e-01 -2.370720e-02 -2.402400e-01 -2.370720e-02 -2.841807e-01 -2.370720e-02
          [,43]
  -2.928429e+00
  -2.481696e-04
  -2.791521e-05
  -1.260142e+01
  -9.395528e+00
  -9.558610e+00
  -2.106781e+00
  -3.451444e+00
  -2.488524e+00
  -3.415491e+00
  -3.126158e+00
  -3.749263e+00
  -9.927052e+01
  -2.733273e+01
  -2.639402e+01
  -8.045167e+01
  -4.508928e+01
  -1.742303e+01
  -6.895053e+01
  -1.845467e+01
  -2.736019e+00
  -6.038322e+01
  -2.666874e+01
 [ getOption("max.print") est atteint -- 20 lignes omises ]

Model rank =  10417 / 10417 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                   k'      edf k-index p-value    
s(measurement.no)                            9.00e+00 6.86e+00    0.99    0.25    
s(f0Zscore2)                                 9.00e+00 1.00e+00    1.01    0.82    
s(durationZscore2)                           2.90e+01 1.00e+00    1.05    1.00    
ti(measurement.no,f0Zscore2,durationZscore2) 3.08e+02 6.41e+01    0.96  <2e-16 ***
ti(measurement.no,durationZscore2)           4.40e+01 1.21e+01    1.00    0.51    
ti(measurement.no,f0Zscore2)                 2.80e+01 1.28e+01    0.99    0.30    
ti(f0Zscore2,durationZscore2)                7.70e+01 1.48e+01    0.99    0.27    
s(word)                                      3.19e+02 1.99e+02      NA      NA    
s(wordPos)                                   4.66e+02 5.47e+01      NA      NA    
s(wordLeftRightTone)                         4.43e+02 5.28e+01      NA      NA    
s(measurement.no,wordPos)                    4.66e+02 1.61e+02      NA      NA    
s(f0Zscore2,wordPos)                         4.66e+02 9.02e+01      NA      NA    
s(durationZscore2,wordPos)                   4.66e+02 3.48e+01      NA      NA    
s(measurement.no,wordLeftRightTone)          4.43e+02 1.38e+02      NA      NA    
s(f0Zscore2,wordLeftRightTone)               4.43e+02 3.69e+01      NA      NA    
s(durationZscore2,wordLeftRightTone)         4.43e+02 5.47e+00      NA      NA    
s(measurement.no,word)                       3.19e+02 1.21e+02      NA      NA    
s(f0Zscore2,word)                            3.19e+02 5.33e+01      NA      NA    
s(durationZscore2,word)                      3.19e+02 6.72e-04      NA      NA    
s(measurement.no,speaker)                    1.00e+02 2.69e+01    0.99    0.22    
s(durationZscore2,speaker)                   3.00e+02 2.12e+01    1.05    1.00    
s(f0Zscore2,speaker)                         1.00e+02 2.27e+00    1.01    0.88    
s(measurement.no,speakerPos)                 3.00e+02 3.97e+01    0.99    0.30    
s(durationZscore2,speakerPos)                9.00e+02 8.71e+01    1.05    1.00    
s(f0Zscore2,speakerPos)                      3.00e+02 7.66e+01    1.01    0.82    
s(measurement.no,speakerLeftRightTone)       6.00e+02 1.54e+02    0.99    0.30    
s(durationZscore2,speakerLeftRightTone)      1.80e+03 1.01e+02    1.05    1.00    
s(f0Zscore2,speakerLeftRightTone)            6.00e+02 1.19e+02    1.01    0.85    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

# 3D plotting

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2g, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.mas$durationZscore2, c(0.25))),
        ylim = quantile(data.au.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25au * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0au + global_mean0au), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2au + global_mean2au, 
        zlim = c(1000, 1400),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.253736 to 1.355745. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.680380067515762. 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1000, 1400), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.model2g, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2. = quantile(data.au.mas$durationZscore2, c(0.5))),
        ylim = quantile(data.au.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5au * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0au + global_mean0au), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2au + global_mean2au, 
        zlim = c(1000, 1400),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.253736 to 1.355745. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.0990769355270091. 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1000, 1400), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.model2g, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.mas$durationZscore2, c(0.75))),
        ylim = quantile(data.au.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75au * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0au + global_mean0au),
        transform = function(f2Zscore2) f2Zscore2 * global_sd2au + global_mean2au, 
        zlim = c(1000, 1400),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.253736 to 1.355745. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.530017553918074. 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1000, 1400), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

NA
NA
NA
# 3D plotting
 png("pred2b-7.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2g, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.mas$durationZscore2, c(0.25))),
        ylim = quantile(data.au.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25au * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0au + global_mean0au), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2au + global_mean2au, 
        zlim = c(1000, 1400),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.253736 to 1.355745. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.680380067515762. 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1000, 1400), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
png("pred2b-8.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2g, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2. = quantile(data.au.mas$durationZscore2, c(0.5))),
        ylim = quantile(data.au.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5au * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0au + global_mean0au), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2au + global_mean2au, 
        zlim = c(1000, 1400),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.253736 to 1.355745. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.0990769355270091. 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1000, 1400), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
png("pred2b-9.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2g, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.mas$durationZscore2, c(0.75))),
        ylim = quantile(data.au.mas$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75au * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0au + global_mean0au),
        transform = function(f2Zscore2) f2Zscore2 * global_sd2au + global_mean2au, 
        zlim = c(1000, 1400),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.253736 to 1.355745. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.530017553918074. 
    * word : factor; set to the value(s): 到. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 到 Med. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 到 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0005. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0004 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0005 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1000, 1400), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 

Model 2H: /au/ female, F2 as output

system.time(gamm.model2h.noAR <- bam(f2Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1), 
                          
                          
 
                      data=data.au.fem, method="fREML", discrete = TRUE, nthreads = ncores)
)
utilisateur     système      écoulé 
  30045.140     430.795    2478.440 
saveRDS(gamm.model2h.noAR, paste("Gamm_model2h_noAR.rds"))
gamm.model2h.noAR <- 
  readRDS("Gamm_model2h_noAR.rds")
r.gamm.model2h <- start_value_rho(gamm.model2h.noAR)
# Auto-regressive model

system.time(gamm.model2h <- bam(f2Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1), 
 
                        
                    
                      data=data.au.fem, method="fREML", discrete = TRUE, nthreads = ncores, rho = r.gamm.model2h, AR.start = data.au.fem$start)
)
utilisateur     système      écoulé 
  26716.559     116.962    2083.219 
saveRDS(gamm.model2h, paste("Gamm_model2h.rds"))
gamm.model2h <- 
  readRDS("Gamm_model2h.rds")
summary(gamm.model2h, re.test = FALSE)

Family: gaussian 
Link function: identity 

Formula:
f2Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(word, bs = "re") + s(wordPos, 
    bs = "re") + s(wordLeftRightTone, bs = "re") + s(wordPos, 
    measurement.no, bs = "re") + s(wordPos, f0Zscore2, bs = "re") + 
    s(wordPos, durationZscore2, bs = "re") + s(wordLeftRightTone, 
    measurement.no, bs = "re") + s(wordLeftRightTone, f0Zscore2, 
    bs = "re") + s(wordLeftRightTone, durationZscore2, bs = "re") + 
    s(word, measurement.no, bs = "re") + s(word, f0Zscore2, bs = "re") + 
    s(word, durationZscore2, bs = "re") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1) + s(measurement.no, speakerPos, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(durationZscore2, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1) + s(durationZscore2, speakerLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1)

Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)
(Intercept)  0.02958    0.06649   0.445    0.656

Approximate significance of smooth terms:
                                                edf Ref.df      F  p-value    
s(measurement.no)                             7.016  7.459 46.999  < 2e-16 ***
s(f0Zscore2)                                  1.000  1.000 18.340 1.88e-05 ***
s(durationZscore2)                            2.747  2.940  1.431   0.2266    
ti(measurement.no,f0Zscore2,durationZscore2) 44.074 64.013  1.320   0.0448 *  
ti(measurement.no,durationZscore2)            7.952 10.232  3.701 5.19e-05 ***
ti(measurement.no,f0Zscore2)                 10.475 13.895  3.465 1.27e-05 ***
ti(f0Zscore2,durationZscore2)                10.158 13.317  1.485   0.1155    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =   0.75   Deviance explained = 79.1%
fREML = 7659.6  Scale est. = 0.22268   n = 9332
gam.check(gamm.model2h)


Method: fREML   Optimizer: perf chol
$grad
 [1] -3.074910e-08 -3.637654e-05 -1.926216e-06  8.731321e-08  3.519330e-07 -8.500149e-08  1.447793e-08 -7.361485e-08 -1.978111e-08
[10] -1.164051e-07  2.246844e-07 -1.259442e-07 -8.593502e-06 -2.606808e-07 -2.164774e-06  3.054713e-06 -5.065912e-08 -7.266396e-06
[19]  2.538665e-06  5.390557e-07 -1.111610e-06  5.055001e-07  8.653278e-07 -3.596819e-05  1.793014e-08 -5.266526e-05 -9.189334e-05
[28] -5.266526e-05 -5.119083e-05 -5.266526e-05 -7.936636e-07 -1.264994e-07 -8.526895e-06 -1.264992e-07  1.628905e-07 -1.264992e-07
[37]  6.869135e-07  6.390165e-07 -9.524021e-06  6.390161e-07  8.489512e-07  6.390161e-07  1.255051e-04

$hess
           [,1]          [,2]          [,3]          [,4]          [,5]          [,6]          [,7]          [,8]          [,9]
   2.819424e+00  1.975733e-07 -5.044593e-04 -5.631152e-03 -1.513664e-03 -3.909292e-03  2.621727e-03  6.175609e-03  8.126456e-03
   1.975733e-07  3.637545e-05  6.591230e-07  3.903702e-07 -1.670656e-06  4.570402e-07 -3.047568e-07 -7.420139e-08  1.305448e-07
  -5.044593e-04  6.591230e-07  4.846326e-01  1.440748e-02 -1.413005e-03 -2.473398e-02  2.595891e-03  1.236304e-02  8.393302e-04
  -5.631152e-03  3.903702e-07  1.440748e-02  2.054033e+00  4.262546e-01 -3.981307e-01  9.272292e-02  8.893814e-02 -1.253374e-03
  -1.513664e-03 -1.670656e-06 -1.413005e-03  4.262546e-01  1.432052e+00  5.436040e-01 -3.408242e-02 -9.470631e-02 -1.888229e-02
  -3.909292e-03  4.570402e-07 -2.473398e-02 -3.981307e-01  5.436040e-01  1.109710e+00 -1.984474e-03 -3.083361e-02 -4.001879e-02
   2.621727e-03 -3.047568e-07  2.595891e-03  9.272292e-02 -3.408242e-02 -1.984474e-03  1.049566e+00  9.777025e-02  5.894589e-03
   6.175609e-03 -7.420139e-08  1.236304e-02  8.893814e-02 -9.470631e-02 -3.083361e-02  9.777025e-02  1.160625e+00 -2.477564e-02
   8.126456e-03  1.305448e-07  8.393302e-04 -1.253374e-03 -1.888229e-02 -4.001879e-02  5.894589e-03 -2.477564e-02  1.157033e+00
  -2.650389e-03  1.529856e-06 -5.631072e-03 -1.562645e-02 -2.365951e-02 -5.479513e-02  7.998057e-03 -4.738889e-03  3.506961e-01
  -2.485612e-03  1.015333e-06 -4.559181e-02  4.439917e-02 -8.252614e-02 -1.006966e-02 -1.668288e-03  3.382310e-02  2.130685e-03
  -1.262873e-03  1.344682e-06 -9.812693e-03 -1.575377e-03  3.545358e-02 -2.081622e-02 -1.096051e-03  1.904333e-02  1.015311e-02
   1.068930e-02  1.288450e-06  8.551100e-02  1.884414e-03 -2.680559e-04  1.245235e-01  1.065589e-02  1.541097e-02  5.340898e-06
  -7.008830e-04 -9.181646e-07 -4.617555e-03 -1.011517e-03  8.043250e-04 -2.499413e-02 -4.826454e-03 -2.507136e-03  2.420797e-04
   4.768416e-03 -1.940081e-06 -3.117701e-02  2.111386e-02 -3.534657e-02  4.454078e-02 -2.386113e-03  1.205165e-02  1.073177e-03
   6.844733e-04 -3.574772e-06 -8.102747e-02  3.033297e-02 -2.682510e-01 -6.197571e-02  3.365899e-02  1.504440e-01 -1.494562e-02
   3.430893e-03  2.447680e-06  1.483707e-02 -2.498008e-02 -3.057494e-02  1.007059e-02  1.478827e-02  4.395746e-02 -4.920250e-03
   4.350886e-03  1.253294e-06  1.724080e-01 -2.539813e-02 -5.984789e-02 -2.870816e-02 -9.985796e-04 -1.278485e-02 -7.911921e-03
   1.720913e-02 -2.726290e-06 -7.500690e-02  3.284903e-02 -8.329645e-02  9.175296e-03  1.686579e-02  2.378991e-02  2.137647e-02
   6.873664e-03  5.752131e-08 -5.406769e-03  1.369049e-02 -9.555065e-02  3.118958e-02  8.482350e-03 -1.725988e-03  3.512805e-02
  -2.975196e-05  1.057280e-07 -8.102377e-03 -2.891052e-03 -2.301823e-02 -2.095578e-02  2.284902e-04  3.077600e-03 -7.191830e-03
   7.809524e-03  1.022572e-06 -1.246575e-02 -5.332421e-03 -2.493703e-02  1.235061e-01  1.720188e-02  6.599437e-02  2.427246e-02
   1.264045e-02  4.442951e-06  2.283823e-02 -3.326595e-02 -3.505791e-02 -2.382100e-02  4.569288e-03  8.895433e-03  3.444666e-03
          [,10]         [,11]         [,12]         [,13]         [,14]         [,15]         [,16]         [,17]         [,18]
  -2.650389e-03 -2.485612e-03 -1.262873e-03  1.068930e-02 -7.008830e-04  4.768416e-03  6.844733e-04  3.430893e-03  4.350886e-03
   1.529856e-06  1.015333e-06  1.344682e-06  1.288450e-06 -9.181646e-07 -1.940081e-06 -3.574772e-06  2.447680e-06  1.253294e-06
  -5.631072e-03 -4.559181e-02 -9.812693e-03  8.551100e-02 -4.617555e-03 -3.117701e-02 -8.102747e-02  1.483707e-02  1.724080e-01
  -1.562645e-02  4.439917e-02 -1.575377e-03  1.884414e-03 -1.011517e-03  2.111386e-02  3.033297e-02 -2.498008e-02 -2.539813e-02
  -2.365951e-02 -8.252614e-02  3.545358e-02 -2.680559e-04  8.043250e-04 -3.534657e-02 -2.682510e-01 -3.057494e-02 -5.984789e-02
  -5.479513e-02 -1.006966e-02 -2.081622e-02  1.245235e-01 -2.499413e-02  4.454078e-02 -6.197571e-02  1.007059e-02 -2.870816e-02
   7.998057e-03 -1.668288e-03 -1.096051e-03  1.065589e-02 -4.826454e-03 -2.386113e-03  3.365899e-02  1.478827e-02 -9.985796e-04
  -4.738889e-03  3.382310e-02  1.904333e-02  1.541097e-02 -2.507136e-03  1.205165e-02  1.504440e-01  4.395746e-02 -1.278485e-02
   3.506961e-01  2.130685e-03  1.015311e-02  5.340898e-06  2.420797e-04  1.073177e-03 -1.494562e-02 -4.920250e-03 -7.911921e-03
   1.231807e+00 -4.156099e-03  2.782802e-03 -8.552269e-02  1.782634e-02  1.788545e-02  3.168668e-02  4.862505e-03  5.717694e-02
  -4.156099e-03  5.653481e-01  1.627182e-01  5.353121e-02  9.585895e-03  1.838587e-02  5.554201e-02  6.203627e-02 -1.885412e-02
   2.782802e-03  1.627182e-01  3.662550e-01  1.583657e-02 -5.563460e-03  1.454397e-02 -2.733056e-02  3.618136e-02  5.452826e-03
  -8.552269e-02  5.353121e-02  1.583657e-02  9.532817e+01  1.159283e+00  2.729884e+00 -2.582184e+00  9.579803e-01  9.737487e-01
   1.782634e-02  9.585895e-03 -5.563460e-03  1.159283e+00  8.605487e-01  1.376037e-02 -6.646631e-01  5.448329e-02  1.958641e-01
   1.788545e-02  1.838587e-02  1.454397e-02  2.729884e+00  1.376037e-02  4.254433e+00 -2.032106e-01  1.104507e-01  1.488388e-02
   3.168668e-02  5.554201e-02 -2.733056e-02 -2.582184e+00 -6.646631e-01 -2.032106e-01  2.696057e+01  1.797286e-01 -1.265438e-01
   4.862505e-03  6.203627e-02  3.618136e-02  9.579803e-01  5.448329e-02  1.104507e-01  1.797286e-01  2.387628e+00  1.487298e-01
   5.717694e-02 -1.885412e-02  5.452826e-03  9.737487e-01  1.958641e-01  1.488388e-02 -1.265438e-01  1.487298e-01  6.205983e+00
   7.266276e-02  2.513867e-02 -7.133297e-02 -3.571490e+00 -1.397834e-01 -1.891429e+00  3.629879e+00  2.529213e-01 -9.104243e-02
  -1.486265e-02  5.303797e-03 -6.769704e-03  1.359818e+00 -7.354154e-04  5.418453e-01  2.955080e-01  8.245805e-01  1.353841e-01
   6.849000e-03  1.727120e-02 -1.984697e-03  8.569469e-02  3.286764e-03  1.280204e-01 -1.005901e-01 -2.968785e-02  1.772153e-01
   9.383882e-02 -2.243555e-02 -1.090489e-01 -1.062575e+01 -1.333027e-01 -3.232221e-01  9.235006e+00  3.781154e-01 -5.005522e-02
   9.787549e-03  2.152005e-02  3.134963e-02  1.357363e+00 -5.409543e-02 -7.738760e-02  9.202124e-02  7.785550e-01  7.191291e-03
          [,19]         [,20]         [,21]         [,22]         [,23]         [,24]         [,25]         [,26]         [,27]
   1.720913e-02  6.873664e-03 -2.975196e-05  7.809524e-03  1.264045e-02  3.074934e-08  3.588458e-02 -2.508458e-08  4.697637e-08
  -2.726290e-06  5.752131e-08  1.057280e-07  1.022572e-06  4.442951e-06  5.792196e-13  7.052742e-07  1.505323e-11  2.953145e-12
  -7.500690e-02 -5.406769e-03 -8.102377e-03 -1.246575e-02  2.283823e-02  1.926306e-06  1.271737e-02  8.081794e-08  5.762046e-07
   3.284903e-02  1.369049e-02 -2.891052e-03 -5.332421e-03 -3.326595e-02 -8.731664e-08 -2.217246e-02 -5.900148e-07 -2.547591e-07
  -8.329645e-02 -9.555065e-02 -2.301823e-02 -2.493703e-02 -3.505791e-02 -3.519584e-07  4.059962e-02  4.198513e-07  1.373846e-06
   9.175296e-03  3.118958e-02 -2.095578e-02  1.235061e-01 -2.382100e-02  8.500759e-08  1.344333e-02 -2.460753e-07 -2.279234e-07
   1.686579e-02  8.482350e-03  2.284902e-04  1.720188e-02  4.569288e-03 -1.447795e-08 -4.166032e-04 -1.028120e-07 -5.865910e-08
   2.378991e-02 -1.725988e-03  3.077600e-03  6.599437e-02  8.895433e-03  7.361880e-08  1.875136e-02 -3.527128e-07  5.248041e-08
   2.137647e-02  3.512805e-02 -7.191830e-03  2.427246e-02  3.444666e-03  1.978116e-08 -7.246660e-03  4.431183e-07 -7.861414e-08
   7.266276e-02 -1.486265e-02  6.849000e-03  9.383882e-02  9.787549e-03  1.164080e-07 -5.412549e-02  5.610589e-07 -3.194195e-07
   2.513867e-02  5.303797e-03  1.727120e-02 -2.243555e-02  2.152005e-02 -2.246878e-07  1.005856e-02 -8.620661e-09  1.003541e-07
  -7.133297e-02 -6.769704e-03 -1.984697e-03 -1.090489e-01  3.134963e-02  1.259547e-07  3.021037e-02 -9.225252e-08  1.529198e-06
  -3.571490e+00  1.359818e+00  8.569469e-02 -1.062575e+01  1.357363e+00  8.593545e-06 -4.974897e-02 -1.362393e-05 -2.032699e-06
  -1.397834e-01 -7.354154e-04  3.286764e-03 -1.333027e-01 -5.409543e-02  2.607067e-07 -2.045405e-02 -1.601093e-07  5.530161e-08
  -1.891429e+00  5.418453e-01  1.280204e-01 -3.232221e-01 -7.738760e-02  2.164875e-06  2.447375e-02 -2.408077e-06  2.317339e-06
   3.629879e+00  2.955080e-01 -1.005901e-01  9.235006e+00  9.202124e-02 -3.054712e-06 -6.676429e-02 -1.006258e-05  4.909891e-06
   2.529213e-01  8.245805e-01 -2.968785e-02  3.781154e-01  7.785550e-01  5.065245e-08 -2.878445e-02 -4.915216e-07 -4.513529e-06
  -9.104243e-02  1.353841e-01  1.772153e-01 -5.005522e-02  7.191291e-03  7.266795e-06  1.753752e-02 -5.926389e-06  1.265415e-05
   2.332215e+01  3.107489e-01 -1.128063e-01  1.261222e+01  1.277453e-01 -2.538719e-06  8.082005e-02 -1.816275e-06 -6.326317e-07
   3.107489e-01  4.090426e+00  1.370523e-02  5.775857e-01  2.338613e+00 -5.390432e-07 -5.938887e-02  1.875689e-06 -4.537754e-06
  -1.128063e-01  1.370523e-02  4.917012e-01  3.557994e-02 -4.481486e-02  1.111718e-06 -4.973360e-03  1.668509e-06  2.694233e-06
   1.261222e+01  5.775857e-01  3.557994e-02  4.431741e+01  4.530376e-01 -5.054967e-07  2.601711e-02 -2.848169e-06  8.562242e-07
   1.277453e-01  2.338613e+00 -4.481486e-02  4.530376e-01  4.253574e+00 -8.653623e-07 -3.163808e-02  1.111932e-06 -3.017403e-06
          [,28]         [,29]         [,30]         [,31]         [,32]         [,33]         [,34]         [,35]         [,36]
  -2.508458e-08  2.743084e-07 -2.508458e-08 -8.053098e-03 -8.129788e-04  4.001749e-03 -8.129788e-04  2.170559e-02 -8.129788e-04
   1.505323e-11 -2.506059e-10  1.505323e-11  1.698083e-06  2.938664e-07  2.021162e-06  2.938664e-07 -2.420987e-06  2.938664e-07
   8.081794e-08 -5.727225e-08  8.081794e-08  1.425529e-03 -3.689326e-03  1.638905e-02 -3.689326e-03  2.647542e-02 -3.689326e-03
  -5.900148e-07  2.742507e-07 -5.900148e-07 -1.671713e-02 -2.799412e-03 -2.496519e-02 -2.799412e-03  5.294025e-02 -2.799412e-03
   4.198513e-07  9.122447e-07  4.198513e-07 -2.225649e-01 -2.131032e-03  1.226465e-01 -2.131032e-03  6.385028e-02 -2.131032e-03
  -2.460753e-07  1.267931e-07 -2.460753e-07 -1.227609e-01 -4.913595e-03  9.357818e-02 -4.913595e-03  5.718397e-02 -4.913595e-03
  -1.028120e-07 -7.417703e-08 -1.028120e-07  2.719154e-02 -1.606171e-03  9.470349e-03 -1.606171e-03 -5.844918e-03 -1.606171e-03
  -3.527128e-07 -4.213924e-07 -3.527128e-07  6.568632e-02 -3.382337e-03 -9.908717e-03 -3.382337e-03 -5.642824e-04 -3.382337e-03
   4.431183e-07  6.265722e-08  4.431183e-07  2.137583e-02 -9.942360e-05 -8.760373e-03 -9.942360e-05 -1.228065e-02 -9.942360e-05
   5.610589e-07  2.311681e-06  5.610589e-07  1.092460e-01  2.573831e-03 -4.612746e-02  2.573831e-03  2.479807e-02  2.573831e-03
  -8.620661e-09  1.647046e-06 -8.620661e-09 -3.176823e-02  2.516344e-03 -2.499194e-02  2.516344e-03 -4.415464e-02  2.516344e-03
  -9.225252e-08  7.928882e-07 -9.225252e-08  6.863965e-03 -3.452722e-03  4.132484e-02 -3.452722e-03 -1.327237e-02 -3.452722e-03
  -1.362393e-05  6.605262e-06 -1.362393e-05 -1.455880e-02  1.600981e-03  3.369748e-01  1.600981e-03  2.824254e-01  1.600981e-03
  -1.601093e-07  7.238926e-07 -1.601093e-07  6.995670e-02  4.065931e-02 -8.040474e-02  4.065931e-02  1.008048e-01  4.065931e-02
  -2.408077e-06 -1.526777e-06 -2.408077e-06  1.773895e-01 -7.932988e-03  7.663906e-02 -7.932988e-03  5.381333e-02 -7.932988e-03
  -1.006258e-05  7.234513e-07 -1.006258e-05 -6.567712e-02  5.067282e-02 -2.340469e-01  5.067282e-02 -7.920297e-02  5.067282e-02
  -4.915216e-07 -1.434811e-06 -4.915216e-07  2.125414e-01  4.614732e-02 -2.383347e-01  4.614732e-02  1.050468e-01  4.614732e-02
  -5.926389e-06 -8.621177e-07 -5.926389e-06  4.128853e-02  1.902874e-03  7.173894e-01  1.902874e-03 -1.521050e-01  1.902874e-03
  -1.816275e-06  4.717240e-07 -1.816275e-06  1.158878e-01 -2.284823e-02 -2.783243e-01 -2.284823e-02 -1.912606e-01 -2.284823e-02
   1.875689e-06 -3.340943e-06  1.875689e-06  1.494499e-01  4.257272e-02 -1.919136e-01  4.257272e-02 -1.362592e-01  4.257272e-02
   1.668509e-06  7.165533e-07  1.668509e-06  3.421037e-02  8.195610e-03  3.196802e-01  8.195610e-03  2.859951e-02  8.195610e-03
  -2.848169e-06 -2.588466e-06 -2.848169e-06 -2.410011e-01 -1.170660e-02  1.551580e-01 -1.170660e-02  1.573606e-01 -1.170660e-02
   1.111932e-06 -3.944206e-06  1.111932e-06  1.457111e-01  8.870324e-03 -2.419463e-01  8.870324e-03 -1.025036e-01  8.870324e-03
          [,37]         [,38]         [,39]         [,40]         [,41]         [,42]         [,43]
   2.340287e-01  1.228208e-03  1.096829e-03  1.228208e-03  3.049599e-03  1.228208e-03 -3.008122e+00
   3.730144e-06 -7.206708e-08 -5.140740e-07 -7.206708e-08 -7.304814e-06 -7.206708e-08 -1.590408e-05
   4.510049e-03  6.439098e-03  3.800150e-03  6.439097e-03 -1.130751e-02  6.439097e-03 -8.736206e-01
  -2.298055e-01  5.350235e-03 -3.033569e-02  5.350235e-03  9.282911e-02  5.350235e-03 -7.609427e+00
  -5.671756e-02 -8.387322e-03  1.370793e-01 -8.387322e-03  1.233666e-01 -8.387322e-03 -7.682242e+00
  -3.136047e-02 -6.779332e-03 -5.667970e-03 -6.779332e-03 -1.241342e-02 -6.779332e-03 -6.245128e+00
  -2.750198e-02 -2.805922e-03 -6.347909e-04 -2.805922e-03  1.528363e-02 -2.805922e-03 -1.398333e+00
   3.818146e-03 -5.715117e-03 -2.314074e-02 -5.715117e-03  6.060386e-02 -5.715117e-03 -2.077802e+00
  -6.986677e-02  6.579260e-03  1.173925e-02  6.579260e-03 -2.512929e-03  6.579260e-03 -2.012613e+00
   2.325560e-02  9.445433e-03  3.445615e-03  9.445433e-03 -5.200756e-02  9.445433e-03 -2.724800e+00
   4.976281e-02  4.534995e-03 -6.956691e-02  4.534995e-03  1.600365e-01  4.534995e-03 -2.207852e+00
   1.883068e-02 -5.861526e-04 -3.703327e-02 -5.861526e-04  2.711922e-02 -5.861526e-04 -2.371234e+00
   7.006119e-01 -4.929979e-02  3.685132e-01 -4.929979e-02  2.336671e-01 -4.929979e-02 -1.191207e+02
   6.367663e-02 -2.404868e-02 -1.633596e-01 -2.404868e-02 -7.050540e-03 -2.404868e-02 -7.828701e+00
   8.556506e-01 -1.484905e-02  1.215262e-01 -1.484905e-02  1.147344e-01 -1.484905e-02 -1.431609e+01
   4.999794e-01 -1.494489e-02  8.061140e-02 -1.494489e-02 -8.398972e-02 -1.494489e-02 -6.177537e+01
  -8.928093e-02  2.464974e-03  2.408658e-01  2.464974e-03  6.967515e-02  2.464974e-03 -1.772666e+01
   1.184449e-01 -3.120488e-02  1.576090e+00 -3.120488e-02 -8.333710e-03 -3.120488e-02 -2.086273e+01
   2.841656e+00 -1.872214e-01 -2.425895e-01 -1.872214e-01  4.712206e-01 -1.872214e-01 -5.638581e+01
   2.341577e-01  2.640634e-02  6.830314e-02  2.640634e-02  2.414055e-01  2.640634e-02 -2.557334e+01
   4.106050e-02  3.054109e-02  1.492015e-01  3.054109e-02  4.087710e-02  3.054109e-02 -4.275921e+00
   1.736595e+00  3.102809e-03  1.695624e-01  3.102808e-03  6.970199e-03  3.102808e-03 -7.901454e+01
   2.710713e-01  3.752186e-02 -3.349090e-02  3.752186e-02  8.262086e-02  3.752186e-02 -2.211411e+01
 [ getOption("max.print") est atteint -- 20 lignes omises ]

Model rank =  10181 / 10181 

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                                                   k'      edf k-index p-value  
s(measurement.no)                            9.00e+00 7.02e+00    0.98   0.075 .
s(f0Zscore2)                                 9.00e+00 1.00e+00    0.99   0.165  
s(durationZscore2)                           2.90e+01 2.75e+00    1.04   0.995  
ti(measurement.no,f0Zscore2,durationZscore2) 3.08e+02 4.41e+01    1.00   0.525  
ti(measurement.no,durationZscore2)           4.40e+01 7.95e+00    1.03   0.975  
ti(measurement.no,f0Zscore2)                 2.80e+01 1.05e+01    1.01   0.660  
ti(f0Zscore2,durationZscore2)                7.70e+01 1.02e+01    0.97   0.095 .
s(word)                                      3.10e+02 2.38e+02      NA      NA  
s(wordPos)                                   4.62e+02 1.57e+01      NA      NA  
s(wordLeftRightTone)                         4.22e+02 2.86e+01      NA      NA  
s(measurement.no,wordPos)                    4.62e+02 1.24e+02      NA      NA  
s(f0Zscore2,wordPos)                         4.62e+02 3.55e+01      NA      NA  
s(durationZscore2,wordPos)                   4.62e+02 4.17e+01      NA      NA  
s(measurement.no,wordLeftRightTone)          4.22e+02 1.13e+02      NA      NA  
s(f0Zscore2,wordLeftRightTone)               4.22e+02 5.11e+01      NA      NA  
s(durationZscore2,wordLeftRightTone)         4.22e+02 8.55e+00      NA      NA  
s(measurement.no,word)                       3.10e+02 1.58e+02      NA      NA  
s(f0Zscore2,word)                            3.10e+02 4.42e+01      NA      NA  
s(durationZscore2,word)                      3.10e+02 3.23e-04      NA      NA  
s(measurement.no,speaker)                    1.00e+02 3.07e+01    0.98   0.125  
s(durationZscore2,speaker)                   3.00e+02 9.76e-04    1.04   0.995  
s(f0Zscore2,speaker)                         1.00e+02 7.65e-04    0.99   0.215  
s(measurement.no,speakerPos)                 3.00e+02 6.93e+01    0.98   0.125  
s(durationZscore2,speakerPos)                9.00e+02 8.06e+01    1.04   1.000  
s(f0Zscore2,speakerPos)                      3.00e+02 5.73e+01    0.99   0.155  
s(measurement.no,speakerLeftRightTone)       5.80e+02 1.53e+02    0.98   0.090 .
s(durationZscore2,speakerLeftRightTone)      1.74e+03 8.92e+01    1.04   0.995  
s(f0Zscore2,speakerLeftRightTone)            5.80e+02 1.05e+02    0.99   0.175  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

# 3D plotting

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2h, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.fem$durationZscore2, c(0.25))),
        ylim = quantile(data.au.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25auf * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0auf + global_mean0auf), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2auf + global_mean2auf, 
        zlim = c(1100, 1600),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.270026 to 1.307646. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.65512883823603. 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1100, 1600), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.model2h, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2. = quantile(data.au.fem$durationZscore2, c(0.5))),
        ylim = quantile(data.au.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5auf * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0auf + global_mean0auf), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2auf + global_mean2auf, 
        zlim = c(1100, 1600),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.270026 to 1.307646. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.135002585755248. 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1100, 1600), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))

fvisgam(gamm.model2h, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.fem$durationZscore2, c(0.75))),
        ylim = quantile(data.au.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75auf * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0auf + global_mean0auf),
        transform = function(f2Zscore2) f2Zscore2 * global_sd2auf + global_mean2auf, 
        zlim = c(1100, 1600),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.270026 to 1.307646. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.536034051323852. 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1100, 1600), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)

NA
NA
NA
# 3D plotting
 png("pred2b-10.png", width = 6, height = 4, units = "in", res = 1000)
par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2h, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.fem$durationZscore2, c(0.25))),
        ylim = quantile(data.au.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.25auf * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0auf + global_mean0auf), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2auf + global_mean2auf, 
        zlim = c(1100, 1600),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.270026 to 1.307646. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.65512883823603. 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1100, 1600), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
 png("pred2b-11.png", width = 6, height = 4, units = "in", res = 1000)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2h, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2. = quantile(data.au.fem$durationZscore2, c(0.5))),
        ylim = quantile(data.au.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.5auf * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0auf + global_mean0auf), 
        transform = function(f2Zscore2) f2Zscore2 * global_sd2auf + global_mean2auf, 
        zlim = c(1100, 1600),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.270026 to 1.307646. 
    * durationZscore2 : numeric predictor; set to the value(s): -0.135002585755248. 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1100, 1600), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 
 png("pred2b-12.png", width = 6, height = 4, units = "in", res = 1000)

par(mfrow=c(1,1), cex=1, mar=c(3,3.5,1.5,3.5), mgp=c(2,0.75,0))
fvisgam(gamm.model2h, view=c("measurement.no","f0Zscore2"),
        cond = list(durationZscore2 = quantile(data.au.fem$durationZscore2, c(0.75))),
        ylim = quantile(data.au.fem$f0Zscore2, c(0.1,0.9), na.rm = T),
        transform.view = c(function(measurement.no) measurement.no * duration0.75auf * 0.1, function(f0Zscore2) f0Zscore2 * global_sd0auf + global_mean0auf),
        transform = function(f2Zscore2) f2Zscore2 * global_sd2auf + global_mean2auf, 
        zlim = c(1100, 1600),
        hide.label = TRUE, add.color.legend = FALSE, rm.ranef = T, main = "", xlab = "Time (ms)", ylab = "F0 (Hz)",font.lab = 2, cex.lab = 1.3, cex.axis = 1.3, xaxt = "n", color = mapcols_pastel, xaxt = "n")
Summary:
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0Zscore2 : numeric predictor; with 30 values ranging from -1.270026 to 1.307646. 
    * durationZscore2 : numeric predictor; set to the value(s): 0.536034051323852. 
    * word : factor; set to the value(s): 报道. (Might be canceled as random effect, check below.) 
    * wordPos : factor; set to the value(s): 报道 Fin. (Might be canceled as random effect, check below.) 
    * wordLeftRightTone : factor; set to the value(s): 报道 L H. (Might be canceled as random effect, check below.) 
    * speaker : factor; set to the value(s): S0133. (Might be canceled as random effect, check below.) 
    * speakerPos : factor; set to the value(s): S0129 Fin. (Might be canceled as random effect, check below.) 
    * speakerLeftRightTone : factor; set to the value(s): S0125 L H. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(word),s(wordPos),s(wordLeftRightTone),s(measurement.no,wordPos),s(f0Zscore2,wordPos),s(durationZscore2,wordPos),s(measurement.no,wordLeftRightTone),s(f0Zscore2,wordLeftRightTone),s(durationZscore2,wordLeftRightTone),s(measurement.no,word),s(f0Zscore2,word),s(durationZscore2,word),s(measurement.no,speaker),s(durationZscore2,speaker),s(f0Zscore2,speaker),s(measurement.no,speakerPos),s(durationZscore2,speakerPos),s(f0Zscore2,speakerPos),s(measurement.no,speakerLeftRightTone),s(durationZscore2,speakerLeftRightTone),s(f0Zscore2,speakerLeftRightTone)
 
    * Note: Transformation function(s) applied to values of x-axis and / or y-axis.
Avis : data length [31] is not a sub-multiple or multiple of the number of rows [30]
gradientLegend(valRange=c(1100, 1600), length=.5, pos=.75, side=4, n.seg = 1, inside=FALSE,font = 1, cex = 1, color = mapcols_pastel)
axis(1, at=tickvals2, labels=ticknames2, las=2, cex.axis=1)
dev.off()
null device 
          1 

Model comparison

We take data.ai.mas as the sample data set, Z scored F1 as the prediction. The purpose of model comparison section is to investigate whether incorporating relevant variables (predictors or random effects) leads to a significant enhancement in model performance.

Random effects

Testing impact of speaker

With only speaker as the random effect.

system.time(REspeaker <- bam(f1Zscore2 ~ 
                         # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        
                  
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1),
 
                        
                        
                    
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores)
) 
utilisateur     système      écoulé 
     96.332       2.942      45.164 

Testing impact of speakerLeftRightTone

Add the cross effect: speaker*LeftRightTone.

system.time(REspeakerLeftRightTone <- bam(f1Zscore2 ~ 
                         # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        
                  
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                       
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1),
 
                        
                    
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores)
) 
utilisateur     système      écoulé 
   1035.362       8.454      84.469 

Testing impact of speakerPos

Add the the cross effect: speaker*Pos.

system.time(REspeakerPos <- bam(f1Zscore2 ~ 
                         # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1),
                        
                    
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores)
) 
utilisateur     système      écoulé 
   2441.241      29.012     289.126 
saveRDS(REspeakerPos, paste("REspeakerPos.rds"))

Testing impact of word as random intercept and random slope

Add the random intercept and random slope of word.

system.time(REword <- bam(f1Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1),
 
 
                        
                    
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores)
) 
utilisateur     système      écoulé 
   3599.985      60.551     341.720 
saveRDS(REword, paste("REword.rds"))

Testing impact of pos and leftRightTone on word

Add the cross effect word*pos and word*LeftRightTone.

This is the final full model.

REfullmodel <- bam(f1Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr", k = 10) +
                        s(f0Zscore2, bs="cr", k = 10) +
                        s(durationZscore2, bs="cr", k = 30) +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", k = c(5, 8, 12)) +
                        ti(measurement.no, durationZscore2, bs = "cr", k = c(5, 12)) +
                        ti(measurement.no, f0Zscore2, bs = "cr", k = c(5, 8)) +
                        ti(f0Zscore2, durationZscore2, bs = "cr", k = c(8, 12)) +
                        
                        # random effect
                        
                        s(word, bs="re") +
                        s(wordPos, bs="re") +
                        s(wordLeftRightTone, bs="re") +
                        
                        s(wordPos, measurement.no, bs = "re") +
                        s(wordPos, f0Zscore2, bs="re") +
                        s(wordPos, durationZscore2, bs="re") +
                          
                        s(wordLeftRightTone, measurement.no, bs = "re") +
                        s(wordLeftRightTone, f0Zscore2, bs="re") +
                        s(wordLeftRightTone, durationZscore2, bs="re") +
                          
                        s(word, measurement.no, bs = "re") +
                        s(word, f0Zscore2, bs="re") +
                        s(word, durationZscore2, bs="re") +
                        
                        s(measurement.no, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speaker, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speaker, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerPos, bs="fs", xt = list(bs="tp"), k=10, m=1) +
 
                        s(measurement.no, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1) +
                        s(durationZscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=30, m=1) +
                        s(f0Zscore2, speakerLeftRightTone, bs="fs", xt = list(bs="tp"), k=10, m=1),
 
                        
                    
                      data=data.ai.mas, method="fREML", discrete = TRUE, nthreads = ncores)
REfullmodel <- gamm.model2a.noAR

compareML

compareML(REword, REfullmodel)
REword: f1Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(word, bs = "re") + s(word, measurement.no, 
    bs = "re") + s(word, f0Zscore2, bs = "re") + s(word, durationZscore2, 
    bs = "re") + s(measurement.no, speaker, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(durationZscore2, speaker, bs = "fs", xt = list(bs = "tp"), 
    k = 30, m = 1) + s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(measurement.no, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speakerPos, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speakerPos, bs = "fs", xt = list(bs = "tp"), 
        k = 10, m = 1) + s(measurement.no, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 30, 
    m = 1) + s(f0Zscore2, speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1)

REfullmodel: f1Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(word, bs = "re") + s(wordPos, 
    bs = "re") + s(wordLeftRightTone, bs = "re") + s(wordPos, 
    measurement.no, bs = "re") + s(wordPos, f0Zscore2, bs = "re") + 
    s(wordPos, durationZscore2, bs = "re") + s(wordLeftRightTone, 
    measurement.no, bs = "re") + s(wordLeftRightTone, f0Zscore2, 
    bs = "re") + s(wordLeftRightTone, durationZscore2, bs = "re") + 
    s(word, measurement.no, bs = "re") + s(word, f0Zscore2, bs = "re") + 
    s(word, durationZscore2, bs = "re") + s(measurement.no, speaker, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1) + s(measurement.no, speakerPos, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(durationZscore2, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerPos, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(measurement.no, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 10, 
    m = 1) + s(durationZscore2, speakerLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 30, m = 1) + s(f0Zscore2, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1)

Chi-square test of fREML scores
-----

AIC difference: 1216.69, model REfullmodel has lower AIC.
compareML(REspeakerPos,REword)
REspeakerPos: f1Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(measurement.no, speaker, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1) + s(measurement.no, speakerLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 30, 
    m = 1) + s(f0Zscore2, speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(measurement.no, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speakerPos, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speakerPos, bs = "fs", xt = list(bs = "tp"), 
        k = 10, m = 1)

REword: f1Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(word, bs = "re") + s(word, measurement.no, 
    bs = "re") + s(word, f0Zscore2, bs = "re") + s(word, durationZscore2, 
    bs = "re") + s(measurement.no, speaker, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(durationZscore2, speaker, bs = "fs", xt = list(bs = "tp"), 
    k = 30, m = 1) + s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(measurement.no, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speakerPos, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speakerPos, bs = "fs", xt = list(bs = "tp"), 
        k = 10, m = 1) + s(measurement.no, speakerLeftRightTone, 
    bs = "fs", xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 30, 
    m = 1) + s(f0Zscore2, speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1)

Chi-square test of fREML scores
-----

AIC difference: 2565.29, model REword has lower AIC.
compareML(REspeakerLeftRightTone,REspeakerPos)
REspeakerLeftRightTone: f1Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(measurement.no, speaker, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1) + s(measurement.no, speakerLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 30, 
    m = 1) + s(f0Zscore2, speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1)

REspeakerPos: f1Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(measurement.no, speaker, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1) + s(measurement.no, speakerLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 30, 
    m = 1) + s(f0Zscore2, speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1) + s(measurement.no, speakerPos, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speakerPos, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speakerPos, bs = "fs", xt = list(bs = "tp"), 
        k = 10, m = 1)

Chi-square test of fREML scores
-----

AIC difference: 1281.25, model REspeakerPos has lower AIC.
compareML(REspeaker, REspeakerLeftRightTone)
REspeaker: f1Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(measurement.no, speaker, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1)

REspeakerLeftRightTone: f1Zscore2 ~ s(measurement.no, bs = "cr", k = 10) + s(f0Zscore2, 
    bs = "cr", k = 10) + s(durationZscore2, bs = "cr", k = 30) + 
    ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr", 
        k = c(5, 8, 12)) + ti(measurement.no, durationZscore2, 
    bs = "cr", k = c(5, 12)) + ti(measurement.no, f0Zscore2, 
    bs = "cr", k = c(5, 8)) + ti(f0Zscore2, durationZscore2, 
    bs = "cr", k = c(8, 12)) + s(measurement.no, speaker, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speaker, bs = "fs", xt = list(bs = "tp"), k = 30, m = 1) + 
    s(f0Zscore2, speaker, bs = "fs", xt = list(bs = "tp"), k = 10, 
        m = 1) + s(measurement.no, speakerLeftRightTone, bs = "fs", 
    xt = list(bs = "tp"), k = 10, m = 1) + s(durationZscore2, 
    speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), k = 30, 
    m = 1) + s(f0Zscore2, speakerLeftRightTone, bs = "fs", xt = list(bs = "tp"), 
    k = 10, m = 1)

Chi-square test of fREML scores
-----

AIC difference: 3652.24, model REspeakerLeftRightTone has lower AIC.

Fixed effects

Here we don’t specify k-values since it will cause errors.

removing impact of duration and f0

This is the fundamental structure: only normalized time.

system.time(removedurationandf0 <- bam(f1Zscore2 ~ 
                         # smooth
                        s(measurement.no, bs="cr"),
                        
                    
                      data=data.ai.mas, method="ML", discrete = TRUE, nthreads = ncores)
) 
Avis : discrétisation disponible uniquement avec fREML
utilisateur     système      écoulé 
      0.589       0.075       0.208 
saveRDS(removedurationandf0, paste("removedurationandf0.rds"))

removing impact of duration

system.time(removeduration <- bam(f1Zscore2 ~ 
                         # smooth
                        s(measurement.no, bs="cr") +
                        
                        s(f0Zscore2, bs="cr") +
                        
                        # interaction between smooths
                        
                        ti(measurement.no, f0Zscore2, bs = "cr"),
                    
                      data=data.ai.mas, method="ML", discrete = TRUE, nthreads = ncores)
) 
Avis : discrétisation disponible uniquement avec fREML
utilisateur     système      écoulé 
      5.410       0.783       0.755 
saveRDS(removeduration, paste("removeduration.rds"))

removing impact of f0

system.time(removef0 <- bam(f1Zscore2 ~ 
                         # smooth
                        s(measurement.no, bs="cr") +
                        
                        s(durationZscore2, bs="cr") +
                        
                        # interaction between smooths
                        
                        ti(measurement.no, durationZscore2, bs = "cr"),
                    
                      data=data.ai.mas, method="ML", discrete = TRUE, nthreads = ncores)
) 
Avis : discrétisation disponible uniquement avec fREML
utilisateur     système      écoulé 
      2.345       0.354       0.318 
saveRDS(removef0, paste("removef0.rds"))

This tests your full model

system.time(fullmodel <- bam(f1Zscore2 ~ 
                        # smooth
                        s(measurement.no, bs="cr") +
                        s(f0Zscore2, bs="cr") +
                        s(durationZscore2, bs="cr") +
                        
                        # interaction entre smooths
                        ti(measurement.no, f0Zscore2, durationZscore2, bs = "cr") +
                        ti(measurement.no, durationZscore2, bs = "cr") +
                        ti(measurement.no, f0Zscore2, bs = "cr") +
                        ti(f0Zscore2, durationZscore2, bs = "cr"),
                        
                    
                      data=data.ai.mas, method="ML", discrete = TRUE, nthreads = ncores)
) 
Avis : discrétisation disponible uniquement avec fREML
utilisateur     système      écoulé 
     43.960       4.974       5.250 
saveRDS(fullmodel, paste("fullmodel.rds"))
fullmodel <- 
  readRDS("fullmodel.rds")

compareML

compareML(removeduration, fullmodel)
removeduration: f1Zscore2 ~ s(measurement.no, bs = "cr") + s(f0Zscore2, bs = "cr") + 
    ti(measurement.no, f0Zscore2, bs = "cr")

fullmodel: f1Zscore2 ~ s(measurement.no, bs = "cr") + s(f0Zscore2, bs = "cr") + 
    s(durationZscore2, bs = "cr") + ti(measurement.no, f0Zscore2, 
    durationZscore2, bs = "cr") + ti(measurement.no, durationZscore2, 
    bs = "cr") + ti(measurement.no, f0Zscore2, bs = "cr") + ti(f0Zscore2, 
    durationZscore2, bs = "cr")

Chi-square test of ML scores
-----

AIC difference: 311.33, model fullmodel has lower AIC.

duration is significant

compareML(removef0, fullmodel)
removef0: f1Zscore2 ~ s(measurement.no, bs = "cr") + s(durationZscore2, 
    bs = "cr") + ti(measurement.no, durationZscore2, bs = "cr")

fullmodel: f1Zscore2 ~ s(measurement.no, bs = "cr") + s(f0Zscore2, bs = "cr") + 
    s(durationZscore2, bs = "cr") + ti(measurement.no, f0Zscore2, 
    durationZscore2, bs = "cr") + ti(measurement.no, durationZscore2, 
    bs = "cr") + ti(measurement.no, f0Zscore2, bs = "cr") + ti(f0Zscore2, 
    durationZscore2, bs = "cr")

Chi-square test of ML scores
-----

AIC difference: 3440.09, model fullmodel has lower AIC.

f0 is significant

compareML(removedurationandf0,removef0)
removedurationandf0: f1Zscore2 ~ s(measurement.no, bs = "cr")

removef0: f1Zscore2 ~ s(measurement.no, bs = "cr") + s(durationZscore2, 
    bs = "cr") + ti(measurement.no, durationZscore2, bs = "cr")

Chi-square test of ML scores
-----

AIC difference: 240.25, model removef0 has lower AIC.

duration is significant

compareML(removedurationandf0,removeduration)
removedurationandf0: f1Zscore2 ~ s(measurement.no, bs = "cr")

removeduration: f1Zscore2 ~ s(measurement.no, bs = "cr") + s(f0Zscore2, bs = "cr") + 
    ti(measurement.no, f0Zscore2, bs = "cr")

Chi-square test of ML scores
-----

AIC difference: 3369.00, model removeduration has lower AIC.

f0 is significant

end

LS0tCnRpdGxlOiAiVG9uYWwgaW1wYWN0IG9uIGRpcGh0aG9uZyByZWFsaXphdGlvbnMgaW4gU3Rhbm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C5ubywgYnk9dG9uZUJpcy5vcmQsIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgcmFuZG9tIGVmZmVjdHMKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsgIAoKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmQsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZFBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSksCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgZGF0YT1kYXRhLmFpLm1hcywgbWV0aG9kPSJmUkVNTCIsIGRpc2NyZXRlID0gVFJVRSwgbnRocmVhZHMgPSBuY29yZXMpCmBgYAoKYGBge3J9CiNzYXZlUkRTKGdhbW0ubW9kZWwxYS5ub0FSLCBwYXN0ZSgiR2FtbV9tb2RlbDFhX25vQVIucmRzIikpCmBgYAoKYGBge3J9CmdhbW0ubW9kZWwxYS5ub0FSIDwtIAogIHJlYWRSRFMoIkdhbW1fbW9kZWwxYV9ub0FSLnJkcyIpCmBgYAoKYGBge3J9CnIuZ2FtbS5tb2RlbDFhIDwtIHN0YXJ0X3ZhbHVlX3JobyhnYW1tLm1vZGVsMWEubm9BUikKYGBgCgpgYGB7cn0KIyBBdXRvLXJlZ3Jlc3NpdmUgbW9kZWwKCmdhbW0ubW9kZWwxYSA8LSBiYW0oZjFac2NvcmUyIH4gdG9uZUJpcy5vcmQgKyAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aCBieSBmYWN0b3JzCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJ5PXRvbmVCaXMub3JkLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3RzCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArICAKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKwogICAgICAgICAgICAgICAgICAgICAgIC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IpCm10ZXh0KCJUaW1lIChub3JtYWxpemVkKSIsIHNpZGUgPSAxLCBvdXRlciA9IFRSVUUsIGxpbmUgPSAyLjUsIGNleCA9IDEuMiwgZm9udCA9IDIpCgpgYGAKCmBgYHtyfQpwbG90X3BhcmFtZXRyaWMoZ2FtbS5tb2RlbDFhLCBwcmVkID0gbGlzdCh0b25lQmlzLm9yZD1jKCIxIiwgIjIiLCAiMyIsICI0IikpLCBtYWluID0gIlRvbmUiLCB4bGFiID0gIkYxIChaKSIpCmBgYAoKIyMgTW9kZWwgMUI6IC9haS8gZmVtYWxlLCBGMSBhcyBvdXRwdXQKCmBgYHtyfQoKZ2FtbS5tb2RlbDFiLm5vQVIgPC0gYmFtKGYxWnNjb3JlMiB+IHRvbmVCaXMub3JkICsgCiAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGggYnkgZmFjdG9ycwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBieT10b25lQmlzLm9yZCwgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyByYW5kb20gZWZmZWN0cwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKyAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmRQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZExlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpLAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgIGRhdGE9ZGF0YS5haS5mZW0sIG1ldGhvZD0iZlJFTUwiLCBkaXNjcmV0ZSA9IFRSVUUsIG50aHJlYWRzID0gbmNvcmVzKQpgYGAKCmBgYHtyfQojc2F2ZVJEUyhnYW1tLm1vZGVsMWIubm9BUiwgcGFzdGUoIkdhbW1fbW9kZWwxYl9ub0FSLnJkcyIpKQpgYGAKCmBgYHtyfQpnYW1tLm1vZGVsMWIubm9BUiA8LSAKICByZWFkUkRTKCJHYW1tX21vZGVsMWJfbm9BUi5yZHMiKQpgYGAKCmBgYHtyfQpyLmdhbW0ubW9kZWwxYiA8LSBzdGFydF92YWx1ZV9yaG8oZ2FtbS5tb2RlbDFiLm5vQVIpCmBgYAoKYGBge3J9CiMgQXV0by1yZWdyZXNzaXZlIG1vZGVsCmdhbW0ubW9kZWwxYiA8LSBiYW0oZjFac2NvcmUyIH4gdG9uZUJpcy5vcmQgKyAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aCBieSBmYWN0b3JzCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJ5PXRvbmVCaXMub3JkLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3RzCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArICAKICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZCwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmRMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xK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vYXUvIG1hbGUsIEYxIGFzIG91dHB1dAoKYGBge3J9CgpnYW1tLm1vZGVsMWMubm9BUiA8LSBiYW0oZjFac2NvcmUyIH4gdG9uZUJpcy5vcmQgKyAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aCBieSBmYWN0b3JzCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJ5PXRvbmVCaXMub3JkLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3RzCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArICAKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmQsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZFBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSksCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgZGF0YT1kYXRhLmF1Lm1hcywgbWV0aG9kPSJmUkVNTCIsIGRpc2NyZXRlID0gVFJVRSwgbnRocmVhZHMgPSBuY29yZXMpCmBgYAoKYGBge3J9CiNzYXZlUkRTKGdhbW0ubW9kZWwxYy5ub0FSLCBwYXN0ZSgiR2FtbV9tb2RlbDFjX25vQVIucmRzIikpCmBgYAoKYGBge3J9CmdhbW0ubW9kZWwxYy5ub0FSIDwtIAogIHJlYWRSRFMoIkdhbW1fbW9kZWwxY19ub0FSLnJkcyIpCmBgYAoKYGBge3J9CnIuZ2FtbS5tb2RlbDFjIDwtIHN0YXJ0X3ZhbHVlX3JobyhnYW1tLm1vZGVsMWMubm9BUikKYGBgCgpgYGB7cn0KIyBBdXRvLXJlZ3Jlc3NpdmUgbW9kZWwKCmdhbW0ubW9kZWwxYyA8LSBiYW0oZjFac2NvcmUyIH4gdG9uZUJpcy5vcmQgKyAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aCBieSBmYWN0b3JzCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJ5PXRvbmVCaXMub3JkLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3RzCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArICAKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmRQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZExlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpLAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgIGRhdGE9ZGF0YS5hdS5tYXMsIG1ldGhvZD0iZlJFTUwiLCByaG8gPSByLmdhbW0ubW9kZWwxYywgQVIuc3RhcnQgPSBkYXRhLmF1Lm1hcyRzdGFydCwgZGlzY3JldGUgPSBUUlVFLCBudGhyZWFkcyA9IG5jb3JlcykKYGBgCgpgYGB7cn0KI3NhdmVSRFMoZ2FtbS5tb2RlbDFjLCBwYXN0ZSgiR2FtbV9tb2RlbDFj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LCBtYWluID0gIjMtNCIsIGhpZGUubGFiZWwgPSBULCB4YXh0ID0gIm4iLCB4bGFiID0gIiIsIHlsYWIgPSAiIikKYXhpcygxLCBhdD10aWNrdmFscywgbGFiZWxzPXRpY2tuYW1lcywgbGFzPTEsIGNleC5heGlzPTEpCm10ZXh0KCJEaWZmZXJlbmNlIGluIEYxIChaKSIsIHNpZGUgPSAyLCBvdXRlciA9IFRSVUUsIGxpbmUgPSAyLjUsIGNleCA9IDEuMiwgZm9udCA9IDIpCm10ZXh0KCJUaW1lIChub3JtYWxpemVkKSIsIHNpZGUgPSAxLCBvdXRlciA9IFRSVUUsIGxpbmUgPSAyLjUsIGNleCA9IDEuMiwgZm9udCA9IDIpCmBgYAoKYGBge3J9CnBsb3RfcGFyYW1ldHJpYyhnYW1tLm1vZGVsMWMsIHByZWQgPSBsaXN0KHRvbmVCaXMub3JkPWMoIjEiLCAiMiIsICIzIiwgIjQiKSksIG1haW4gPSAiVG9uZSIsIHhsYWIgPSAiRjEgKFopIikKYGBgCgojIyBNb2RlbCAxRDogL2F1LyBmZW1hbGUsIEYxIGFzIG91dHB1dAoKYGBge3J9CgpnYW1tLm1vZGVsMWQubm9BUiA8LSBiYW0oZjFac2NvcmUyIH4gdG9uZUJpcy5vcmQgKyAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aCBieSBmYWN0b3JzCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJ5PXRvbmVCaXMub3JkLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3RzCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArICAKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmQsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZFBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZExlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpLAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgIGRhdGE9ZGF0YS5hdS5mZW0sIG1ldGhvZD0iZlJFTUwiLCBkaXNjcmV0ZSA9IFRSVUUsIG50aHJlYWRzID0gbmNvcmVzKQpgYGAKCmBgYHtyfQojc2F2ZVJEUyhnYW1tLm1vZGVsMWQubm9BUiwgcGFzdGUoIkdhbW1fbW9kZWwxZF9ub0FSLnJkcyIpKQpgYGAKCmBgYHtyfQpnYW1tLm1vZGVsMWQubm9BUiA8LSAKICByZWFkUkRTKCJHYW1tX21vZGVsMWRfbm9BUi5yZHMiKQpgYGAKCmBgYHtyfQpyLmdhbW0ubW9kZWwxZCA8LSBzdGFydF92YWx1ZV9yaG8oZ2FtbS5tb2RlbDFkLm5vQVIpCmBgYAoKYGBge3J9CiMgQXV0by1yZWdyZXNzaXZlIG1vZGVsCgpnYW1tLm1vZGVsMWQgPC0gYmFtKGYxWnNjb3JlMiB+IHRvbmVCaXMub3JkICsgCiAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGggYnkgZmFjdG9ycwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBieT10b25lQmlzLm9yZCwgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyByYW5kb20gZWZmZWN0cwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKyAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgIC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FopIiwgbWFpbiA9ICJUb25lIikKYGBgCgojIyBGb3IgQXBwZW5kaXggQjogT3JnYW5pemluZyB0b25lcyBhcyAiMSBcPCAyIFw8IDMgXDwgNCIKCmBgYHtyfQoKZ2FtbS5pbml0aWFsT3JkZXIubm9BUiA8LSBiYW0oZjFac2NvcmUyIH4gdG9uZS5vcmQgKyAKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGggYnkgZmFjdG9ycwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBieT10b25lLm9yZCwgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyByYW5kb20gZWZmZWN0cwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmUub3JkKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lLm9yZCkgKyAgCiAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lLm9yZCkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmRQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZExlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpLAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgIGRhdGE9ZGF0YS5hdS5tYXMsIG1ldGhvZD0iZlJFTUwiLCBkaXNjcmV0ZSA9IFRSVUUsIG50aHJlYWRzID0gbmNvcmVzKQoKCmBgYAoKYGBge3J9CiNzYXZlUkRTKGdhbW0uaW5pdGlhbE9yZGVyLm5vQVIsIHBhc3RlKCJHYW1tX2luaXRpYWxPcmRlcl9ub0FSLnJkcyIpKQpgYGAKCmBgYHtyfQpnYW1tLmluaXRpYWxPcmRlci5ub0FSIDwtIAogIHJlYWRSRFMoIkdhbW1faW5pdGlhbE9yZGVyX25vQVIucmRzIikKYGBgCgpgYGB7cn0Kci5nYW1tLmluaXRpYWxPcmRlciA8LSBzdGFydF92YWx1ZV9yaG8oZ2FtbS5pbml0aWFsT3JkZXIubm9BUikKYGBgCgpgYGB7cn0KIyBBdXRvLXJlZ3Jlc3NpdmUgbW9kZWwKCmdhbW0uSW5pdGlhbE9yZGVyIDwtIGJhbShmMVpzY29yZTIgfiB0b25lLm9yZCArIAogICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGggYnkgZmFjdG9ycwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBieT10b25lLm9yZCwgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyByYW5kb20gZWZmZWN0cwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmUub3JkKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lLm9yZCkgKyAgCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZS5vcmQpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZCwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmRMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSwKICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgIGRhdGE9ZGF0YS5hdS5tYXMsIG1ldGhvZD0iZlJFTUwiLCByaG8gPSByLmdhbW0uaW5pdGlhbE9yZGVyLCBBUi5zdGFydCA9IGRhdG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KICAgICAgICAgICAgcnVnPUYsIHJtLnJhbmVmID0gVCwgc2hhZGUgPSBGLCBjb25kID0gbGlzdCh0b25lLm9yZCA9ICIzIiksIGNvbCA9ICJjaGFydHJldXNlNCIsIGFkZCA9IFQsIGx3ZCA9IDQpCnBsb3Rfc21vb3RoKGdhbW0uSW5pdGlhbE9yZGVyLCB2aWV3PSJtZWFzdXJlbWVudC5ubyIsCiAgICAgICAgICAgIHJ1Zz1GLCBybS5yYW5lZiA9IFQsIHNoYWRlID0gRiwgY29uZCA9IGxpc3QodG9uZS5vcmQgPSAiNCIpLCBjb2wgPSAicm95YWxibHVlNCIsIGFkZCA9IFQsIGx3ZCA9IDQpCmxlZ2VuZCgidG9wcmlnaHQiLCBsZWdlbmQ9YygiVG9uZSAxIiwgIlRvbmUgMiIsICJUb25lIDMiLCAiVG9uZSA0IiksIAogICAgICAgY29sPWMoInJlZCIsIm9yYW5nZSIsICJjaGFydHJldXNlNCIsICJyb3lhbGJsdWU0IiksIGx3ZD00KQpheGlzKDEsIGF0PXRpY2t2YWxzLCBsYWJlbHM9dGlja25hbWVzLCBsYXM9MSwgY2V4LmF4aXM9MSkKCmBgYAoKIyMgTW9kZWwgMUU6IC9haS8gbWFsZSwgRjIgYXMgb3V0cHV0CgpgYGB7cn0KCmdhbW0ubW9kZWwxZS5ub0FSIDwtIGJhbShmMlpzY29yZTIgfiB0b25lQmlzLm9yZCArIAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoIGJ5IGZhY3RvcnMKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnk9dG9uZUJpcy5vcmQsIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgcmFuZG9tIGVmZmVjdHMKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsgIAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmQsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZFBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSksCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgZGF0YT1kYXRhLmFpLm1hcywgbWV0aG9kPSJmUkVNTCIsIGRpc2NyZXRlID0gVFJVRSwgbnRocmVhZHMgPSBuY29yZXMpCgpgYGAKCmBgYHtyfQojc2F2ZVJEUyhnYW1tLm1vZGVsMWUubm9BUiwgcGFzdGUoIkdhbW1fbW9kZWwxZV9ub0FSLnJkcyIpKQpgYGAKCmBgYHtyfQpnYW1tLm1vZGVsMWUubm9BUiA8LSAKICByZWFkUkRTKCJHYW1tX21vZGVsMWVfbm9BUi5yZHMiKQpgYGAKCmBgYHtyfQpyLmdhbW0ubW9kZWwxZSA8LSBzdGFydF92YWx1ZV9yaG8oZ2FtbS5tb2RlbDFlLm5vQVIpCmBgYAoKYGBge3J9CiMgQXV0by1yZWdyZXNzaXZlIG1vZGVsCgpnYW1tLm1vZGVsMWUgPC0gYmFtKGYyWnNjb3JlMiB+IHRvbmVCaXMub3JkICsgCiAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGggYnkgZmFjdG9ycwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBieT10b25lQmlzLm9yZCwgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyByYW5kb20gZWZmZWN0cwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKyAgCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZCwgYnM9ImZ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wgIjIiLCAiMyIsICI0IikpLCB4bGFiID0gIkYyIChaKSIsIG1haW4gPSAiVG9uZSIpCmBgYAoKIyMgTW9kZWwgMUY6IC9haS8gZmVtYWxlLCBGMiBhcyBvdXRwdXQKCmBgYHtyfQoKZ2FtbS5tb2RlbDFmLm5vQVIgPC0gYmFtKGYyWnNjb3JlMiB+IHRvbmVCaXMub3JkICsgCiAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGggYnkgZmFjdG9ycwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBieT10b25lQmlzLm9yZCwgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgcmFuZG9tIGVmZmVjdHMKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsgIAogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmRQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmRMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSwKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgZGF0YT1kYXRhLmFpLmZlbSwgbWV0aG9kPSJmUkVNTCIsIGRpc2NyZXRlID0gVFJVRSwgbnRocmVhZHMgPSBuY29yZXMpCgoKYGBgCgpgYGB7cn0KI3NhdmVSRFMoZ2FtbS5tb2RlbDFmLm5vQVIsIHBhc3RlKCJHYW1tX21vZGVsMWZfbm9BUi5yZHMiKSkKYGBgCgpgYGB7cn0KZ2FtbS5tb2RlbDFmLm5vQVIgPC0gCiAgcmVhZFJEUygiR2FtbV9tb2RlbDFmX25vQVIucmRzIikKYGBgCgpgYGB7cn0Kci5nYW1tLm1vZGVsMWYgPC0gc3RhcnRfdmFsdWVfcmhvKGdhbW0ubW9kZWwxZi5ub0FSKQpgYGAKCmBgYHtyfQojIEF1dG8tcmVncmVzc2l2ZSBtb2RlbAoKZ2FtbS5tb2RlbDFmIDwtIGJhbShmMlpzY29yZTIgfiB0b25lQmlzLm9yZCArIAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoIGJ5IGZhY3RvcnMKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnk9dG9uZUJpcy5vcmQsIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3RzCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArICAKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZCwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmRMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc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ZW50Lm5vLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoIGJ5IGZhY3RvcnMKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnk9dG9uZUJpcy5vcmQsIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgcmFuZG9tIGVmZmVjdHMKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsgIAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYn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gICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aCBieSBmYWN0b3JzCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJ5PXRvbmVCaXMub3JkLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3RzCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArICAKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmRQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZExlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpLAogICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgZGF0YT1kYXRhLmF1Lm1hcywgbWV0aG9kPSJmUkVNTCIsIHJobyA9IHIuZ2FtbS5tb2RlbDFnLCBBUi5zdGFydCA9IGRhdGEuYXUubWFzJHN0YXJ0LCBkaXNjcmV0ZSA9IFRSVUUsIG50aHJlYWRzID0gbmNvcmVzKQpgYGAKCmBgYHtyfQojc2F2ZVJEUyhnYW1tLm1vZGVsMWcsIHBhc3RlKCJHYW1tX21vZGVsMWcucmRzIikpCmBgYAoKYGBge3J9CmdhbW0ubW9kZWwxZyA8LSAKICByZWFkUkRTKCJHYW1tX21vZGVsMWcucmRzIikKYGBgCgpgYGB7cn0Kc3VtbWFyeShnYW1tLm1vZGVsMWcsIHJlLnRlc3QgPSBGQUxTRSkKYGBgCgpgYGB7cn0KZ2FtLmNoZWNrKGdhbW0ubW9kZ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gPSAyLjUsIGNleCA9IDEuMiwgZm9udCA9IDIpCm10ZXh0KCJUaW1lIChub3JtYWxpemVkKSIsIHNpZGUgPSAxLCBvdXRlciA9IFRSVUUsIGxpbmUgPSAyLjUsIGNleCA9IDEuMiwgZm9udCA9IDIpCgoKYGBgCgpgYGB7cn0KcGxvdF9wYXJhbWV0cmljKGdhbW0ubW9kZWwxZywgcHJlZCA9IGxpc3QodG9uZUJpcy5vcmQ9YygiMSIsICIyIiwgIjMiLCAiNCIpKSwgeGxhYiA9ICJGMiAoWikiLCBtYWluID0gIlRvbmUiKQpgYGAKCiMjIE1vZGVsIDFIOiAvYXUvIGZlbWFsZSwgRjIgYXMgb3V0cHV0CgpgYGB7cn0KCmdhbW0ubW9kZWwxaCA8LSBiYW0oZjJac2NvcmUyIH4gdG9uZUJpcy5vcmQgKyAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aCBieSBmYWN0b3JzCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJ5PXRvbmVCaXMub3JkLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3RzCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArICAKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmRQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZExlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpLAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgIGRhdGE9ZGF0YS5hdS5mZW0sIG1ldGhvZD0iZlJFTUwiLCBkaXNjcmV0ZSA9IFRSVUUsIG50aHJlYWRzID0gbmNvcmVzKQoKYGBgCgpgYGB7cn0KI3NhdmVSRFMoZ2FtbS5tb2RlbDFoLm5vQVIsIHBhc3RlKCJHYW1tX21vZGVsMWhfbm9BUi5yZHMiKSkKYGBgCgpgYGB7cn0KZ2FtbS5tb2RlbDFoLm5vQVIgPC0gCiAgcmVhZFJEUygiR2FtbV9tb2RlbDFoX25vQVIucmRzIikKYGBgCgpgYGB7cn0Kci5nYW1tLm1vZGVsMWggPC0gc3RhcnRfdmFsdWVfcmhvKGdhbW0ubW9kZWwxaC5ub0FSKQpgYGAKCmBgYHtyfQojIEF1dG8tcmVncmVzc2l2ZSBtb2RlbAoKZ2FtbS5tb2RlbDFoIDwtIGJhbShmMlpzY29yZTIgfiB0b25lQmlzLm9yZCArIAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoIGJ5IGZhY3RvcnMKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnk9dG9uZUJpcy5vcmQsIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgcmFuZG9tIGVmZmVjdHMKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xLCBieT10b25lQmlzLm9yZCkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSwgYnk9dG9uZUJpcy5vcmQpICsgIAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEsIGJ5PXRvbmVCaXMub3JkKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmQsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZFBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQ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9haS8gbWFsZSwgRjEgYXMgb3V0cHV0KQoKYGBge3J9CmdhbW0ubW9kZWwydGVzdC5ub0FSIDwtIGJhbShmMVpzY29yZTIgfiAKICAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgaW50ZXJhY3Rpb24gZW50cmUgc21vb3RocwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgYnMgPSAiY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgcmFuZG9tIGVmZmVjdAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyMgbGVmdCBzZWdtZW50ICogcG93ICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZCwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgd29yZCwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgd29yZCwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmRMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCB3b3JkTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgd29yZExlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCB3b3JkUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCB3b3JkUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9NSwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTUsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz01LCBtPTEpLAogCiAgICAgICAgICAgICAgICAgICAgICBkYXRhPWRhdGEuYWkubWFzLCBtZXRob2Q9ImZSRU1MIiwgZGlzY3JldGUgPSBUUlVFLCBudGhyZWFkcyA9IG5jb3JlcykKCmBgYAoKYGBge3J9CiNzYXZlUkRTKGdhbW0ubW9kZWwydGVzdC5ub0FSLCBwYXN0ZSgiR2FtbV9tb2RlbDJ0ZXN0X25vQVIucmRzIikpCmBgYAoKYGBge3J9CmdhbW0ubW9kZWwydGVzdC5ub0FSIDwtIAogIHJlYWRSRFMoIkdhbW1fbW9kZWwydGVzdF9ub0FSLnJkcyIpCmBgYAoKYGBge3J9CnIuZ2FtbS5tb2RlbDJ0ZXN0IDwtIHN0YXJ0X3ZhbHVlX3JobyhnYW1tLm1vZGVsMnRlc3Qubm9BUikKYGBgCgpgYGB7cn0KIyBBdXRvLXJlZ3Jlc3NpdmUgbW9kZWwKCmdhbW0ubW9kZWwydGVzdCA8LSBiYW0oZjFac2NvcmUyIH4gCiAgICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIGludGVyYWN0aW9uIGVudHJlIHNtb290aHMKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMFpzY29yZTIsIGJzID0gImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3QKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMjIGxlZnQgc2VnbWVudCAqIHBvdyAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHdvcmQsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHdvcmQsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHdvcmQsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCB3b3JkTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgd29yZExlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHdvcmRMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MywgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgd29yZFBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgd29yZFBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgd29yZFBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMsIG09MSkgKwogICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTUsIG09MSkgKwogICAgICAgICAgICAgICAg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ICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyByYW5kb20gZWZmZWN0CiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA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IsIGsgPSAxMCkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgYnM9ImNyIiwgayA9IDEwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBicz0iY3IiLCBrID0gMzApICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgaW50ZXJhY3Rpb24gZW50cmUgc21vb3RocwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgOCwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMFpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgOCkpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkoZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoOCwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3QKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MzAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2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vQVIgPC0gYmFtKGYwWnNjb3JlMiB+IHRvbmVCaXMub3JkICsgCiAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGggYnkgZmFjdG9ycwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBieT10b25lQmlzLm9yZCwgYnM9ImNyIiksCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgZGF0YT1kYXRhLmFpLm1hcywgbWV0aG9kPSJmUkVNTCIsIGRpc2NyZXRlID0gVFJVRSwgbnRocmVhZHMgPSBuY29yZXMpCikKCmBgYAoKCgpgYGB7cn0Kci5nYW1tLmYwbW9kZWwgPC0gc3RhcnRfdmFsdWVfcmhvKGdhbW0uZjBtb2RlbC5ub0FSKQpgYGAKCmBgYHtyfQojIE1vZGVsbGluZyBGMiB+IHRvbmUKCiMgRmluYWwgbW9kZWwgd2l0aCBhdXRvLWNvcnJlbGF0aW9uCgpzeXN0ZW0udGltZShnYW1tLmYwbW9kZWwgPC0gYmFtKGYwWnNjb3JlMiB+IHRvbmVCaXMub3JkICsgCiAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGggYnkgZmFjdG9ycwogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBieT10b25lQmlzLm9yZCwgYnM9ImNyIiksCiAgICA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GLCBjb25kID0gbGlzdCh0b25lQmlzLm9yZCA9ICI0IiksIAogICAgICAgICAgICBjb2wgPSAicm95YWxibHVlNCIsIGFkZCA9IFQsIGx3ZCA9IDQpCmxlZ2VuZCgiYm90dG9tcmlnaHQiLCBsZWdlbmQ9YygiVG9uZSAxIiwgIlRvbmUgMiIsICJUb25lIDMiLCAiVG9uZSA0IiksIAogICAgICAgY29sPWMoInJlZCIsIm9yYW5nZSIsICJjaGFydHJldXNlNCIsICJyb3lhbGJsdWU0IiksIGx3ZD0yKQpheGlzKDEsIGF0PXRpY2t2YWxzLCBsYWJlbHM9dGlja25hbWVzLCBsYXM9MSwgY2V4LmF4aXM9MSkKCmRldi5vZmYoKQoKYGBgCgoKIyMgRm9yIEFwcGVuZGl4IEM6IHRlc3QgdGhlIG1vZGVsIHdpdGggdGUtdGVuc29yCgpgYGB7cn0Kc3lzdGVtLnRpbWUoZ2FtbS5tb2RlbDJhdGUubm9BUiA8LSBiYW0oZjFac2NvcmUyIH4gCiAgICAgICAgICAgICAgICAgICAgICAgICMgdGUgdGVuc29yCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICB0ZShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgOCwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3QKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MzAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSksIAogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgIAogCiAgICAgICAgICAgICAgICAgICAgICBkYXRhPWRhdGEuYWkubWFzLCBtZXRob2Q9ImZSRU1MIiwgZGlzY3JldGUgPSBUUlVFLCBudGhyZWFkcyA9IG5jb3JlcykKKQpgYGAKCmBgYHtyfQpzYXZlUkRTKGdhbW0ubW9kZWwyYXRlLm5vQVIsIHBhc3RlKCJHYW1tX21vZGVsMmF0ZV9ub0FSLnJkcyIpKQpgYGAKCmBgYHtyfQpnYW1tLm1vZGVsMmF0ZS5ub0FSIDwtIAogIHJlYWRSRFMoIkdhbW1fbW9kZWwyYXRlX25vQVIucmRzIikKYGBgCgpgYGB7cn0Kci5nYW1tLm1vZGVsMmF0ZSA8LSBzdGFydF92YWx1ZV9yaG8oZ2FtbS5tb2RlbDJhdGUubm9BUikKYGBgCgpgYGB7cn0Kc3lzdGVtLnRpbWUoZ2FtbS5tb2RlbDJhdGUgPC0gYmFtKGYxWnNjb3JlMiB+IAogICAgICAgICAgICAgICAgICAgICAgICAjIHRlIHRlbnNvcgogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgdGUobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyByYW5kb20gZWZmZWN0CiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2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dhbW0ubW9kZWwyYi5ub0FSIDwtIGJhbShmMVpzY29yZTIgfiAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIiwgayA9IDEwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBicz0iY3IiLCBrID0gMTApICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIGJzPSJjciIsIGsgPSAzMCkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBpbnRlcmFjdGlvbiBlbnRyZSBzbW9vdGhzCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCA4LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCA4KSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg4LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgcmFuZG9tIGVmZmVjdAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MzAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MzAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAKICAgICAgICAgICAgICAgICAgICAgIGRhdGE9ZGF0YS5haS5mZW0sIG1ldGhvZD0iZlJFTUwiLCBkaXNjcmV0ZSA9IFRSVUUsIG50aHJlYWRzID0gbmNvcmVzKQopCmBgYAoKYGBge3J9CnNhdmVSRFMoZ2FtbS5tb2RlbDJiLm5vQVIsIHBhc3RlKCJHYW1tX21vZGVsMmJfbm9BUi5yZHMiKSkKYGBgCgpgYGB7cn0KZ2FtbS5tb2RlbDJiLm5vQVIgPC0gCiAgcmVhZFJEUygiR2FtbV9tb2RlbDJiX25vQVIucmRzIikKYGBgCgpgYGB7cn0Kci5nYW1tLm1vZGVsMmIgPC0gc3RhcnRfdmFsdWVfcmhvKGdhbW0ubW9kZWwyYi5ub0FSKQpgYGAKCmBgYHtyfQojIEF1dG8tcmVncmVzc2l2ZSBtb2RlbAoKc3lzdGVtLnRpbWUoZ2FtbS5tb2RlbDJiIDwtIGJhbShmMVpzY29yZTIgfiAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIiwgayA9IDEwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBicz0iY3IiLCBrID0gMTApICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIGJzPSJjciIsIGsgPSAzMCkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBpbnRlcmFjdGlvbiBlbnRyZSBzbW9vdGhzCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCA4LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCA4KSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg4LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgcmFuZG9tIGVmZmVjdAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MzAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MzAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICA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gbi5zZWcgPSAxLCBpbnNpZGU9RkFMU0UsZm9udCA9IDEsIGNleCA9IDEsIGNvbG9yID0gbWFwY29scykKYXhpcygxLCBhdD10aWNrdmFscywgbGFiZWxzPXRpY2tuYW1lcywgbGFzPTEsIGNleC5heGlzPTEpCiNhYmxpbmUoaCA9ICgxLjIgKiBnbG9iYWxfc2RkMSArIGdsb2JhbF9tZWFuZDEpLCBsdHk9Mixsd2Q9MiwgY29sID0gIndoaXRlIikKZGV2Lm9mZigpCmBgYAoKIyMgTW9kZWwgMkM6IC9hdS8gbWFsZSwgRjEgYXMgb3V0cHV0CgpgYGB7cn0Kc3lzdGVtLnRpbWUoZ2FtbS5tb2RlbDJjLm5vQVIgPC0gYmFtKGYxWnNjb3JlMiB+IAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBicz0iY3IiLCBrID0gMTApICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIGJzPSJjciIsIGsgPSAxMCkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgYnM9ImNyIiwgayA9IDMwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIGludGVyYWN0aW9uIGVudHJlIHNtb290aHMKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyByYW5kb20gZWZmZWN0CiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAKIAogICAgICAgICAgICAgICAgICAgICAgZGF0YT1kYXRhLmF1Lm1hcywgbWV0aG9kPSJmUkVNTCIsIGRpc2NyZXRlID0gVFJVRSwgbnRocmVhZHMgPSBuY29yZXMpCikKYGBgCgpgYGB7cn0Kc2F2ZVJEUyhnYW1tLm1vZGVsMmMubm9BUiwgcGFzdGUoIkdhbW1fbW9kZWwyY19ub0FSLnJkcyIpKQpgYGAKCmBgYHtyfQpnYW1tLm1vZGVsMmMubm9BUiA8LSAKICByZWFkUkRTKCJHYW1tX21vZGVsMmNfbm9BUi5yZHMiKQpgYGAKCmBgYHtyfQpyLmdhbW0ubW9kZWwyYyA8LSBzdGFydF92YWx1ZV9yaG8oZ2FtbS5tb2RlbDJjLm5vQVIpCmBgYAoKYGBge3J9CiMgQXV0by1yZWdyZXNzaXZlIG1vZGVsCgpzeXN0ZW0udGltZShnYW1tLm1vZGVsMmMgPC0gYmFtKGYxWnNjb3JlMiB+IAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBicz0iY3IiLCBrID0gMTApICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIGJzPSJjciIsIGsgPSAxMCkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgYnM9ImNyIiwgayA9IDMwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIGludGVyYWN0aW9uIGVudHJlIHNtb290aHMKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyByYW5kb20gZWZmZWN0CiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTA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AgICAgICAgICAgICAgICAjIGludGVyYWN0aW9uIGVudHJlIHNtb290aHMKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyByYW5kb20gZWZmZWN0CiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAg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+IAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBicz0iY3IiLCBrID0gMTApICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIGJzPSJjciIsIGsgPSAxMCkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgYnM9ImNyIiwgayA9IDMwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIGludGVyYWN0aW9uIGVudHJlIHNtb290aHMKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyByYW5kb20gZWZmZWN0CiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpLCAKIAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgIGRhdGE9ZGF0YS5hdS5mZW0sIG1ldGhvZD0iZlJFTUwiLCBkaXNjcmV0ZSA9IFRSVUUsIG50aHJlYWRzID0gbmNvcmVzLCByaG8gPSByLmdhbW0ubW9kZWwyZCwgQVIuc3RhcnQgPSBkYXRhLmF1LmZlbSRzdGFydCkKKQpgYGAKCmBgYHtyfQpzYXZlUkRTKGdhbW0ub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MiwgY29sID0gIndoaXRlIikKZGV2Lm9mZigpCmBgYAoKIyMgTW9kZWwgMkU6IC9haS8gbWFsZSwgRjIgYXMgb3V0cHV0CgpgYGB7cn0Kc3lzdGVtLnRpbWUoZ2FtbS5tb2RlbDJlLm5vQVIgPC0gYmFtKGYyWnNjb3JlMiB+IAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBicz0iY3IiLCBrID0gMTApICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIGJzPSJjciIsIGsgPSAxMCkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgYnM9ImNyIiwgayA9IDMwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIGludGVyYWN0aW9uIGVudHJlIHNtb290aHMKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyByYW5kb20gZWZmZWN0CiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAKIAogICAgICAgICAgICAgICAgICAgICAgZGF0YT1kYXRhLmFpLm1hcywgbWV0aG9kPSJmUkVNTCIsIGRpc2NyZXRlID0gVFJVRSwgbnRocmVhZHMgPSBuY29yZXMpCikKYGBgCgpgYGB7cn0Kc2F2ZVJEUyhnYW1tLm1vZGVsMmUubm9BUiwgcGFzdGUoIkdhbW1fbW9kZWwyZV9ub0FSLnJkcyIpKQpgYGAKCmBgYHtyfQpnYW1tLm1vZGVsMmUubm9BUiA8LSAKICByZWFkUkRTKCJHYW1tX21vZGVsMmVfbm9BUi5yZHMiKQpgYGAKCmBgYHtyfQpyLmdhbW0ubW9kZWwyZSA8LSBzdGFydF92YWx1ZV9yaG8oZ2FtbS5tb2RlbDJlLm5vQVIpCmBgYAoKYGBge3J9CnN5c3RlbS50aW1lKGdhbW0ubW9kZWwyZSA8LSBiYW0oZjJac2NvcmUyIH4gCiAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIsIGsgPSAxMCkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgYnM9ImNyIiwgayA9IDEwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBicz0iY3IiLCBrID0gMzApICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgaW50ZXJhY3Rpb24gZW50cmUgc21vb3RocwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgOCwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMFpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgOCkpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkoZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoOCwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3QKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MzAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ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ApLCBsZW5ndGg9LjUsIHBvcz0uNzUsIHNpZGU9NCwgbi5zZWcgPSAxLCBpbnNpZGU9RkFMU0UsZm9udCA9IDEsIGNleCA9IDEsIGNvbG9yID0gbWFwY29sc19wYXN0ZWwpCmF4aXMoMSwgYXQ9dGlja3ZhbHMyLCBsYWJlbHM9dGlja25hbWVzMiwgbGFzPTIsIGNleC5heGlzPTEpCmRldi5vZmYoKQoKCmBgYAoKIyMgTW9kZWwgMkY6IC9haS8gZmVtYWxlLCBGMiBhcyBvdXRwdXQKCmBgYHtyfQpzeXN0ZW0udGltZShnYW1tLm1vZGVsMmYubm9BUiA8LSBiYW0oZjJac2NvcmUyIH4gCiAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIsIGsgPSAxMCkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgYnM9ImNyIiwgayA9IDEwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBicz0iY3IiLCBrID0gMzApICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgaW50ZXJhY3Rpb24gZW50cmUgc21vb3RocwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgOCwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMFpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgOCkpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkoZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoOCwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3QKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MzAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSksIAogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgIAogCiAgICAgICAgICAgICAgICAgICAgICBkYXRhPWRhdGEuYWkuZmVtLCBtZXRob2Q9ImZSRU1MIiwgZGlzY3JldGUgPSBUUlVFLCBudGhyZWFkcyA9IG5jb3JlcykKKQpgYGAKCmBgYHtyfQpzYXZlUkRTKGdhbW0ubW9kZWwyZi5ub0FSLCBwYXN0ZSgiR2FtbV9tb2RlbDJmX25vQVIucmRzIikpCmBgYAoKYGBge3J9CmdhbW0ubW9kZWwyZi5ub0FSIDwtIAogIHJlYWRSRFMoIkdhbW1fbW9kZWwyZl9ub0FSLnJkcyIpCmBgYAoKYGBge3J9CnIuZ2FtbS5tb2RlbDJmIDwtIHN0YXJ0X3ZhbHVlX3JobyhnYW1tLm1vZGVsMmYubm9BUikKYGBgCgpgYGB7cn0Kc3lzdGVtLnRpbWUoZ2FtbS5tb2RlbDJmIDwtIGJhbShmMlpzY29yZTIgfiAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIiwgayA9IDEwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBicz0iY3IiLCBrID0gMTApICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIGJzPSJjciIsIGsgPSAzMCkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBpbnRlcmFjdGlvbiBlbnRyZSBzbW9vdGhzCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCA4LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCA4KSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg4LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgcmFuZG9tIGVmZmVjdAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MzAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYX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iwgYnMgPSAiY3IiLCBrID0gYyg1LCA4LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCA4KSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg4LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgcmFuZG9tIGVmZmVjdAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MzAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKIAogICAgICAgICAgICAgICAgIC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AgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBicz0iY3IiLCBrID0gMTApICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIGJzPSJjciIsIGsgPSAzMCkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBpbnRlcmFjdGlvbiBlbnRyZSBzbW9vdGhzCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCA4LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCA4KSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg4LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgcmFuZG9tIGVmZmVjdAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJQ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AgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgOCwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMFpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgOCkpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkoZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoOCwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3QKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MzAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIH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ICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIsIGsgPSAxMCkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgYnM9ImNyIiwgayA9IDEwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBicz0iY3IiLCBrID0gMzApICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgaW50ZXJhY3Rpb24gZW50cmUgc21vb3RocwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgOCwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMFpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgOCkpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkoZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoOCwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3QKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkTGVmdFJpZ2h0VG9uZSwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIG1lYXN1cmVtZW50Lm5vLCBicyA9ICJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBmMFpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MzAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKIAogICAgICAgICAgICAgICAgIC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3RzCgojIyMgVGVzdGluZyBpbXBhY3Qgb2Ygc3BlYWtlciAKCldpdGggb25seSBzcGVha2VyIGFzIHRoZSByYW5kb20gZWZmZWN0LgoKYGBge3J9CnN5c3RlbS50aW1lKFJFc3BlYWtlciA8LSBiYW0oZjFac2NvcmUyIH4gCiAgICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBicz0iY3IiLCBrID0gMTApICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIGJzPSJjciIsIGsgPSAxMCkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgYnM9ImNyIiwgayA9IDMwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIGludGVyYWN0aW9uIGVudHJlIHNtb290aHMKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyByYW5kb20gZWZmZWN0CiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MzAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpLAogCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgIGRhdGE9ZGF0YS5haS5tYXMsIG1ldGhvZD0iZlJFTUwiLCBkaXNjcmV0ZSA9IFRSVUUsIG50aHJlYWRzID0gbmNvcmVzKQopIApgYGAKCiMjIyBUZXN0aW5nIGltcGFjdCBvZiBzcGVha2VyTGVmdFJpZ2h0VG9uZSAKCkFkZCB0aGUgY3Jvc3MgZWZmZWN0OiBzcGVha2VyXCpMZWZ0UmlnaHRUb25lLgoKYGBge3J9CnN5c3RlbS50aW1lKFJFc3BlYWtlckxlZnRSaWdodFRvbmUgPC0gYmFtKGYxWnNjb3JlMiB+IAogICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIiwgayA9IDEwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBicz0iY3IiLCBrID0gMTApICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIGJzPSJjciIsIGsgPSAzMCkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBpbnRlcmFjdGlvbiBlbnRyZSBzbW9vdGhzCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCA4LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCA4KSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg4LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgcmFuZG9tIGVmZmVjdAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAKICAgICAgICAgICAgICAgICAgICAgICAKIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MzAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSwKIAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgIGRhdGE9ZGF0YS5haS5tYXMsIG1ldGhvZD0iZlJFTUwiLCBkaXNjcmV0ZSA9IFRSVUUsIG50aHJlYWRzID0gbmNvcmVzKQopIApgYGAKCiMjIyBUZXN0aW5nIGltcGFjdCBvZiBzcGVha2VyUG9zCgpBZGQgdGhlIHRoZSBjcm9zcyBlZmZlY3Q6IHNwZWFrZXJcKlBvcy4KCmBgYHtyfQpzeXN0ZW0udGltZShSRXNwZWFrZXJQb3MgPC0gYmFtKGYxWnNjb3JlMiB+IAogICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIiwgayA9IDEwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBicz0iY3IiLCBrID0gMTApICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIGJzPSJjciIsIGsgPSAzMCkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBpbnRlcmFjdGlvbiBlbnRyZSBzbW9vdGhzCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCA4LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg1LCA4KSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiLCBrID0gYyg4LCAxMikpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgcmFuZG9tIGVmZmVjdAogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSksCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgZGF0YT1kYXRhLmFpLm1hcywgbWV0aG9kPSJmUkVNTCIsIGRpc2NyZXRlID0gVFJVRSwgbnRocmVhZHMgPSBuY29yZXMpCikgCmBgYAoKYGBge3J9CnNhdmVSRFMoUkVzcGVha2VyUG9zLCBwYXN0ZSgiUkVzcGVha2VyUG9zLnJkcyIpKQpgYGAKCiMjIyBUZXN0aW5nIGltcGFjdCBvZiB3b3JkIGFzIHJhbmRvbSBpbnRlcmNlcHQgYW5kIHJhbmRvbSBzbG9wZSAKCkFkZCB0aGUgcmFuZG9tIGludGVyY2VwdCBhbmQgcmFuZG9tIHNsb3BlIG9mIHdvcmQuIAoKYGBge3J9CnN5c3RlbS50aW1lKFJFd29yZCA8LSBiYW0oZjFac2NvcmUyIH4gCiAgICAgICAgICAgICAgICAgICAgICAgICMgc21vb3RoCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIsIGsgPSAxMCkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgYnM9ImNyIiwgayA9IDEwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyYXRpb25ac2NvcmUyLCBicz0iY3IiLCBrID0gMzApICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgaW50ZXJhY3Rpb24gZW50cmUgc21vb3RocwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgOCwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMFpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoNSwgOCkpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkoZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiwgayA9IGMoOCwgMTIpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIHJhbmRvbSBlZmZlY3QKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlckxlZnRSaWdodFRvbmUsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyTGVmdFJpZ2h0VG9uZSwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpLAogCiAKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICBkYXRhPWRhdGEuYWkubWFzLCBtZXRob2Q9ImZSRU1MIiwgZGlzY3JldGUgPSBUUlVFLCBudGhyZWFkcyA9IG5jb3JlcykKKSAKYGBgCgpgYGB7cn0Kc2F2ZVJEUyhSRXdvcmQsIHBhc3RlKCJSRXdvcmQucmRzIikpCmBgYAoKIyMjIFRlc3RpbmcgaW1wYWN0IG9mIHBvcyBhbmQgbGVmdFJpZ2h0VG9uZSBvbiB3b3JkCgpBZGQgdGhlIGNyb3NzIGVmZmVjdCB3b3JkXCpwb3MgYW5kIHdvcmRcKkxlZnRSaWdodFRvbmUuIAoKVGhpcyBpcyB0aGUgZmluYWwgZnVsbCBtb2RlbC4KCgpgYGB7cn0KUkVmdWxsbW9kZWwgPC0gYmFtKGYxWnNjb3JlMiB+IAogICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBicz0iY3IiLCBrID0gMTApICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIGJzPSJjciIsIGsgPSAxMCkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgYnM9ImNyIiwgayA9IDMwKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAjIGludGVyYWN0aW9uIGVudHJlIHNtb290aHMKICAgICAgICAgICAgICAgICAgICAgICAgdGkobWVhc3VyZW1lbnQubm8sIGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDUsIDgpKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKGYwWnNjb3JlMiwgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIsIGsgPSBjKDgsIDEyKSkgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyByYW5kb20gZWZmZWN0CiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmQsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkUG9zLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZFBvcywgbWVhc3VyZW1lbnQubm8sIGJzID0gInJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRQb3MsIGR1cmF0aW9uWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZExlZnRSaWdodFRvbmUsIGYwWnNjb3JlMiwgYnM9InJlIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKHdvcmRMZWZ0UmlnaHRUb25lLCBkdXJhdGlvblpzY29yZTIsIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyh3b3JkLCBtZWFzdXJlbWVudC5ubywgYnMgPSAicmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZjBac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMod29yZCwgZHVyYXRpb25ac2NvcmUyLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBzcGVha2VyLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgc3BlYWtlciwgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTMwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIHNwZWFrZXIsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0xMCwgbT0xKSArCiAKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgc3BlYWtlclBvcywgYnM9ImZzIiwgeHQgPSBsaXN0KGJzPSJ0cCIpLCBrPTEwLCBtPTEpICsKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIHNwZWFrZXJQb3MsIGJzPSJmcyIsIHh0ID0gbGlzdChicz0idHAiKSwgaz0zMCwgbT0xKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMoZjBac2NvcmUyLCBzcGVha2VyUG9zLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MSkgKwogCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIHNwZWFrZXJMZWZ0UmlnaHRUb25lLCBicz0iZnMiLCB4dCA9IGxpc3QoYnM9InRwIiksIGs9MTAsIG09MS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ZlZHVyYXRpb25hbmRmMCA8LSBiYW0oZjFac2NvcmUyIH4gCiAgICAgICAgICAgICAgICAgICAgICAgICAjIHNtb290aAogICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBicz0iY3IiKSwKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICBkYXRhPWRhdGEuYWkubWFzLCBtZXRob2Q9Ik1MIiwgZGlzY3JldGUgPSBUUlVFLCBudGhyZWFkcyA9IG5jb3JlcykKKSAKYGBgCgpgYGB7cn0Kc2F2ZVJEUyhyZW1vdmVkdXJhdGlvbmFuZGYwLCBwYXN0ZSgicmVtb3ZlZHVyYXRpb25hbmRmMC5yZHMiKSkKYGBgCgojIyMgcmVtb3ZpbmcgaW1wYWN0IG9mIGR1cmF0aW9uCgpgYGB7cn0Kc3lzdGVtLnRpbWUocmVtb3ZlZHVyYXRpb24gPC0gYmFtKGYxWnNjb3JlMiB+IAogICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhmMFpzY29yZTIsIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgaW50ZXJhY3Rpb24gYmV0d2VlbiBzbW9vdGhzCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBicyA9ICJjciIpLAogICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgZGF0YT1kYXRhLmFpLm1hcywgbWV0aG9kPSJNTCIsIGRpc2NyZXRlID0gVFJVRSwgbnRocmVhZHMgPSBuY29yZXMpCikgCmBgYAoKYGBge3J9CnNhdmVSRFMocmVtb3ZlZHVyYXRpb24sIHBhc3RlKCJyZW1vdmVkdXJhdGlvbi5yZHMiKSkKYGBgCgojIyMgcmVtb3ZpbmcgaW1wYWN0IG9mIGYwCgpgYGB7cn0Kc3lzdGVtLnRpbWUocmVtb3ZlZjAgPC0gYmFtKGYxWnNjb3JlMiB+IAogICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgcyhkdXJhdGlvblpzY29yZTIsIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICMgaW50ZXJhY3Rpb24gYmV0d2VlbiBzbW9vdGhzCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZHVyYXRpb25ac2NvcmUyLCBicyA9ICJjciIpLAogICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgZGF0YT1kYXRhLmFpLm1hcywgbWV0aG9kPSJNTCIsIGRpc2NyZXRlID0gVFJVRSwgbnRocmVhZHMgPSBuY29yZXMpCikgCmBgYAoKYGBge3J9CnNhdmVSRFMocmVtb3ZlZjAsIHBhc3RlKCJyZW1vdmVmMC5yZHMiKSkKYGBgCgoKCgojIyMgVGhpcyB0ZXN0cyB5b3VyIGZ1bGwgbW9kZWwKCgpgYGB7cn0Kc3lzdGVtLnRpbWUoZnVsbG1vZGVsIDwtIGJhbShmMVpzY29yZTIgfiAKICAgICAgICAgICAgICAgICAgICAgICAgIyBzbW9vdGgKICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGYwWnNjb3JlMiwgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICBzKGR1cmF0aW9uWnNjb3JlMiwgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIyBpbnRlcmFjdGlvbiBlbnRyZSBzbW9vdGhzCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMFpzY29yZTIsIGR1cmF0aW9uWnNjb3JlMiwgYnMgPSAiY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjBac2NvcmUyLCBicyA9ICJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgdGkoZjBac2NvcmUyLCBkdXJhdGlvblpzY29yZTIsIGJzID0gImNyIiksCiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgZGF0YT1kYXRhLmFpLm1hcywgbWV0aG9kPSJNTCIsIGRpc2NyZXRlID0gVFJVRSwgbnRocmVhZHMgPSBuY29yZXMpCikgCmBgYAoKYGBge3J9CnNhdmVSRFMoZnVsbG1vZGVsLCBwYXN0ZSgiZnVsbG1vZGVsLnJkcyIpKQpgYGAKCmBgYHtyfQpmdWxsbW9kZWwgPC0gCiAgcmVhZFJEUygiZnVsbG1vZGVsLnJkcyIpCmBgYAoKIyMjIGNvbXBhcmVNTAoKCgpgYGB7cn0KY29tcGFyZU1MKHJlbW92ZWR1cmF0aW9uLCBmdWxsbW9kZWwpCmBgYApkdXJhdGlvbiBpcyBzaWduaWZpY2FudAoKYGBge3J9CmNvbXBhcmVNTChyZW1vdmVmMCwgZnVsbG1vZGVsKQpgYGAKCmYwIGlzIHNpZ25pZmljYW50CgpgYGB7cn0KY29tcGFyZU1MKHJlbW92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