fit_PB | R Documentation |
The function fit_PB()
fits a P-spline univariate smoother [Eilers and Marx (1996)] to y
against the x
with prior weights weights
.
fit_PB(x, y, weights, data, xmin, xmax, nseg = 20,
lambda = 10, order = 2, degree = 3, max.df = 20,
ylim, plot = TRUE, col.ribbon = "pink")
x |
the explanatory variable |
y |
the response |
weights |
possible prior weights (set to one by default) |
data |
the data frame where |
xmin |
the |
xmax |
the |
nseg |
the number of knots |
lambda |
the smotthing parameter |
order |
the ordr of the difference |
degree |
the degree of the piewise polynonmial |
max.df |
the maximum allowed degress of freedom |
ylim |
the |
plot |
whether to plot the results |
col.ribbon |
the color in the se of the fitted values |
A object Psplines
is produced with methods print()
, coef()
deviance()
, fitted()
, predict()
and resid().
The functionfit_PB()
is an engine for getting the maximal correlation between two continuous variables. It can be also
used on its own as a smoother.
Mikis Stasinopoulos
Eilers, P. H. C. and Marx, B. D. (1996). Flexible smoothing with B-splines and penalties (with comments and rejoinder). Statist. Sci, 11, 89-121.
Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019) Distributions for modeling location, scale, and shape: Using GAMLSS in R, Chapman and Hall/CRC. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1201/9780429298547")}.
Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) Flexible Regression and Smoothing: Using GAMLSS in R, Chapman and Hall/CRC. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1201/b21973")}
Stasinopoulos, M.D., Kneib, T., Klein, N., Mayr, A. and Heller, G.Z., (2024). Generalized Additive Models for Location, Scale and Shape: A Distributional Regression Approach, with Applications (Vol. 56). Cambridge University Press.
(see also https://www.gamlss.com/).
ACE
data(abdom)
m1 <- fit_PB(x,y, data=abdom)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.