Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • System Modeler

    Multidomain modeling and simulation of complex systems

  • Compute ServicesUse with Mathematica and Wolfram|One
  • AI AccessUse with Mathematica and Wolfram|One
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Wolfram|Alpha

  • Wolfram|Alpha Website
  • Wolfram|Alpha APIs

AI Products

  • Wolfram AI Ecosystem
  • Wolfram Foundation Tool
  • Wolfram Cloud MCP
  • Wolfram Local MCP
  • Agent One API
  • CAG Component APIs

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • Linguistic Understanding

Additional Deployment Options

  • Wolfram Cloud
  • Wolfram Web Engine
  • wolframscript
  • WSTPServer
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

Wolfram Consulting

Data Science, Finance & Business

  • Artificial Intelligence
  • Data Science
  • Healthcare
  • Real Estate

Engineering

  • Civil Engineering
  • Automotive Engineering
  • Sustainable Energy

Science & Technology

  • AgTech
  • Biosciences
  • Environmental Science
  • Food Science
  • Quantum Computation
  • Social and Behavioral Sciences

More Wolfram Solutions

Technology for Education

  • Research Universities
  • Colleges & Teaching Universities
  • High Schools
  • Resources for Students

Education Initiatives

  • Next-Gen EdTech
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
For AIs
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • System Modeler
    • Compute ServicesUse with Mathematica and Wolfram|One
    • AI AccessUse with Mathematica and Wolfram|One
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Wolfram|Alpha
      • Wolfram|Alpha Website
      • Wolfram|Alpha APIs
    • AI Products
      • Wolfram AI Ecosystem
      • Wolfram Foundation Tool
      • Wolfram Cloud MCP
      • Wolfram Local MCP
      • Agent One API
      • CAG Component APIs
    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • Linguistic Understanding
    • Additional Deployment Options
      • Wolfram Cloud
      • Wolfram Web Engine
      • wolframscript
      • WSTPServer
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions
    • Wolfram Consulting

    Data Science, Finance & Business

    • Artificial Intelligence
    • Data Science
    • Healthcare
    • Real Estate

    Engineering

    • Civil Engineering
    • Automotive Engineering
    • Sustainable Energy

    Science & Technology

    • AgTech
    • Biosciences
    • Environmental Science
    • Food Science
    • Quantum Computation
    • Social and Behavioral Sciences

    More Wolfram Solutions

    Technology for Education

    • Research Universities
    • Colleges & Teaching Universities
    • High Schools
    • Resources for Students

    Education Initiatives

    • Next-Gen EdTech
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • For AIs
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
LocalModelFit
  • See Also
    • FittedModel
    • KernelModelFit
    • Fit
    • LinearModelFit
    • Interpolation
    • MeanFilter
    • MedianFilter
  • Related Guides
    • Statistical Model Analysis
    • See Also
      • FittedModel
      • KernelModelFit
      • Fit
      • LinearModelFit
      • Interpolation
      • MeanFilter
      • MedianFilter
    • Related Guides
      • Statistical Model Analysis

LocalModelFit[data]

creates a smooth approximation of data.

LocalModelFit[data,bw]

approximates data using the bandwidth bw.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Applications  
Sparse Data  
See Also
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • FittedModel
    • KernelModelFit
    • Fit
    • LinearModelFit
    • Interpolation
    • MeanFilter
    • MedianFilter
  • Related Guides
    • Statistical Model Analysis
    • See Also
      • FittedModel
      • KernelModelFit
      • Fit
      • LinearModelFit
      • Interpolation
      • MeanFilter
      • MedianFilter
    • Related Guides
      • Statistical Model Analysis

LocalModelFit

LocalModelFit[data]

creates a smooth approximation of data.

LocalModelFit[data,bw]

approximates data using the bandwidth bw.

Details and Options

  • LocalModelFit, also known as LOESS and adaptive smoothing, creates an approximation of a dataset using local polynomial fitting.
  • Local fitting is typically used for data smoothing in time series analysis, noise reduction in scientific measurements and trend analysis in economic data to reveal underlying patterns without overfitting.
  • For every sample point, the local fitting mechanism involves fitting a low-degree polynomial to a subset of data. Combining the fitted polynomials forms a continuous approximation of the entire dataset.
  • The bandwidth parameter bw determines the scale of locality, where smaller values emphasize local features and larger values smooth out broader trends.
  • For maximum precision, the fit can be computed at every sample point. For faster evaluation, the fit can be precomputed on a fixed number of samples, while the rest is obtained via interpolation.
  • Possible forms of data are:
  • {y1,y2,…}equivalent to the form {{1,y1},{2,y2},…}
    {{x11,x12,…,y1},…}a list of independent values xij and the responses yi
    {{x11,x12,…}y1,…}a list of rules between input values and responses
    {{x11,x12,…},…}{y1,y2,…}a rule between a list of input values and responses
    {{x11,…,y1,…},…}nfit the n^(th) column of a matrix
    Tabular[…]namefit the column name in a tabular object
  • Possible values for bw are:
  • dan absolute size d
    Scaled[f]a fraction f of the points in data
  • The following options can be given:
  • ComputeUncertaintyTruewhether to compute confidence bands
    DistanceFunctionEuclideanDistancethe distance metric to use
    FitDegree1degree of the polynomial interpolation
    InterpolationPointsAutomaticwhere the function should be interpolated
  • The value of FitDegree controls the degree of the polynomial interpolation.
  • The value of InterpolationPoints determines the number and placement of the interpolation points.
  • Possible settings for InterpolationPoints include:
  • Automaticautomatically determine the sampling points (default)
    Allsample on data
    nuse n equally spaced points
    {x1,…}explicit univariate values
    {{x11,…},…}explicit multivariate values
    Nonedo not interpolate
  • With InterpolationPointsNone, the actual fit is computed when evaluating the FittedModel.
  • Properties
  • The properties and diagnostics of the FittedModel can be obtained from model["property"].
  • Properties related to the fitted function include:
  • {"BestFit",vars}fitted function at vars
    {"BestFitAround",vars}fitted function with confidence intervals at vars
    {"BestFitDataAround",vars}fitted function with prediction intervals at vars
    "Function"best-fit interpolating function
  • Properties related to data include:
  • "Data"the input data or design matrix and response vector
    "DesignMatrix"design matrix for the model
    "Response"response values in the input data
  • Properties of predicted values include:
  • "FitResiduals"difference between actual and predicted responses
    {"MeanPredictionBands",vars}confidence bands for mean predictions at vars
    "MeanPredictions"confidence intervals for the mean predictions
    "PredictedResponse"fitted values for the data
    {"SinglePredictionBands",vars}confidence bands based on single observations at vars
    "SinglePredictions"confidence intervals for a single predicted response
  • Use model["Properties"] to obtain a list of all the supported properties.

