Advanced topics
David L Miller & Jason J Roberts
This is a whirlwind tour...
...and some of this is experimental
Cyclic smooths
- What if things “wrap around”? (Time, angles, …)
- Match value and derivative
- Use
bs="cc"
- See
?smooth.construct.cs.smooth.spec

Duchon splines
- Thin plate splines do weird things far from data
- Local bits are fine, but unpenalised planes are bad
- Remove the badly behaved bits?
- (Miller and Kelly, in prep)
?smooth.construct.ds.smooth.spec

Smoothing in complex regions
- Edges are important
- Whales don't live on land
- Bad things happen when we don't account for this

"Finite area" smoothing
- Soap film smoothing is one solution
- Include boundary info in smoother
- Basis functions are “correct” by construction
?smooth.construct.so.smooth.spec

Multivariate smooths
- Thin plate splines are isotropic
- 1 unit in any direction is equal
- Fine for space, not for other things
Tensor products
- Take smooths of each covariate
- \( s_{x,z}(x,z) = \sum_{k_1}\sum_{k_2} \beta_k s_x(x)s_z(z) \)
- As many covariates as you like! (But takes time)
te()
can be used like s()
in mgcv

Example of tensors being used
Random effects
- (independent) normal random effects
- exploits equivalence of random effects and splines
?gam.vcomp
- useful when you just have a “few” random effects
?smooth.construct.re.smooth.spec
Spatial autocorrelation
- \( \text{AR}(p) \) process (“obvious” structure)
- In general this is unstable
- Random effects are sparse but splines are “dense”
- \( \Rightarrow \) bad for optimisation
engine="gamm"
& correlation=...

Temporal effects
- Could do tensor product space-time?
- Can marginalise other terms - time trends
- Does anyone have such long term data?
Parallel processing
- Some models are very big/slow
- Run on multiple cores
- Use
engine="bam"
!
- Some constraints in what you can do
- Experimental, but potentially useful
Which covariates should we include?
- Dynamic vs static variables
- Spatial terms? Habitat models?
Over to Jason and Laura...