【发布时间】:2019-12-14 15:44:51
【问题描述】:
我有两个时间序列,计算了它们的均值和标准差以及偏度。
如何根据第一个时间序列的均值和标准差但第二个时间序列的偏度生成新的概率密度函数 (pdf)。
ts1 = [[ 0.24795413, 0.51981795, -1.128888 , -0.3915509 , -0.36329997,
0.88802624, 1.1253957 , 0.14258218, -0.55445707, -0.79443187,
-0.16986907, 1.5396615 , 1.7831599 , 0.48034644, -0.55335957,
-0.1698935 , -0.82943815, -1.2654774 , -1.0019791 , 0.2947774 ,
-0.38959527, -1.193097 , 0.19199276, -0.24384224, 1.0309464 ,
-0.54779184, -1.2194977 , -0.56049407, 0.33375692, 0.09617996,
1.500001 , 1.3636391 , -0.6977335 , 1.14598 , -0.31681216,
0.14813781, 1.2058297 , -0.5362634 , -0.18963599, -0.82915914,
-0.46238124, -0.5534528 , 0.2932713 , 0.03283417, -0.59320515,
-0.15333033, 0.418383 , 0.623021 , 2.9942613 , 1.1455983 ,
-0.7301076 , 0.47346616, 0.96548057, 1.7798176 , 1.4704127 ,
0.12636256, -0.54934335, -0.057479]
ts2 = [-0.20055497, -1.0812824 , 1.6640332 , -0.9939632 , 0.05211592,
1.4842485 , -0.3094573 , 0.35551405, 0.38313067, -1.0607151 ,
-0.24302316, -0.97898716, -1.3700265 , 0.5152137 , -0.49310505,
0.71188784, -0.51848483, 0.16944373, -0.5372622 , -0.60573167,
0.04732573, 0.34191012, -0.23362386, 1.5668747 , -0.91083133,
-0.7176449 , 1.4817567 , -0.2580676 , 1.0231726 , 0.10230541,
0.16726625, -1.4672999 , 0.40618753, -1.4019163 , -0.1177727 ,
-0.21126366, -0.9413029 , 0.3704642 , 0.11061847, 2.4474611 ,
-0.5796859 , -1.2674994 , -0.44353878, -1.2688683 , -0.5369506 ,
-0.53735554, 1.7200137 , 2.3995981 , -1.4367745 , -0.5959428 ,
0.63681364, 1.0187957 , -0.97254455, -0.50130427, -0.31367695,
0.43504715, -0.60908884, -1.176665]
m1 = np.mean(ts1) std1 = np.std(ts1) skw1 = scipy.stats.skew(ts1)
skw2 = scipy.stats.skew(ts2)
# m1 mean of pdf1, std1 standard deviation and skw1 is skewness
pdf1 = m1 std1 skw1
# how can I get pdf 2 to be something like this
pdf2 = m1, std1, sk2 ( here I am using different skewness but
same meand and standard deviation)
【问题讨论】:
-
嗨@user11036847,如果您能提供示例数据和所需的输出,我们将不胜感激。
-
另外请说明您所说的“PDF”和“生成 PDF”是什么意思。
-
我已编辑,我想使用系列 1 的均值、标准差和系列 2 的偏度生成新的直方图或概率密度函数
标签: python pandas scipy distribution statsmodels