cqcn1991 / Wind-Speed-Analysis

An elegant probability model for the joint distribution of wind speed and direction.
331 stars 109 forks source link

ecdf = sm.distributions.ECDF(sample) #3

Open dick7 opened 6 years ago

dick7 commented 6 years ago

NameError: name 'sm' is not defined 请问‘sm’在哪里定义的,代表什么意思?

cqcn1991 commented 6 years ago

@dick7 话说这段代码在哪...这个应该是以前的代码

新版是这样的了

def fit_weibull_and_ecdf(df_speed, x=None):
    from statsmodels.distributions.empirical_distribution import ECDF
    max_speed = df_speed.max()
    if x is None:
        x = linspace(0, max_speed, 20)
    # Fit Weibull, notice loc value 0 or not
    weibull_params, y_weibull, density_expected_weibull, y_cdf_weibull = fit_weibull(df_speed, x)
    # Fit Ecdf
    y_ecdf = ECDF(df_speed)(x)
    return x, y_weibull, density_expected_weibull, y_cdf_weibull, weibull_params, y_ecdf

ECDF来自于statsmodels 这个包

dick7 commented 6 years ago

是啊,是你以前的版本了

cqcn1991 commented 6 years ago

@dick7 换新版本吧...