# fig2_4

## PURPOSE

Local Regression and Likelihood, Figure 2.4.

## SYNOPSIS

This is a script file.

## DESCRIPTION

     Local Regression and Likelihood, Figure 2.4.

     Bivariate Local Regression.

## CROSS-REFERENCE INFORMATION

This function calls:

- lfplot Plot (for one or two dimensions) a locfit() fit.
- locfit Smoothing noisy data using Local Regression and Likelihood.

This function is called by:

- runbook

## SOURCE CODE

    0001 % Local Regression and Likelihood, Figure 2.4.
    0002 %
    0003 % Bivariate Local Regression.
    0004
    0005 load ethanol;
    0006
    0007 alp = [0.25 0.3 0.49 0.59];
    0008 lab = {'Local Constant' 'Local Linear' 'Local Quadratic' 'Local Cubic'};
    0009 f=['a','b','c','d'];
    0010 for (i=1:4)
    0011   figure('Name', sprintf( 'figure2_4%c: Bivariate local regression', f(i) ) );
    0012     fit = locfit(E,NOx,'deg',i-1,'alpha',alp(i));
    0013     lfplot(fit);
    0014     title(lab(i));
    0015 end;