Error with gamsel R package

I am trying to use the gamsel R package to fit a sparse generalized additive model, and I cannot get it to work with real data. When I run synthetic data, as described in the package documentation, everything works fine:

library(gamsel)
data=gendata(n=500,p=12,k.lin=3,k.nonlin=3,deg=8,sigma=0.5)
attach(data)
bases=pseudo.bases(X,degree=10,df=6)
gamsel.out=gamsel(X,y,bases=bases)

But when I run the real data, I get the following error:

library(gamsel)
X = as.matrix(read.csv("X.csv"),header=FALSE)
y = as.matrix(read.csv("y.csv"),header=FALSE)
gam_fit = gamsel(X,y)

Error in if (abs ((df - current.df) / df) <1e-04 | iteration == 1) return (list (lambda = lambda ,: missing value, where TRUE / FALSE is necessary

You can access sample data data that will reproduce this result here . Any thoughts on how to fix this error?

+4
source share

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


All Articles