maartenheremans

statistics

Library "statistics"
General statistics library.

erf(x) The "error function" encountered in integrating the normal
distribution (which is a normalized form of the Gaussian function).
  Parameters:
    x: The input series.
  Returns: The Error Function evaluated for each element of x.

erfc(x)
  Parameters:
    x: The input series
  Returns: The Complementary Error Function evaluated for each alement of x.

sumOfReciprocals(src, len) Calculates the sum of the reciprocals of the series.
For each element 'elem' in the series:
sum += 1/elem
Should the element be 0, the reciprocal value of 0 is used instead
of NA.
  Parameters:
    src: The input series.
    len: The length for the sum.
  Returns: The sum of the resciprocals of 'src' for 'len' bars back.

mean(src, len) The mean of the series.
(wrapper around ta.sma).
  Parameters:
    src: The input series.
    len: The length for the mean.
  Returns: The mean of 'src' for 'len' bars back.

average(src, len) The mean of the series.
(wrapper around ta.sma).
  Parameters:
    src: The input series.
    len: The length for the average.
  Returns: The average of 'src' for 'len' bars back.

geometricMean(src, len) The Geometric Mean of the series.
The geometric mean is most important when using data representing
percentages, ratios, or rates of change. It cannot be used for
negative numbers
Since the pure mathematical implementation generates a very large
intermediate result, we performed the calculation in log space.
  Parameters:
    src: The input series.
    len: The length for the geometricMean.
  Returns: The geometric mean of 'src' for 'len' bars back.

harmonicMean(src, len) The Harmonic Mean of the series.
The harmonic mean is most applicable to time changes and, along
with the geometric mean, has been used in economics for price
analysis. It is more difficult to calculate; therefore, it is less
popular than eiter of the other averages.
0 values are ignored in the calculation.
  Parameters:
    src: The input series.
    len: The length for the harmonicMean.
  Returns: The harmonic mean of 'src' for 'len' bars back.

median(src, len) The median of the series.
(a wrapper around ta.median)
  Parameters:
    src: The input series.
    len: The length for the median.
  Returns: The median of 'src' for 'len' bars back.

variance(src, len, biased) The variance of the series.
  Parameters:
    src: The input series.
    len: The length for the variance.
    biased: Wether to use the biased calculation (for a population), or the
unbiased calculation (for a sample set). .
  Returns: The variance of 'src' for 'len' bars back.

stdev(src, len, biased) The standard deviation of the series.
  Parameters:
    src: The input series.
    len: The length for the stdev.
    biased: Wether to use the biased calculation (for a population), or the
unbiased calculation (for a sample set). .
  Returns: The standard deviation of 'src' for 'len' bars back.

skewness(src, len) The skew of the series.
Skewness measures the amount of distortion from a symmetric
distribution, making the curve appear to be short on the left
(lower prices) and extended to the right (higher prices). The
extended side, either left or right is called the tail, and a
longer tail to the right is called positive skewness. Negative
skewness has the tail extending towards the left.
  Parameters:
    src: The input series.
    len: The length for the skewness.
  Returns: The skewness of 'src' for 'len' bars back.

kurtosis(src, len) The kurtosis of the series.
Kurtosis describes the peakedness or flatness of a distribution.
This can be used as an unbiased assessment of whether prices are
trending or moving sideways. Trending prices will ocver a wider
range and thus a flatter distribution (kurtosis < 3; negative
kurtosis). If prices are range-bound, there will be a clustering
around the mean and we have positive kurtosis (kurtosis > 3)
  Parameters:
    src: The input series.
    len: The length for the kurtosis.
  Returns: The kurtosis of 'src' for 'len' bars back.

excessKurtosis(src, len) The normalized kurtosis of the series.
kurtosis > 0 --> positive kurtosis --> trending
kurtosis < 0 --> negative krutosis --> range-bound
  Parameters:
    src: The input series.
    len: The length for the excessKurtosis.
  Returns: The excessKurtosis of 'src' for 'len' bars back.