Examples

open all close all

Basic Examples  (1)

Create a smooth interpolation from a dataset:

Wolfram Language code: data = {...};
Wolfram Language code: trend = LocalModelFit[data]
Wolfram Language code: Show[ListPlot[data], Plot[trend[x], {x, 0, 2Pi}, PlotRange -> All, PlotStyle -> Red], PlotRange -> All]

Scope  (5)

Specify different smoothing bandwidths:

Wolfram Language code: Plot[Evaluate@Table[LocalModelFit[{...}, bw][{"BestFit", x}], {bw, {.2, .5, 2}}], {x, 0, 2Pi}, PlotLegends -> {.2, .5, 2}]
Wolfram Language code: Plot[Evaluate@Table[LocalModelFit[{...}, Scaled[bw]][{"BestFit", x}], {bw, {.1, .3, .7}}], {x, 0, 2Pi}, PlotLegends -> {.2, .5, 2}]

Compute fit uncertainties:

Wolfram Language code: fit = LocalModelFit[{...}]
Wolfram Language code: ListPlot[Table[fit[{"BestFitAround", x}], {x, 0, 2Pi, .1}], IntervalMarkers -> "Bands"]

Compute an interpolation at specific points:

Wolfram Language code: data = {...}; smooth = LocalModelFit[data, InterpolationPoints -> Range[0, 2Pi, .2]];
Wolfram Language code: ListPlot[{data, Table[{x, smooth[x]}, {x, 0, 6, .1}]}, Joined -> {False, True}]

Compute a model that can be supports runtime fitting at specific points:

Wolfram Language code: data = {...};
Wolfram Language code: model = LocalModelFit[data, InterpolationPoints -> None]
Wolfram Language code: Show[ListPlot[data], Plot[model[x], {x, 0, 2Pi}, PlotPoints -> 20]]

Interpolate 2D points:

Wolfram Language code: data = Flatten[Table[{x, y, Sin[x]Sqrt@y Cos[y] + 0.1 RandomVariate[NormalDistribution[0, 5]]}, {x, 0, 6, 0.2}, {y, 0, 6, 0.2}], 1];
Wolfram Language code: ListPointPlot3D[data]

Build a smoothed version of the dataset on the sampling grid:

Wolfram Language code: smoothdata = LocalModelFit[data]
Wolfram Language code: Show[ListPointPlot3D[data], Plot3D[smoothdata[{x, y}], {x, 0, 6}, {y, 0, 6}]]

Applications  (1)

Sparse Data  (1)

Test the regression on a a sparse sub-sampling of a dataset:

Wolfram Language code: data = {...};
Wolfram Language code: ListPointPlot3D[data]
Wolfram Language code: sample = RandomSample[data, 50];
Wolfram Language code: ListPointPlot3D[sample]

Build a small, regular sampling grid:

Wolfram Language code: grid = Flatten[Table[{x, y}, {x, 0, 6, .2}, {y, 0, 6, .2}], 1];
Wolfram Language code: ListPlot[grid]

Approximate the data samples on the grid point:

Wolfram Language code: approx = LocalModelFit[sample, 2, InterpolationPoints -> grid];

Compare a contour plot of the original data, the sample and the sample approximation:

Wolfram Language code: ListContourPlot /@ {data, sample}
Wolfram Language code: ContourPlot[approx[x, y], {x, 0, 6}, {y, 0, 6}]

See Also

FittedModel  KernelModelFit  Fit  LinearModelFit  Interpolation  MeanFilter  MedianFilter

Related Guides

    ▪
  • Statistical Model Analysis

History

Introduced in 2025 (14.3)

Wolfram Research (2025), LocalModelFit, Wolfram Language function, https://reference.wolfram.com/language/ref/LocalModelFit.html.

Text

Wolfram Research (2025), LocalModelFit, Wolfram Language function, https://reference.wolfram.com/language/ref/LocalModelFit.html.

CMS

Wolfram Language. 2025. "LocalModelFit." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LocalModelFit.html.

APA

Wolfram Language. (2025). LocalModelFit. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LocalModelFit.html

BibTeX

@misc{reference.wolfram_2026_localmodelfit, author="Wolfram Research", title="{LocalModelFit}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/LocalModelFit.html}", note=[Accessed: 01-September-2026]}

BibLaTeX

@online{reference.wolfram_2026_localmodelfit, organization={Wolfram Research}, title={LocalModelFit}, year={2025}, url={https://reference.wolfram.com/language/ref/LocalModelFit.html}, note=[Accessed: 01-September-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • AI Access
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English