Nonparametric Regression

Motorcycle accident data

A series of 133 measurements of head acceleration in a simulated motorcycle accident, used to test crash helmets.

times – time in milliseconds after impact

accel – acceleration in g

Seismic signal

Kernel Estimation

Different types of kernels

Simulated (polynomial) example

      nw = npreg(y~xx,ckertype="epanechnikov",bws=0.01)
      plot(xx,nw$mean,type="l",xlab=" ",ylab=" ",col="red")
        lines(xx, f, lty=2,col="blue")
      points(xx,y,pch="*")
      title("Epanechnikov kernel (b=0.01)")

      nw = npreg(y~xx,ckertype="epanechnikov",bws=.1)

      nw.ep=npreg(y~xx,ckertype="epanechnikov")
## 
Multistart 1 of 1 |
Multistart 1 of 1 |
Multistart 1 of 1 |
Multistart 1 of 1 /
Multistart 1 of 1 |
Multistart 1 of 1 |
                   

## 
## Regression Data: 75 training points, in 1 variable(s)
##                       xx
## Bandwidth(s): 0.04571446
## 
## Kernel Regression Estimator: Local-Constant
## Bandwidth Type: Fixed
## 
## Continuous Kernel Type: Second-Order Epanechnikov
## No. Continuous Explanatory Vars.: 1
      nw.un=npreg(y~xx,ckertype="uniform")
## 
Multistart 1 of 1 |
Multistart 1 of 1 |
Multistart 1 of 1 |
Multistart 1 of 1 /
Multistart 1 of 1 |
Multistart 1 of 1 |
                   

## 
## Regression Data: 75 training points, in 1 variable(s)
##                       xx
## Bandwidth(s): 0.09876352
## 
## Kernel Regression Estimator: Local-Constant
## Bandwidth Type: Fixed
## 
## Continuous Kernel Type: Uniform
## No. Continuous Explanatory Vars.: 1
      nw.lin=npreg(y~xx,ckertype="epanechnikov", regtype="ll")
## 
Multistart 1 of 1 |
Multistart 1 of 1 |
Multistart 1 of 1 |
Multistart 1 of 1 /
Multistart 1 of 1 |
Multistart 1 of 1 |
                   

## 
## Regression Data: 75 training points, in 1 variable(s)
##                       xx
## Bandwidth(s): 0.06647777
## 
## Kernel Regression Estimator: Local-Linear
## Bandwidth Type: Fixed
## 
## Continuous Kernel Type: Second-Order Epanechnikov
## No. Continuous Explanatory Vars.: 1
## MSE, Epanechnikov kernel= 0.165 MSE, uniform kernel= 1.6675 MSE, Epanechnikov local linear regression 0.4065