# fig2_6

## PURPOSE

Local Regression and Likelihood, Figure 2.6.

## SYNOPSIS

This is a script file.

## DESCRIPTION

     Local Regression and Likelihood, Figure 2.6.

     Influence and variance functions.

## 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.
- vecr

This function is called by:

- runbook

## SOURCE CODE

    0001 % Local Regression and Likelihood, Figure 2.6.
    0002 %
    0003 % Influence and variance functions.
    0004
    0005 load ethanol;
    0006 d = [2 3];
    0007 a = [0.49 0.59];
    0008 main = {'Local Quadratic','Local Cubic'};
    0009 f=['a','b'];
    0010 for (i=1:2)
    0011   figure('Name', sprintf( 'figure2_6%c: Influence and variance functions', f(i) ) );
    0012   fit = locfit(E,NOx,'nn',a(i),'deg',d(i),'ev','grid','mg',100);
    0013   vecr(fit)
    0014   plot(E,zeros(88,1),'o');
    0015   title(main{i});
    0016   hold on;
    0017   lfplot(fit,'what','infl');
    0018   lfplot(fit,'what','vari','--');
    0019   xlabel('Equivalence Ratio');
    0020   ylabel('Influence');
    0021   legend('Data','Influence Function','Variance Function');
    0022   hold off;
    0023 end;