File: sin_cv.q

package info (click to toggle)
sm 2.0.14-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 992 kB
  • ctags: 26
  • sloc: fortran: 133; sh: 28; makefile: 13
file content (12 lines) | stat: -rw-r--r-- 257 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
n <- 50
x <- seq(0, 1, length = n)
m <- sin(2 * pi * x)
h <- 0.05
sigma <- 0.2
y <- rnorm(n, m, sigma)
par(mfrow=c(1,2))
h.cv <- hcv(x, y, display="lines", ngrid=32)
plot(x, y)
lines(x, m)
sm.regression(x, y, h=hcv(x, y), add=TRUE, lty=2)
par(mfrow=c(1,1))