Library "WIPFunctionLyaponov" Lyapunov exponents are mathematical measures used to describe the behavior of a system over time. They are named after Russian mathematician Alexei Lyapunov, who first introduced the concept in the late 19th century. The exponent is defined as the rate at which a particular function or variable changes over time, and can be positive, negative, or zero. Positive exponents indicate that a system tends to grow or expand over time, while negative exponents indicate that a system tends to shrink or decay. Zero exponents indicate that the system does not change significantly over time. Lyapunov exponents are used in various fields of science and engineering, including physics, economics, and biology, to study the long-term behavior of complex systems. ~ generated description from vicuna13b
--- To calculate the Lyapunov Exponent (LE) of a given Time Series, we need to follow these steps: 1. Firstly, you should have access to your data in some format like CSV or Excel file. If not, then you can collect it manually using tools such as stopwatches and measuring tapes. 2. Once the data is collected, clean it up by removing any outliers that may skew results. This step involves checking for inconsistencies within your dataset (e.g., extremely large or small values) and either discarding them entirely or replacing with more reasonable estimates based on surrounding values. 3. Next, you need to determine the dimension of your time series data. In most cases, this will be equal to the number of variables being measured in each observation period (e.g., temperature, humidity, wind speed). 4. Now that we have a clean dataset with known dimensions, we can calculate the LE for our Time Series using the following formula: λ = log(||M^T * M - I||)/log(||v||) where: λ (Lyapunov Exponent) is the quantity that will be calculated. ||...|| denotes an Euclidean norm of a vector or matrix, which essentially means taking the square root of the sum of squares for each element in the vector/matrix. M represents our Jacobian Matrix whose elements are given by: J_ij = (∂fj / ∂xj) where fj is the jth variable and xj is the ith component of the initial condition vector x(t). In other words, each element in this matrix represents how much a small change in one variable affects another. I denotes an identity matrix whose elements are all equal to 1 (or any constant value if you prefer). This term essentially acts as a baseline for comparison purposes since we want our Jacobian Matrix M^T * M to be close to it when the system is stable and far away from it when the system is unstable. v represents an arbitrary vector whose Euclidean norm ||v|| will serve as a scaling factor in our calculation. The choice of this particular vector does not matter since we are only interested in its magnitude (i.e., length) for purposes of normalization. However, if you want to ensure that your results are accurate and consistent across different datasets or scenarios, it is recommended to use the same initial condition vector x(t) as used earlier when calculating our Jacobian Matrix M. 5. Finally, once we have calculated λ using the formula above, we can interpret its value in terms of stability/instability for our Time Series data: - If λ < 0, then this indicates that the system is stable (i.e., nearby trajectories will converge towards each other over time). - On the other hand, if λ > 0, then this implies that the system is unstable (i.e., nearby trajectories will diverge away from one another over time). ~ generated description from airoboros33b
--- This is a work in progress, it may contain errors so use with caution. If you find flaws or suggest something new, please leave a comment bellow.
_measure_function(i) helper function to get the name of distance function by a index (0 -> 13).\ Functions: SSD, Euclidean, Manhattan, Minkowski, Chebyshev, Correlation, Cosine, Camberra, MAE, MSE, Lorentzian, Intersection, Penrose Shape, Meehl. Parameters: i (int)
_test(L) Helper function to test the output exponents state system and outputs description into a string. Parameters: L (float[])
estimate(X, initial_distance, distance_function) Estimate the Lyaponov Exponents for multiple series in a row matrix. Parameters: X (map<string, ArrayFloat type from RicardoSantos/CommonTypesMapUtil/1>) initial_distance (float): Initial distance limit. distance_function (string): Name of the distance function to be used, default:`ssd`. Returns: List of Lyaponov exponents.
max(L) Maximal Lyaponov Exponent. Parameters: L (float[]): List of Lyapunov exponents. Returns: Highest exponent.
릴리즈 노트
v2 update: added `enum` with Distance Measures names.
진정한 TradingView 정신에 따라, 저자는 이 파인 코드를 다른 파인 프로그래머들이 재사용할 수 있도록 오픈 소스 라이브러리로 공개했습니다. 저자에게 박수를 보냅니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈 소스 출판물에서 사용할 수 있지만, 이 코드를 출판물에서 재사용하는 것은 하우스 룰에 의해 관리됩니다.