I would like to know how can I be able to interpret the results from fitting splines with the
My data points are taken from the
chileancredit dataset available in the package
Here are my
y data points:
library("scam") library("zoo") data(chileancredit, package = "smbinning") chilean_clean <- na.omit(chileancredit) x <- unique(sort(chilean_clean$TOB[1000:length(chilean_clean$TOB)])) y_mav <- rollmean(chilean_clean$FlagGB, k = 1000) y <- y_mav[(length(y_mav)-length(x)+1):length(y_mav)]
y is the moving average of a binary target variable.
scam function I could fit a convex spline to my datapoints (I specified 5 parameters in total):
spline_fit <- scam(y~ s(x,k=5,bs="cx",m=2), family=gaussian(link="identity"), data=as.data.frame(x=x,y=y))
However, the five coefficients I could get from
scam, I'm having trouble interpreting them:
(Intercept) s(x).1 s(x).2 s(x).3 s(x).4 0.9275358 -4.3564887 -4.8378830 -4.8522646 -4.8950387
The first term is the intercept, however I've lookup up in the results of
scam for knots or cuts - seems like there is none. I don't know how I could interpret the smoothing parameters without the knots. Anyone has any idea? Thanks.