Description Usage Arguments Value Examples
View source: R/PartialSplines.R
PartialSplines function allows you to estimate a model where the linear relationship between the response variable and the explanatory ones is summarized by coefficients Beta; on the other hand, coefficients Delta explain the unspecified functional relationship between y and the spline variable 'tx'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
y |
response variable, must be a vector |
x |
data frame of explanatory variables |
tx |
spline variable, must be a vector |
prop.knots |
proportion of nodes to be interpolated, if NULL the value will be estimated through cross validation |
intercept |
if model has to be estimated with an intercept |
n.basis |
number of basis for estimating the B-spline |
alpha |
tuning parameter for the bending of the spline, if NULL the value will be estimated through cross validation |
tol |
tolerance parameter |
b.start |
initial values for beta parameters |
d.start |
initial values for delta parameters |
trace |
if TRUE, information is printed during the running of optimization process |
max.iter |
maximum number of iterations |
r |
sequence of values form which the basis will be estimated. It mainly has an internal use, it's advisable to not change it |
PartialSplines return an object of class "PSM" which is a list containing several objects
beta - optimal estimates of linear parameters
delta - optimal estimates of spline parameters
call - call of the function
Z - matrix Z of spline coefficients
y - response variable
X - model matrix of linear variables
tx - spline variable
data - data frame of input explanatory varibales
r - vector of points in which basis functions were calculated
K - matrix used in backfitting
time - execution time
iter - number of iteration until convergence
alpha - value of alpha used
prop.knots - proportion of nodes interpolated
details - list containing other elements for internal use
1 2 3 4 5 | x <- data.frame(x = rnorm(100))
tx <- rnorm(100)
eps <- rnorm(100)
y <- x[,1] + tx^4 + eps
psm <- PartialSplines(y, x, tx)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.