# lfmarg

## PURPOSE

computes grid margins from a locfit object, used for plotting.

## SYNOPSIS

function xfit = lfmarg(fit)

## DESCRIPTION

     computes grid margins from a locfit object, used for plotting.
     this function is called from lfplot and lfband, will not normally
     be called directly by users.

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

- fig6_1 Local Regression and Likelihood, Figure 6.1.
- fig7_5 Local Regression and Likelihood, Figure 7.5.
- fig7_6 Local Regression and Likelihood, Figure 7.6.
- lfband adds confidence bands around the plot of a locfit() fit.
- lfplot Plot (for one or two dimensions) a locfit() fit.
- den_jack Function to compute smooth estimates of the mean of x using locfit,

## SOURCE CODE

    0001 function xfit = lfmarg(fit)
    0002
    0003 % computes grid margins from a locfit object, used for plotting.
    0004 % this function is called from lfplot and lfband, will not normally
    0005 % be called directly by users.
    0006
    0007 box = fit.fit_points.fit_limits;
    0008 d = size(box,1);
    0009 xfit = cell(1,d);
    0010 mg = 10*ones(1,d);
    0011 if (d==1) mg = 200; end;
    0012 if (d==2) mg = [51 50]; end;
    0013 for i=1:d
    0014     xfit{i} = box(i,1) + (box(i,2)-box(i,1))*(0:mg(i))'/mg(i);
    0015 end;
    0016
    0017 return;