我正在尝试生成一些具有随机性的时间序列,这些趋势具有周期性(例如销售),呈指数下降(例如帖子上的facebook喜欢),呈指数增长(例如比特币价格),总体呈上升趋势(股票行情自动收录器)等.我可以使用以下
I am trying to generate some random time series with trends like cyclical (e.g. sales), exponentially decreasing (e.g. facebook likes on a post), exponentially increasing (e.g. bitcoin prices), generally increasing (stock tickers) etc. I can generate generally increasing/decreasing time series with the following
import numpy as np import pandas as pd from numpy import sqrt import matplotlib.pyplot as plt vol = .030 lag = 300 df = pd.DataFrame(np.random.randn(100000) * sqrt(vol) * sqrt(1 / 252.)).cumsum() plt.plot(df[0].tolist()) plt.show()但是我不知道如何生成周期性趋势或以指数方式增加或减少趋势.有没有办法做到这一点 ?
But I don't know how to generate cyclical trends or exponentially increasing or decreasing trends. Is there a way to do this ?
推荐答案您可能需要评估 TimeSynth
You may want to evaluate TimeSynth
"TimeSynth是一个开放源代码库,用于生成用于*模型测试*的合成时间序列.该库可以生成规则和不规则的时间序列.该体系结构允许用户将不同的* signal *与不同的体系结构进行匹配,从而实现产生的信号种类繁多.可用的* signal *和* noise *类型在下面列出."