Maxima are found if I prolong the 1-cycle time series on both sides, appaently no matter which values I use. The following sequence works fine:
aal <- rep (aa[1], length(aa)) aar <- rep (aa[length(aa)], length(aa)) aa3 <- c(aal,aa,aar) #APPEND CYCLE TO ITSELF TWICE aa3ts <- create.signalSeries(aa3, pos=list(from=0.0, by=0.033)) #CONVERT AMPLITUDE INTO TIME-SERIES plot (aa3ts, main=paste(insig," Cycle: ",j,sep="")) aa3.cwt <- wavCWT(aa3ts) #CWT aa3.maxtree <- wavCWTTree (aa3.cwt, type="maxima") # GENERATE CWT MAXIMA TREE aa3.maxpeak <- wavCWTPeaks (aa3.maxtree) #GET MAXIMUM PEAK Since the minima of aa are the maxima of -aa I reverse the sign and then repeat the above procedure. The following sequence works fine: ## EXCHANGE MAXIMA WITH MINIMA bb <- -aa #REVERSE SIGN bbl <- rep (bb[1], length(bb))\ bbr <- rep (bb[length(bb)], length(bb)) bb3 <- c(bbl,bb,bbr) #APPEND CYCLE TO ITSELF TWICE bb3ts <- create.signalSeries(bb3, pos=list(from=0.0, by=0.033)) #CONVERT AMPLITUDE INTO TIME-SERIES plot (bb3ts, main=paste(insig," Cycle: ",j,sep="")) bb3.cwt <- wavCWT(bb3ts) #CWT bb3.maxtree <- wavCWTTree (bb3.cwt, type="maxima") #GENERATE CWT MAXIMA TREE bb3.maxpeak <- wavCWTPeaks (bb3.maxtree) #GET MAXIMUM PEAKS It looks like wmTSA functions work like the Moving Average algorithm which uses a portion of the time series for kind of self-training .... Best regards, Maura -----Messaggio originale----- Da: stephen sefick [mailto:[EMAIL PROTECTED] Inviato: mar 09/12/2008 16.15 A: [EMAIL PROTECTED] Cc: Francesco Masulli; Stefano Rovetta; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Oggetto: Re: Sorry, I have attached the data - Here is the code that causes wavCWTPeaks error I'm stumped. On Tue, Dec 9, 2008 at 7:53 AM, <[EMAIL PROTECTED]> wrote: > > -----Messaggio originale----- > Da: [EMAIL PROTECTED] > Inviato: mar 09/12/2008 13.52 > A: stephen sefick; Francesco Masulli; Stefano Rovetta > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Oggetto: Here is the code that causes wavCWTPeaks error > > aats <- create.signalSeries(aa, pos=list(from=0.0, by=0.033)) > aa.cwt <- wavCWT(aats) > x11 (width=10,height=12) > plot (aats,main=paste(insig," Cycle: ",j,sep="")) > aa.maxtree <- wavCWTTree (aa.cwt, type="maxima") > aa.mintree <- wavCWTTree (aa.cwt, type="minima") > aa.maxpeak <- wavCWTPeaks (aa.maxtree) > aa.minpeak <- wavCWTPeaks (aa.mintree) > Error in `row.names<-.data.frame`(`*tmp*`, value = c("1", "0")) : > invalid 'row.names' length > bb <- -aa #EXCHANGE MAXIMA WITH MINIMA > bbts <- create.signalSeries(bb, pos=list(from=0.0, by=0.033)) > plot (bbts,main=paste(insig," Cycle: ",j,sep="")) > plot (bbts,main=paste(insig," Cycle: ",j,sep="")) > bb.cwt <- wavCWT(bbts) > bb.maxtree <- wavCWTTree (bb.cwt, type="maxima") > bb.mintree <- wavCWTTree (bb.cwt, type="minima") > bb.maxpeak <- wavCWTPeaks (bb.maxtree) > Error in `row.names<-.data.frame`(`*tmp*`, value = c("1", "0")) : > invalid 'row.names' length > bb.minpeak <- wavCWTPeaks (bb.mintree) > Error in `row.names<-.data.frame`(`*tmp*`, value = c("1", "0")) : > invalid 'row.names' length > > Attached are "aa" breathing cycle amplitude values (zip compressed) > I'd like to figure out what is wrong with my data. > wmTSA documentation does not mention any time series constraint. > > Thank you in advance. > Kind regards, > Maura > > -----Messaggio originale----- > Da: stephen sefick [mailto:[EMAIL PROTECTED] > Inviato: mar 09/12/2008 8.11 > A: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Oggetto: Re: [R] package "wmtsa": wavCWTPeaks error > > Are the names of the rows the same as the time series that you are > using? I know that I am not being that helpful, but this seems like a > mismatch in the time series object. look at > length(rowname(your.data)) > length(your.data[,1]) > > again it is always helpful to have reproducible code. > > On Tue, Dec 9, 2008 at 1:39 AM, <[EMAIL PROTECTED]> wrote: >> I keep getting the following error when I look for minima in the series: >> >>> aa.peak <- wavCWTPeaks (aa.tree) >> Error in `row.names<-.data.frame`(`*tmp*`, value = c("1", "0")) : >> invalid 'row.names' length >> >> How can I work it around ? >> >> Thank you. >> >> Regards, >> Maura >> >> >> Alice Messenger ;-) chatti anche con gli amici di Windows Live Messenger e >> tutti i telefonini TIM! >> Vai su http://maileservizi.alice.it/alice_messenger/index.html?pmk=footer >> >> ______________________________________________ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> >> > > > > -- > Stephen Sefick > > Let's not spend our time and resources thinking about things that are > so little or so large that all they really do for us is puff us up and > make us feel like gods. We are mammals, and have not exhausted the > annoying little problems of being mammals. > > -K. Mullis > > > > > Alice Messenger ;-) chatti anche con gli amici di Windows Live Messenger e > tutti i telefonini TIM! > Vai su http://maileservizi.alice.it/alice_messenger/index.html?pmk=footer > > > > Alice Messenger ;-) chatti anche con gli amici di Windows Live Messenger e > tutti i telefonini TIM! > Vai su http://maileservizi.alice.it/alice_messenger/index.html?pmk=footer -- Stephen Sefick Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis Alice Messenger ;-) chatti anche con gli amici di Windows Live Messenger e tutti i telefonini TIM! Vai su http://maileservizi.alice.it/alice_messenger/index.html?pmk=footer [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.