This is probably a trivial question, but I did not see it in the FAQs. Perhaps I simply need to be pointed to some URLs. In any case, I have some sampled data that has peaks, and I would like to extract peak height, location, and width, according to almost any statistical model. Gaussian would seem to make the most sense. There can also be "steps" increasing the amplitude over a region, that should also be captured and removed before the peak analysis. Can anyone point me to either some FAQs, or "R" code to do this? I have not yet installed "R", and this is the only current use I would have for it and I want to know if it makes sense to bother before going to the effort. TIA Karl Sirotkin -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> > In any case, I have some sampled data that has peaks, > and I would like to extract peak height, location, and > width, according to almost any statistical model. > Gaussian would seem to make the most sense.Be specific about the form of your data. Do you mean that you have a single variable you measured, and you are talking about peaks of some histogram of the data? Or do you have x,y data? If the latter, the peak height is just max(y), and the location is x[y==max(y)]. The width is not too hard; I have a function that finds the FWHM. Bill Simpson -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> "Bill" == Bill Simpson <wsi at gcal.ac.uk> writes:>> In any case, I have some sampled data that has peaks, and I would >> like to extract peak height, location, and width, according to >> almost any statistical model. Gaussian would seem to make the most >> sense. Bill> Be specific about the form of your data. Do you mean that you Bill> have a single variable you measured, and you are talking about Bill> peaks of some histogram of the data? Or do you have x,y data? If Bill> the latter, the peak height is just max(y), and the location is Bill> x[y==max(y)]. where you might want to use imax <- which.max(y) x[imax] etc Bill> The width is not too hard; I have a function that finds the FWHM. which reminds me that S-plus has a function peaks() that some folks have wanted for R. If anyone has good code, not stolen from S-plus, but still compatible, please post... Martin Maechler <maechler at stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Seemingly Similar Threads
- Find peaks in histograms / Analysis of cumulative frequency
- Suggestion about "R equivalent of Splus peaks() function"
- Finding flat-topped "peaks" in simple data set
- Find peaks in dataset(x,y) and area for each peak
- Fitting a distribution to peaks in histogram