Extract auto-generated nodes mgcv package r

Is there a way to identify the number and position of nodes when using gam in the mgcv package in r? So I have something like this:

fit.add <- gam( rep.pos ~ 0 + factor(AY) + s(dur), family=quasipoisson(link='log')
          , data=incur.agg)

And I want to find where this placed the nodes so that I can use them here

dur.knots <- c(6,10)
dur.df <- length(dur.knots) + 1
dur.spline <- ns( dur.start:max.dur, knots=dur.knots )

and save a lot of time on trial and error with how many nodes and where they should be in order to best fit.

Thanks for the help.

+4
source share

Source: https://habr.com/ru/post/1524594/


All Articles