# Machine Learning: Gaussian Process Regression

Machine Learning: Gaussian Process Regression is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

Applies Gaussian process regression to a rolling window of recent prices, drawing a denoised estimate of the underlying trend and projecting it a chosen number of bars ahead. Three update modes keep the forecast locked, refresh it when its horizon completes, or recompute it every bar: a flexible trend lens for forecast-minded traders.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Oct 10, 2023.
- Access: free.
- Concepts: [Gaussian Process Regression](https://www.luxalgo.com/library/concept/gaussian-process-regression/) (primary), [Kernel Regression](https://www.luxalgo.com/library/concept/kernel-regression/)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn3bl8004lvhsgv6tnel1q
- Page: https://www.luxalgo.com/library/indicator/machine-learning-gaussian-process-regression/

**Machine Learning: Gaussian Process Regression** distills recent price data into a smooth fitted curve and extends it into the future, delivering trend estimation and forecasting in a single plot. It is a Bayesian relative of [kernel smoothing](https://www.luxalgo.com/library/concept/kernel-regression/), which is why the output reads as a clean line through noise, and why it anchors the library's [machine-learning lineup](https://www.luxalgo.com/library/family/machine-learning/).

## How to Trade the Machine Learning: Gaussian Process Regression?

- **Fitted line**: condenses the Training Window into a clear local trend, ideal for descriptive analysis and pattern study free of noise.
- **Forecast extension**: projects that trend a set number of bars forward; read it as one plausible path forward, not a promise.
- **Lock Forecast (default)**: the projection stays static, so you can grade it against what actually happened.
- **Update Once Reached**: the forecast refreshes when its window completes, staying relevant as price evolves.
- **Continuously Update**: recomputes on every bar for traders who want the current read at all times.

Smooth stretches the estimate toward longer-term trends, while lower Sigma values amplify the forecast, with the caveat that amplification can intensify errors, particularly on larger Training Window values.

## Machine Learning: Gaussian Process Regression Settings

- **Training Window**: the scope of recent price data the model fits.
- **Forecasting Length**: the future bar count for the projection.
- **Smooth**: the model's smoothness degree; higher values yield more extended, less volatile estimates.
- **Sigma**: noise variance controlling sensitivity to outliers and forecast amplitude.
- **Update Mechanism**: chooses between Lock Forecast, Update Once Reached, and Continuously Update.

## Frequently Asked Questions

### Can I control which bars the model trains on?

Only the window size here: the fit always uses the most recent data. To train on a hand-picked historical segment instead, the [anchored variant](https://www.luxalgo.com/library/indicator/machine-learning-anchored-gaussian-process-regression/) lets you set the training window with two chart anchors.

### Are the forecasts reliable enough to act on alone?

No single model is. GPR adds a clear view of trend direction and potential movement, but it belongs alongside your other analysis rather than in place of it.

### What does it take to access this indicator?

Nothing but this page. The tool is free within the LuxAlgo Library, and you can run it in Quant, our coding agent, from here as well. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [Machine Learning: Anchored Gaussian Process Regression](https://www.luxalgo.com/library/indicator/machine-learning-anchored-gaussian-process-regression/) (Gaussian Process Regression): markdown at https://www.luxalgo.com/library/indicator/machine-learning-anchored-gaussian-process-regression.md
- [Nadaraya-Watson Smoothers](https://www.luxalgo.com/library/indicator/nadaraya-watson-smoothers/) (Kernel Regression): markdown at https://www.luxalgo.com/library/indicator/nadaraya-watson-smoothers.md
- [Nadaraya-Watson Envelope](https://www.luxalgo.com/library/indicator/nadaraya-watson-envelope/) (Kernel Regression): markdown at https://www.luxalgo.com/library/indicator/nadaraya-watson-envelope.md
- [Gaussian Volume Profile](https://www.luxalgo.com/library/indicator/gaussian-volume-profile/) (Kernel Density Estimation): markdown at https://www.luxalgo.com/library/indicator/gaussian-volume-profile.md
- [KDE Value Clouds](https://www.luxalgo.com/library/indicator/kde-value-clouds/) (Kernel Density Estimation): markdown at https://www.luxalgo.com/library/indicator/kde-value-clouds.md
- [Structural SVM Ranker](https://www.luxalgo.com/library/indicator/structural-svm-ranker/) (Support Vector Machines): markdown at https://www.luxalgo.com/library/indicator/structural-svm-ranker.md
- [Decision Trees](https://www.luxalgo.com/library/indicator/decision-trees/) (Machine Learning): markdown at https://www.luxalgo.com/library/indicator/decision-trees.md
- [Gradient Boosting](https://www.luxalgo.com/library/indicator/gradient-boosting/) (Machine Learning): markdown at https://www.luxalgo.com/library/indicator/gradient-boosting.md

---

Source: https://www.luxalgo.com/library/indicator/machine-learning-gaussian-process-regression/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
