【代码分享】16种时间序列数据模态分解方法

16种时间序列数据分解方法:EMD(经验模态分解);EEMD(集合经验模态分解);CEEMD(互补集合经验模态分解);FEEMD(快速EEMD分解);CEEMDAN(完全自适应噪声集合经验模态分解);ICEEMDAN(改进的自适应噪声完备EEMD);LMD(局域均值分解);RLMD(鲁棒性局部均值分解);EWT(经验小波分解);VMD(变分模态分解);MVMD(多元变分模式分解);SVMD(Successive Variational Mode Decomposition);tvfemd(时变滤波器的经验模态分解);SSD(奇异谱分解);SSA(奇异谱分析);REMD(鲁棒经验模态分解)对时间序列数据进行模态分解(Mode Decomposition)可以将原始序列分解成不同的模态分量,每个模态量表示了不同的频率成分和趋势信息。这样做的好处有以下几点:

  1. 揭示潜在模式:模态分解可以将时间序列数据分解成多个模态量,每个模态量对应不同的频率成分和趋势信息。这样可以更好地理解数据中的潜在模式,例如长期趋势、季节性变化、周期性波动等。
  2. 去除噪音:模态分解可以将噪音或干扰分离出来,并将其归为低频模态量。通过分离噪音,我们可以更清晰地观察和分析数据中的真实趋势和周期性变化,从而提高预测的准确性。
  3. 数据预处理:对时间序列进行模态分解后,可以对不同的模态量进行独立的预处理和分析。例如,可以对高频模态量进行平滑处理,对低频模态量进行去趋势处理,以更好地消除异常值和处理缺失值。
  4. 预测改进:模态分解可以帮助改进时间序列的预测性能。通过分解出不同的模态量,可以更好地建模和预测每个模态量的变化。这样可以通过将预测结果合并得到更准确的总体预测结果。

总之,对时间序列数据进行模态分解可以更好地理解和处理数据中的不同频率成分和趋势信息,有助于改善预测和分析的准确性。

代码获取方式:【代码分享】16种时间序列数据模态分解方法

%Function for CEEMDAN

%WARNING: for this code works it is necessary to include in the same
%directoy the file emd.m developed by Rilling and Flandrin.
%This file is available at %http://perso.ens-lyon.fr/patrick.flandrin/emd.html
%We use the default stopping criterion.
%We use the last modification: 3.2007

%   Syntax

%modes=ceemdan(x,Nstd,NR,MaxIter,SNRFlag)
%[modes its]=ceemdan(x,Nstd,NR,MaxIter,SNRFlag)

%   Description

%OUTPUT
%modes: contain the obtained modes in a matrix with the rows being the modes        
%its: contain the sifting iterations needed for each mode for each realization (one row for each realization)

%INPUT
%x: signal to decompose
%Nstd: noise standard deviation
%NR: number of realizations
%MaxIter: maximum number of sifting iterations allowed.
%SNRFlag: if equals 1, then the SNR increases for every stage, as in [1].
%           If equals 2, then the SNR is the same for all stages, as in [2]. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The current is an improved version, introduced in:

%[1] Colominas MA, Schlotthauer G, Torres ME. "Improve complete ensemble EMD: A suitable tool for biomedical signal processing" 
%       Biomedical Signal Processing and Control vol. 14 pp. 19-29 (2014)

%The CEEMDAN algorithm was first introduced at ICASSP 2011, Prague, Czech Republic

%The authors will be thankful if the users of this code reference the work
%where the algorithm was first presented:

%[2] Torres ME, Colominas MA, Schlotthauer G, Flandrin P. "A Complete Ensemble Empirical Mode Decomposition with Adaptive Noise"
%       Proc. 36th Int. Conf. on Acoustics, Speech and Signa Processing ICASSP 2011 (May 22-27, Prague, Czech Republic)

%Author: Marcelo A. Colominas
%contact: macolominas@bioingenieria.edu.ar
%Last version: 25 feb 2015
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [modes,its]=iceemdan(x,Nstd,NR,MaxIter,SNRFlag)


x=x(:)';
desvio_x=std(x);
x=x/desvio_x;

modes=zeros(size(x));
temp=zeros(size(x));
aux=zeros(size(x));
iter=zeros(NR,round(log2(length(x))+5));

for i=1:NR
    white_noise{i}=randn(size(x));%creates the noise realizations
end;

for i=1:NR
    modes_white_noise{i}=emd(white_noise{i});%calculates the modes of white gaussian noise
end;

for i=1:NR %calculates the first mode
    xi=x+Nstd*modes_white_noise{i}(1,:)/std(modes_white_noise{i}(1,:));
    [temp, o, it]=emd(xi,'MAXMODES',1,'MAXITERATIONS',MaxIter);
    temp=temp(1,:);
    aux=aux+(xi-temp)/NR;
    iter(i,1)=it;
end;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值