I am using the R library mgcv
The gam function returns an object with the edf1
value
> g = gam(y~s(x, k = 10, bs = "cr"), data = data, scale = 1)
> g$edf1
(Intercept) s(x).1 s(x).2 s(x).3 s(x).4 s(x).5 s(x).6 s(x).7 s(x).8
1.0000000 0.2417857 0.4744928 0.4667241 0.4347516 0.4107624 0.4136064 0.4288544 0.5315970
s(x).9
0.5941861
>
I need to understand how this value is computed and so I am reading the code of the gam()
function.
Inside gam()
the result is obtained by another function
object <- estimate.gam(G, method, optimizer, control, in.out,
scale, gamma, ...)
The problem is that I can not access to the estimate.gam()
function
> estimate.gam
Error: object 'estimate.gam' not found
>
How can I solve this?
You can download the source code and inspect the files. The function estimate.gam
is stored in the R subdirectory in the file mgcv.r
.