PINE LIBRARY
업데이트됨 KernelFunctions

Library "KernelFunctions"
This library provides non-repainting kernel functions for Nadaraya-Watson estimator implementations. This allows for easy substitution/comparison of different kernel functions for one another in indicators. Furthermore, kernels can easily be combined with other kernels to create newer, more customized kernels. Compared to Moving Averages (which are really just simple kernels themselves), these kernel functions are more adaptive and afford the user an unprecedented degree of customization and flexibility.
rationalQuadratic(_src, _lookback, _relativeWeight, _startAtBar)
Rational Quadratic Kernel - An infinite sum of Gaussian Kernels of different length scales.
Parameters:
_src: <float series> The source series.
_lookback: <simple int> The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_relativeWeight: <simple float> Relative weighting of time frames. Smaller values result in a more stretched-out curve, and larger values will result in a more wiggly curve. As this value approaches zero, the longer time frames will exert more influence on the estimation. As this value approaches infinity, the behavior of the Rational Quadratic Kernel will become identical to the Gaussian kernel.
_startAtBar: <simple int> Bar index on which to start regression. The first bars of a chart are often highly volatile, and omitting these initial bars often leads to a better overall fit.
Returns: yhat <float series> The estimated values according to the Rational Quadratic Kernel.
gaussian(_src, _lookback, _startAtBar)
Gaussian Kernel - A weighted average of the source series. The weights are determined by the Radial Basis Function (RBF).
Parameters:
_src: <float series> The source series.
_lookback: <simple int> The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_startAtBar: <simple int> Bar index on which to start regression. The first bars of a chart are often highly volatile, and omitting these initial bars often leads to a better overall fit.
Returns: yhat <float series> The estimated values according to the Gaussian Kernel.
periodic(_src, _lookback, _period, _startAtBar)
Periodic Kernel - The periodic kernel (derived by David Mackay) allows one to model functions that repeat themselves exactly.
Parameters:
_src: <float series> The source series.
_lookback: <simple int> The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_period: <simple int> The distance between repititions of the function.
_startAtBar: <simple int> Bar index on which to start regression. The first bars of a chart are often highly volatile, and omitting these initial bars often leads to a better overall fit.
Returns: yhat <float series> The estimated values according to the Periodic Kernel.
locallyPeriodic(_src, _lookback, _period, _startAtBar)
Locally Periodic Kernel - The locally periodic kernel is a periodic function that slowly varies with time. It is the product of the Periodic Kernel and the Gaussian Kernel.
Parameters:
_src: <float series> The source series.
_lookback: <simple int> The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_period: <simple int> The distance between repititions of the function.
_startAtBar: <simple int> Bar index on which to start regression. The first bars of a chart are often highly volatile, and omitting these initial bars often leads to a better overall fit.
Returns: yhat <float series> The estimated values according to the Locally Periodic Kernel.
This library provides non-repainting kernel functions for Nadaraya-Watson estimator implementations. This allows for easy substitution/comparison of different kernel functions for one another in indicators. Furthermore, kernels can easily be combined with other kernels to create newer, more customized kernels. Compared to Moving Averages (which are really just simple kernels themselves), these kernel functions are more adaptive and afford the user an unprecedented degree of customization and flexibility.
rationalQuadratic(_src, _lookback, _relativeWeight, _startAtBar)
Rational Quadratic Kernel - An infinite sum of Gaussian Kernels of different length scales.
Parameters:
_src: <float series> The source series.
_lookback: <simple int> The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_relativeWeight: <simple float> Relative weighting of time frames. Smaller values result in a more stretched-out curve, and larger values will result in a more wiggly curve. As this value approaches zero, the longer time frames will exert more influence on the estimation. As this value approaches infinity, the behavior of the Rational Quadratic Kernel will become identical to the Gaussian kernel.
_startAtBar: <simple int> Bar index on which to start regression. The first bars of a chart are often highly volatile, and omitting these initial bars often leads to a better overall fit.
Returns: yhat <float series> The estimated values according to the Rational Quadratic Kernel.
gaussian(_src, _lookback, _startAtBar)
Gaussian Kernel - A weighted average of the source series. The weights are determined by the Radial Basis Function (RBF).
Parameters:
_src: <float series> The source series.
_lookback: <simple int> The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_startAtBar: <simple int> Bar index on which to start regression. The first bars of a chart are often highly volatile, and omitting these initial bars often leads to a better overall fit.
Returns: yhat <float series> The estimated values according to the Gaussian Kernel.
periodic(_src, _lookback, _period, _startAtBar)
Periodic Kernel - The periodic kernel (derived by David Mackay) allows one to model functions that repeat themselves exactly.
Parameters:
_src: <float series> The source series.
_lookback: <simple int> The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_period: <simple int> The distance between repititions of the function.
_startAtBar: <simple int> Bar index on which to start regression. The first bars of a chart are often highly volatile, and omitting these initial bars often leads to a better overall fit.
Returns: yhat <float series> The estimated values according to the Periodic Kernel.
locallyPeriodic(_src, _lookback, _period, _startAtBar)
Locally Periodic Kernel - The locally periodic kernel is a periodic function that slowly varies with time. It is the product of the Periodic Kernel and the Gaussian Kernel.
Parameters:
_src: <float series> The source series.
_lookback: <simple int> The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_period: <simple int> The distance between repititions of the function.
_startAtBar: <simple int> Bar index on which to start regression. The first bars of a chart are often highly volatile, and omitting these initial bars often leads to a better overall fit.
Returns: yhat <float series> The estimated values according to the Locally Periodic Kernel.
릴리즈 노트
v2Updated:
Allow float for relativeWeight of the Rational Quadratic Kernel
rationalQuadratic(_src, _lookback, _relativeWeight, _startAtBar)
Rational Quadratic Kernel - An infinite sum of Gaussian Kernels of different length scales.
Parameters:
_src: <float series> The source series.
_lookback: <simple int> The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_relativeWeight: <simple float> Relative weighting of time frames. Smaller values resut in a more stretched out curve and larger values will result in a more wiggly curve. As this value approaches zero, the longer time frames will exert more influence on the estimation. As this value approaches infinity, the behavior of the Rational Quadratic Kernel will become identical to the Gaussian kernel.
_startAtBar: <simple int> Bar index on which to start regression. The first bars of a chart are often highly volatile, and omission of these initial bars often leads to a better overall fit.
Returns: yhat <float series> The estimated values according to the Rational Quadratic Kernel.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
🚀 User Guides: ai-edge.io/
❤️ Premium Indicators: patreon.com/jdehorty
🎥 Tutorials: youtu.be/AdINVvnJfX4
🤖 Discord: discord.com/invite/djXT5sAPfQ
⏩ LinkedIn: linkedin.com/in/justin-dehorty
❤️ Premium Indicators: patreon.com/jdehorty
🎥 Tutorials: youtu.be/AdINVvnJfX4
🤖 Discord: discord.com/invite/djXT5sAPfQ
⏩ LinkedIn: linkedin.com/in/justin-dehorty
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
🚀 User Guides: ai-edge.io/
❤️ Premium Indicators: patreon.com/jdehorty
🎥 Tutorials: youtu.be/AdINVvnJfX4
🤖 Discord: discord.com/invite/djXT5sAPfQ
⏩ LinkedIn: linkedin.com/in/justin-dehorty
❤️ Premium Indicators: patreon.com/jdehorty
🎥 Tutorials: youtu.be/AdINVvnJfX4
🤖 Discord: discord.com/invite/djXT5sAPfQ
⏩ LinkedIn: linkedin.com/in/justin-dehorty
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.