How to decompose the dataset into different wavelets

Dear R users,

I have the dataset including value and id columns. I'd like to ask that how to decompose the value column (using wavelet analysis or Fourier transform) so that the cyclic periods in each component can be shown clearly? The value column may be change in different periods (long or short, all part of the time column) and frequencies.
Thanks very much for your help.

df1= data.frame(value=c(17.5	,
                    17.46923	,
                    17.0732325	,
                    16.5971425	,
                    16.1345	,
                    15.6857575	,
                    15.25138	,
                    14.831815	,
                    14.427515	,
                    14.0389425	,
                    13.66655	,
                    13.3107825	,
                    12.9721075	,
                    12.65097	,
                    12.34783	,
                    12.0631425	,
                    11.7973575	,
                    11.550935	,
                    11.324325	,
                    11.1179825	,
                    10.9323625	,
                    10.7679275	,
                    10.62512	,
                    10.5044	,
                    10.406225	,
                    10.3310425	,
                    10.2793125	,
                    10.25149	,
                    10.248025	,
                    10.269375	,
                    10.316	,
                    10.3883425	,
                    10.4869725	,
                    10.617465	,
                    10.78566	,
                    10.989295	,
                    11.225555	,
                    11.49162	,
                    11.78466	,
                    12.10187	,
                    12.440415	,
                    12.797485	,
                    13.1702525	,
                    13.5559	,
                    13.9516025	,
                    14.354545	,
                    14.761905	,
                    15.1708575	,
                    15.57859	,
                    15.98228	,
                    16.3790975	,
                    16.766235	,
                    17.1408625	,
                    17.500165	,
                    17.84132	,
                    18.1615025	,
                    18.4578975	,
                    18.727685	,
                    18.968035	,
                    19.17614	,
                    19.34917	,
                    19.48448	,
                    19.5884775	,
                    19.6733375	,
                    19.7410975	,
                    19.7929575	,
                    19.830125	,
                    19.8538075	,
                    19.86521	,
                    19.8655375	,
                    19.855995	,
                    19.837785	,
                    19.812125	,
                    19.7802075	,
                    19.743245	,
                    19.702445	,
                    19.6590075	,
                    19.614145	,
                    19.569055	,
                    19.5249525	,
                    19.4830375	,
                    19.444515	,
                    19.410595	,
                    19.38248	,
                    19.36138	,
                    19.3484925	,
                    19.34503	,
                    19.352195	,
                    19.3712	,
                    19.40324	,
                    19.4495325	,
                    19.5112725	,
                    19.5899975	,
                    19.7028725	,
                    19.870165	,
                    20.08887	,
                    20.35432	,
                    20.6618175	,
                    21.00669	,
                    21.38425	,
                    21.7898225	,
                    22.21872	,
                    22.6662625	,
                    23.12777	,
                    23.5985575	,
                    24.0739475	,
                    24.549255	,
                    25.0197975	,
                    25.480895	,
                    25.927865	,
                    26.3560275	,
                    26.7607	,
                    27.1371975	,
                    27.4808425	,
                    27.7869525	,
                    28.05084	,
                    28.26783	,
                    28.43324	,
                    28.54239	,
                    28.59059	,
                    28.5731675	,
                    28.4854325	,
                    28.323085	,
                    28.1012525	,
                    27.84633	,
                    27.5619725	,
                    27.250035	,
                    26.912355	,
                    26.55078	,
                    26.1671625	,
                    25.7633375	,
                    25.341155	,
                    24.9024625	,
                    24.4491025	,
                    23.9829225	,
                    23.505765	,
                    23.0194825	,
                    22.525915	,
                    22.0269075	,
                    21.524305	,
                    21.0199575	,
                    20.5157125	,
                    20.013405	,
                    19.5148875	,
                    19.0220125	,
                    18.53661	,
                    18.060535	,
                    17.5956325	,
                    17.14375	,
                    16.70673	,
                    16.286415	,
                    15.884655	,
                    15.5033	,
                    15.14393	,
                    14.79542	,
                    14.4411225	,
                    14.08086	,
                    13.715695	,
                    13.346705	,
                    12.97496	,
                    12.601535	,
                    12.2274975	,
                    11.85392	,
                    11.48188	,
                    11.11244	,
                    10.74668	,
                    10.38567	,
                    10.03048	,
                    9.6821825	,
                    9.34185	,
                    9.0105575	,
                    8.68937	,
                    8.379365	,
                    8.0816125	,
                    7.7971825	,
                    7.52715	,
                    7.27259	,
                    7.03457	,
                    6.814155	,
                    6.61243	,
                    6.4304625	,
                    6.26932	,
                    6.13008	,
                    6.0137425	,
                    5.91775	,
                    5.8372675	,
                    5.77145	,
                    5.719785	,
                    5.68175	,
                    5.65683	,
                    5.6445125	,
                    5.644275	,
                    5.6555975	,
                    5.6779675	,
                    5.710865	,
                    5.7537775	,
                    5.8061775	,
                    5.86756	,
                    5.9373975	,
                    6.0151825	,
                    6.10039	,
                    6.1925	,
                    6.2910025	,
                    6.3953825	,
                    6.50511	,
                    6.61968	,
                    6.73857	,
                    6.86126	,
                    6.98724	,
                    7.1159875	,
                    7.24699	,
                    7.3797175	,
                    7.5136675	,
                    7.6483125	,
                    7.7831925	,
                    7.9203075	,
                    8.0626975	,
                    8.21016	,
                    8.3622475	,
                    8.518515	,
                    8.6785175	,
                    8.8418075	,
                    9.007935	,
                    9.17646	,
                    9.3469325	,
                    9.5189075	,
                    9.69194	,
                    9.86558	,
                    10.0393825	,
                    10.2129075	,
                    10.3857	,
                    10.5573175	,
                    10.727315	,
                    10.895245	,
                    11.06066	,
                    11.2231175	,
                    11.382165	,
                    11.53736	,
                    11.68826	,
                    11.834415	,
                    11.9753725	,
                    12.1107	,
                    12.23994	,
                    12.3626475	,
                    12.4783825	,
                    12.5867	,
                    12.687525	,
                    12.7813925	,
                    12.86877	,
                    12.9501	,
                    13.02582	,
                    13.0963775	,
                    13.1622075	,
                    13.2237625	,
                    13.281475	,
                    13.335795	,
                    13.3871575	,
                    13.43601	,
                    13.4827925	,
                    13.5279475	,
                    13.571915	,
                    13.615145	,
                    13.65807	,
                    13.701135	,
                    13.7447875	,
                    13.7894625	,
                    13.835605	,
                    13.88366	,
                    13.9340675	,
                    13.98727	,
                    14.043705	,
                    14.10382	,
                    14.16806	,
                    14.2368625	,
                    14.3106675	,
                    14.3900175	,
                    14.480155	,
                    14.5871775	,
                    14.710165	,
                    14.8476825	,
                    14.998285	,
                    15.1605425	,
                    15.3330175	,
                    15.5142675	,
                    15.702865	,
                    15.89737	,
                    16.096345	,
                    16.2983525	,
                    16.50196	,
                    16.7057275	,
                    16.9082175	,
                    17.108	,
                    17.3036275	,
                    17.493675	,
                    17.6767	,
                    17.851265	,
                    18.0159375	,
                    18.1692775	,
                    18.309855	,
                    18.436225),
                time=1:300)

I'm still waiting for an answer. I think I tried to use Morlet wavelet and did the following. But how to decompose the waves into the period with the highest 'Average wavelet power'? Thanks for your help.

wt1= 
  analyze.wavelet(df1,'value',loess.span=0, dt=1,dj=1/20,
                  lowerPeriod=16, make.pval=T, n.sim=10)
## Plot of wavelet power spectrum (with equidistant color breakpoints):  
wt.image(wt1, color.key="interval", legend.params=list(lab="wavelet power levels"),
         periodlab='Period (days)',
         timelab='Time')
## Plot of average wavelet power:
wt.avg(wt1, siglvl=0.05, sigcol="red", legend.coords= 'bottomright',
       periodlab='Period (days)',averagelab='Average wavelet power')

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.