金融时间序列的格拉姆角场变换(Python)

B站影视 2024-12-18 13:17 2

摘要:pip install yfinancepip install pytsimport matplotlib.pyplot as pltfrom mpl_toolkits.axes_grid1 import ImageGridfrom pyts.image im

pip install yfinancepip install pytsimport matplotlib.pyplot as pltfrom mpl_toolkits.axes_grid1 import ImageGridfrom pyts.image import GramianAngularFieldfrom pyts.datasets import load_gunpoint,load_basic_motionsimport numpy as npimport datetimeimport yfinance as yfimport pandas as pd# ParametersX, _, _, _ = load_gunpoint(return_X_y=True)# Transform the time series into Gramian Angular Fieldsgasf = GramianAngularField(image_size=24, method='summation')X_gasf = gasf.fit_transform(X)gadf = GramianAngularField(image_size=24, method='difference')X_gadf = gadf.fit_transform(X)# Show the images for the first time seriesfig = plt.figure(figsize=(8, 4))grid = ImageGrid(fig, 111,nrows_ncols=(1, 2),axes_pad=0.15,share_all=True,cbar_location="right",cbar_mode="single",cbar_size="7%",cbar_pad=0.3,)images = [X_gasf[-1], X_gadf[1]]titles = ['Summation', 'Difference']for image, title, ax in zip(images, titles, grid):im = ax.imshow(image, cmap='rainbow', origin='lower')ax.set_title(title, fontdict={'fontsize': 12})ax.cax.colorbar(im)ax.cax.toggle_label(True)plt.suptitle('Gramian Angular Fields', y=0.98, fontsize=16)plt.show

知乎学术咨询:

https://www.zhihu.com/consult/people/792359672131756032?isMe=1

担任《Mechanical System and Signal Processing》《中国电机工程学报》等期刊审稿专家,擅长领域:信号滤波/降噪,机器学习/深度学习,时间序列预分析/预测,设备故障诊断/缺陷检测/异常检测。

分割线分割线分割线

同步压缩变换的一些应用(时频分析,盲源分离等,MATLAB)

完整代码和数据可通过知乎学术咨询获得(注意:一次知乎学术付费咨询只能获得一套代码+学术指导)

引力波信号的同步压缩变换,高阶同步压缩变换,脊线提取与信号重建(MATLAB R2021B)

基于同步压缩变换(重分配算子机制)的非平稳信号瞬时频率估计(MATLAB R2018A)

基于优化Morlet小波的一维信号瞬态特征提取方法(MATLAB )

程序运行环境为MATLAB R2018A,利用优化Morlet小波对一维信号进行瞬态特征提取。程序测试了模拟信号,地震信号,发动机销子活塞故障振动信号,发动机气门正常振动信号,发动机排气门故障振动信号,结果如下。

完整代码可通过知乎付费咨询获得(注意:一次知乎学术付费咨询只能获得一套代码+学术指导)

MATLAB环境下基于高分辨时频分析与阈值法的一维信号降噪

基于经验模态分解、离散小波变换和AR模型的肌电图信号降噪(Python,ipynb文件)

NS: noisy signalS: original siganlmean filter: ws = window sizemedian filter:average filter: ns = number of noisy signal(different)bandpass filter: l = low cut-off frequency, h = high ...threshold filter: r = ratio(max abs(fft) / min ...)wavelet filter: a = thresholdstd filter:NN: neural network

完整代码

基于整数小波变换的信号降噪方法(Python)

来源:露露课堂

相关推荐