1

I am attempting to use the 'scam' R package to carry out posterior simulation.

I am relying on

Can I use bootstrapping to estimate the uncertainty in a maximum value of a GAM?

for guidance.

My routine works for GAMs using vcov() to extract the variance-covariance matrix, but vcov() does not work for a scam object.

Any ideas on how to get the routine to work for SCAMs?

Any advice is warmly welcomed.

Sven Hohenstein
  • 6,285
  • 25
  • 30
  • 39
compbiostats
  • 1,017
  • 9
  • 18

1 Answers1

1

This is due to some missing methods in the scam package. I have implemented vcov and coef for SCAMs in my tsgam package: https://github.com/gavinsimpson/tsgam/blob/master/R/other-scam-methods.R

I've used those to do the posterior simulation you describe.

Gavin Simpson
  • 37,567
  • 5
  • 110
  • 153
  • I am noticing some strange behaviour with the generated Cis for SCAMs. Sometimes I get intervals such as (100, 100). Is this due to the routine or something else? I am doing this with simulated data with very little noise (essentially boiling down to interpolation rather than smoothing). Any ideas on a fix for the CIs? – compbiostats Dec 09 '17 at 22:27
  • Is this related to your Q today where you're actually doing something quite different to what is described above? (There you are trying to find X given Y after fitting model Y ~ X.) I'd double check that the model is working well and that you can do reasonable simulation from the estimated model. If you have little variance there may be a tendency to overfit - I've seen examples posted here that performed poorly - and that bias was the root of subsequent problems with simulation/simultaneous intervals etc. – Gavin Simpson Dec 11 '17 at 18:09
  • Yes, the question above (posterior estimation with GAMs/SCAMs) is related to to my question asked today. I'm using inverse estimation to find X given Y. Bootstrapping is slow and gives strange output (e.g. negative values in the CIs, when clearly plausible values for the parameter must be positive). Posterior simulation with your approach gives the same value for the upper and lower CI limits... Perhaps this is due to using the default Gaussian family (instead of a different distribution with strictly positive support)? – compbiostats Dec 11 '17 at 18:26
  • Yes, my simulated data are not very noisy, so variance is quite tight. I'm somewhat at a standstill, since CIs aren't behaving nicely. i could just report the standard error... – compbiostats Dec 11 '17 at 18:29