LOCFIT


Using with Matlab

The Matlab version of Locfit is being developed in conjunction with Peter Andrews, at the Mitra Lab, Cold Spring Harbor Laboratories. It is currently distributed with the Chronux software developed and distributed by the Mitra Lab.

Or, download here:

  1. mlocfit.zip, Locfit version 1.5 with binary mex files for Windows (.dll) and Linux (.mexglx). Unpack, add the mlocfit folder and subfolders to your matlab path, and it should be ready to go.
  2. Locfit 2.0 source.
  3. Locfit 2.0 Linux binary. See the binary installation page for details.
To install from source, you need to set a MATLABROOT environment variable, and run the install.matlab script:
cd locfit-2.01
MATLABROOT=/usr/local/lib/matlab export MATLABROOT
./install.matlab
Note that you'll need write privileges to /usr/local/lib and $MATLABROOT/toolbox.

If you're willing to try compilation of the mex files on other platforms, please let me know.

As of version 1.0 of chronux, nearly all of Locfit's functionality is working in matlab. The commands are similar to the R version of locfit, but using Matlab's syntax. For example,

load ethanol;         % load the dataset.
fit = locfit(E,NOx)   % local regression, with x,y vectors.
lfplot(fit)           % plot the fitted curve.
Optional arguments are given as 'name','value' pairs, for example,
fit = locfit(E,NOx,'nn',0.4)
specifies a nearest neighbor bandwidth.