小编Lin*_*Jin的帖子

python中的Hurst指数

from datetime import datetime
from pandas.io.data import DataReader
from numpy import cumsum, log, polyfit, sqrt, std, subtract
from numpy.random import randn

def hurst(ts):

    """Returns the Hurst Exponent of the time series vector ts"""
    # Create the range of lag values
    lags = range(2, 100)

    # Calculate the array of the variances of the lagged differences
    # Here it calculates the variances, but why it uses 
    # standard deviation and then make a root of it?
    tau = [sqrt(std(subtract(ts[lag:], ts[:-lag]))) for …
Run Code Online (Sandbox Code Playgroud)

python math finance

3
推荐指数
2
解决办法
6455
查看次数

标签 统计

finance ×1

math ×1

python ×1