I am trying to fit a GAMM containing per subject random smooths using the bam function in mgcv as follows:
peri.gam0 <- bam(global_intDTmc ~
s(time) + s(time,subject,bs="fs",m=1),
data=pd_intdft,
rho=ar1_est,AR.start=pd_intdft$AR.start)
Essentially I am asking how an outcome variable is modulated over time. When I examine the model for concurvity, I find strong asymmetric concurvity between time and the random smooths for time by subject.
> concurvity(peri.gam0,full=F)
$worst
para s(time) s(time,subject)
para 1.0000000000 0.0001078526 1
s(time) 0.0001078526 1.0000000000 1
s(time,subject) 1.0000000000 1.0000000000 1
$observed
para s(time) s(time,subject)
para 1.0000000000 0.0000078301 3.902321e-05
s(time) 0.0001078526 1.0000000000 1.582554e-03
s(time,subject) 1.0000000000 0.9997973359 1.000000e+00
$estimate
para s(time) s(time,subject)
para 1.0000000000 2.111176e-05 0.01243370
s(time) 0.0001078526 1.000000e+00 0.02048989
s(time,subject) 1.0000000000 9.982492e-01 1.00000000
Additionally, when I look at the variance components for the smooth terms, the confidence interval for the second entry for the random smooths is quite inflated [though I don't understand what each entry for the s(time,subject) represents]:
std.dev lower upper
s(time) 0.0028562260 1.165445e-03 6.999925e-03
s(time,subject)1 0.0027823396 2.099721e-03 3.686877e-03
s(time,subject)2 0.0000152669 8.981685e-36 2.595040e+25
scale 0.0175509339 1.731947e-02 1.778549e-02
So I am wondering:
1) Is it inevitable that there will be this sort of asymmetric concurvity in the presence of random smooths, or is this a sign of a problem?
2) What does each entry for s(time,subject) output by gam.vcomp represent, and is the inflated CI for the second entry also indication of problems w/ identifiability in this model?
EDIT: In the model above, the outcome variable is mean-centered for every trial in the data. Using the original variable w/o mean-centering removes the issue w/ gam.vcomp on the second variance component for s(time,subject), so I assume that this corresponds to by-subject random intercepts?