mfasiolo / gamFactory

Tools for building new GAM models in mgcv
14 stars 2 forks source link

Initialising nested expsmooth effects #16

Open mfasiolo opened 11 months ago

mfasiolo commented 11 months ago

At the moment a nested exponential smooth effect is initialised at the first observation. It is not possible to provide an initialisation externally. The big issue is what to do in predict when newdata = TRUE. In fact, if we do (say)

mu1 = predict(model, newdata = some_data)

mu2 = predict(model, newdata = some_data[-1:10])

Then mu1[-(1:10)] != mu2 because the inner exponential smooths are initialised respectively at x[1] and x[11]. This can be a real problem when producing forecasts!