dewittpe / cpr

Control Polygon Reduction: Methods for quick and efficient placement of internal knots for B-splines and tensor products of B-splines.
http://www.peteredewitt.com/cpr/
2 stars 0 forks source link

model_call #9

Closed dewittpe closed 8 years ago

dewittpe commented 8 years ago

See idea noted in issue #8

The model_call function will return a call to fit a regression model. The end user will then be able to evaluate the call to get all the wanted parts of a regression model.

dewittpe commented 8 years ago

This is not a needed feature. In cpr::cp the user has the option to keep_fit. If the user want's to have the regression model they need to do something like this:

initial_cp <- cp(y ~ bsplines(x, df = 20), data = a_data_frame, keep_fit = TRUE)
initial_cp$fit

If the default was used, i.e., keep_fit = FALSE, the user can get the regression model via:

initial_cp <- cp(y ~ bsplines(x, df = 20), data = a_data_frame)
initial_cp <- update(initial_cp, keep_fit = TRUE)
initial_cp$fit