Code covered by the BSD License  

Highlights from
Local Linear Kernel Regression

4.8

4.8 | 5 ratings Rate this file 45 Downloads (last 30 days) File Size: 2.44 KB File ID: #19564
image thumbnail

Local Linear Kernel Regression

by Yi Cao

 

12 Apr 2008 (Updated 14 Apr 2008)

A function to provide local linear estimator of Gaussian kernel regression

| Watch this File

File Information
Description

This is the local linear version of the kernel smoothing regression function: http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=19195&objectType=FILE

The local linear estimator improves the regression behaviour near the edges of the region over which the data have been collected.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Kernel Smoothing Regression

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
29 Aug 2008 Roderick Knuiman

Nice and quite useful. Thanks. A possible extension might be to incorporate any possible degree for the polynomial.

02 Sep 2008 Roderick Knuiman

Hi,
I just reworked your code just a little bit;
- include one more input argument for degree p;
- use polyfit3.m for the local fitting of the polynomial of degree p (with same weights)

And you get a local polynomial smoother of arbitrary degree p.

02 Sep 2008 Badger Emily

Thank you for the excellent work. I have a quick question: how did you choose the optimal bandwidth? Page 31 in Bowman and Azzalini is about density fitting, right? But the result from your bandwidth is pretty good. Any theory on that? thanks again.

03 Sep 2008 Yi Cao

Dear Badger Emily,

You are right. The optimal bandwidth was taken from the book

Bowman, A. W., and A. Azzalini, Applied Smoothing Techniques for Data Analysis, Oxford University Press, 1997.

On page 31 of the book, section 2.4.2 Normal optimal smoothing, it gives h = (4/3n)^1/5 sigma and sigma is given on the same page:
sigma = median{|y-mu|}/0.6745

HTH
Yi

03 Sep 2008 Emily Badger

Thanks for your reply. I know it is taken from there. But my question is that bandwidth is for density estimation purpose, not for regression purpose like in this "local linear kernel regression" case. The bandwidth in the code reads h=sqrt(hx*hy) where hx and hy are calculated the way in the book. This has no direct reference, right? However, this unjustified bandwidth works pretty well. It must have some theoretical ground, what is it? Thanks a lot.

05 Apr 2009 V. Poor  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
statistics Yi Cao 22 Oct 2008 09:57:38
probability Yi Cao 22 Oct 2008 09:57:38
kernel smoothing Yi Cao 22 Oct 2008 09:57:38
local Yi Cao 22 Oct 2008 09:57:38
nonparametric regression Yi Cao 22 Oct 2008 09:57:38
kernel regression Yi Cao 22 Oct 2008 09:57:38
local Robert 18 Dec 2009 01:23:00

Contact us at files@mathworks.com