normDist(src, len, value) Calculates the probability mass for the value according to the
src and length. It calculates the probability for value to be
present in the normal distribution calculated for src and length.
  Parameters:
    src: The input series.
    len: The length for the normDist.
    value: The series of values to calculate the normal distance for
  Returns: The normal distance of 'value' to 'src' for 'len' bars back.

normDistCumulative(src, len, value) Calculates the cumulative probability mass for the value according
to the src and length. It calculates the cumulative probability for
value to be present in the normal distribution calculated for src
and length.
  Parameters:
    src: The input series.
    len: The length for the normDistCumulative.
    value: The series of values to calculate the cumulative normal distance
for
  Returns: The cumulative normal distance of 'value' to 'src' for 'len' bars
back.

zScore(src, len, value) Returns then z-score of objective to the series src.
It returns the number of stdev's the objective is away from the
mean(src, len)
  Parameters:
    src: The input series.
    len: The length for the zScore.
    value: The series of values to calculate the cumulative normal distance
for
  Returns: The z-score of objectiv with respect to src and len.

er(src, len) Calculates the efficiency ratio of the series.
It measures the noise of the series. The lower the number, the
higher the noise.
  Parameters:
    src: The input series.
    len: The length for the efficiency ratio.
  Returns: The efficiency ratio of 'src' for 'len' bars back.

efficiencyRatio(src, len) Calculates the efficiency ratio of the series.
It measures the noise of the series. The lower the number, the
higher the noise.
  Parameters:
    src: The input series.
    len: The length for the efficiency ratio.
  Returns: The efficiency ratio of 'src' for 'len' bars back.

fractalEfficiency(src, len) Calculates the efficiency ratio of the series.
It measures the noise of the series. The lower the number, the
higher the noise.
  Parameters:
    src: The input series.
    len: The length for the efficiency ratio.
  Returns: The efficiency ratio of 'src' for 'len' bars back.

mse(src, len) Calculates the Mean Squared Error of the series.
  Parameters:
    src: The input series.
    len: The length for the mean squared error.
  Returns: The mean squared error of 'src' for 'len' bars back.

meanSquaredError(src, len) Calculates the Mean Squared Error of the series.
  Parameters:
    src: The input series.
    len: The length for the mean squared error.
  Returns: The mean squared error of 'src' for 'len' bars back.

rmse(src, len) Calculates the Root Mean Squared Error of the series.
  Parameters:
    src: The input series.
    len: The length for the root mean squared error.
  Returns: The root mean squared error of 'src' for 'len' bars back.

rootMeanSquaredError(src, len) Calculates the Root Mean Squared Error of the series.
  Parameters:
    src: The input series.
    len: The length for the root mean squared error.
  Returns: The root mean squared error of 'src' for 'len' bars back.

mae(src, len) Calculates the Mean Absolute Error of the series.
  Parameters:
    src: The input series.
    len: The length for the mean absolute error.
  Returns: The mean absolute error of 'src' for 'len' bars back.

meanAbsoluteError(src, len) Calculates the Mean Absolute Error of the series.
  Parameters:
    src: The input series.
    len: The length for the mean absolute error.
  Returns: The mean absolute error of 'src' for 'len' bars back.
파인 라이브러리

트레이딩뷰 정신에 따라 오써는 이 파인 코드를 오픈 소스 라이브러리로 퍼블리쉬하여 당사 커뮤니티의 다른 파인 프로그래머들이 쓸 수 있도록 하였습니다. 오써에게 찬사를! 여러분은 이 라이브러리를 프라이빗 또는 오픈 소스 퍼블리케이션에 쓸 수 있지만 퍼블리케이션에 재사용은 하우스룰을 따릅니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

이 라이브러리를 쓰시겠습니까?

텍스트를 클립보드에 카피한 뒤 님의 스크립트에 붙여 넣기.