## Simulate some data and fit using default settings
set.seed(1234)
t <- runif(1000, -10, 10)
y <- 2*sin(t) + -0.06*t^2 + rnorm(length(t))
model_fit <- lgspline(t, y)
## Extract coefficients
coefficients <- coef(model_fit)
## Print coefficients for first partition
print(coefficients[[1]])
## Compare coefficients across all partitions
print(Reduce('cbind', coefficients))
Run the code above in your browser using DataLab