Description Usage Arguments Details Value Author(s) References See Also Examples
This function demonstrate some characteristics of local regression Smoothing
1 2 3 4 5 6 7 |
y |
The response variable |
x |
the explanatory variable |
span |
The smoothing parameters |
sd |
The standard deviation of a normal kernel used as smoothing parameter |
position |
The position of the target values in the x axis |
w |
weights |
deg |
The degree of the local polynomial |
The function demo.LocalRegression
demonstrates some aspects of the Local (unweighed) polynomial regression. The functions LPOL()
and WLPOL()
produce plots related to unweighed and weighted local polynomial regression respectively.
All function produce plots.
Mikis Stasinopoulos
R Development Core Team (2010) tcltk package, CRAN.
Bowman, Bowman, Gibson and Crawford (2008) rpanel, CRAN
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507-554.
Stasinopoulos D. M., Rigby R.A. and Akantziliotou C. (2006) Instructions on how to use the GAMLSS package in R. Accompanying documentation in the current GAMLSS help files, (see also http://www.gamlss.org/).
Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R. Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, http://www.jstatsoft.org/v23/i07.
See also demoDist
, gamlss.demo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | demo.LocalRegression()
n <- 100
x <- seq(0, 1, length = n)*1.4
y <- 1.2 + .3*sin(5 * x) + rnorm(n) * 0.2
op <- par(mfrow=c(2,2))
LPOL(y,x, deg=0, position=5)
title("(a) moving average")
LPOL(y,x, deg=1, position=75)
title("(b) linear poly")
WLPOL(y,x, deg=2, position=30)
title("(c) quadratic poly")
WLPOL(y,x, deg=3, position= 50)
title("(b) cubic poly")
par(op)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.