[R] distribution of peaks in random data results

From: Joćo Fadista <Joao.Fadista_at_agrsci.dk>
Date: Thu, 31 May 2007 17:17:28 +0200

Dear all,  

 I have the positions of N points spread through some sequence of length L (L>N), and I would like to know how can do the following:  

1- Permute the positions of the N points along the whole sequence. Assuming a uniform distribution I did: position1 <- runif(N, 1, L)  

2- Apply a kernel convolution method to the resulting permuted points profile. For this I applied the function: d <- density(position1, bw = "sj")  

3- Record the heights of all peaks.
For this I used the estimated density values from the output of the density function above: heights1 <- d$y  

4- Repeat step 1 and 2 to be able to have a distribution of the peaks from the random data results. I don“t know how to perform this step!!!  

5- Compute the threshold by determining the alfa-level in the empirical CDF of the null distribution. Assuming “heightsALL“ is the output of step 4 I would do this: plot(ecdf(heightsALL)). But I don“t know how to compute the threshold

6- Apply this threshold to the peaks estimate of the real peaks data, resulting in a series of significant peaks. This step can be done by seeing the peaks in the real data that are above the threshold and classify these as significant at the alfa-level.  

The steps mentioned above are better illustrated with a picture that can be fetched here: http://www.yousendit.com/transfer.php?action=download&ufid=0E3724F26CA53367

Best regards and thanks in advance,

Joćo Fadista
Ph.d. student          

Faculty of Agricultural Sciences
Dept. of Genetics and Biotechnology
Blichers Allé 20, P.O. BOX 50
DK-8830 Tjele          

Phone:	 +45 8999 1900	
Direct:	 +45 8999 1900	
E-mail:	 Joao.Fadista_at_agrsci.dk <mailto:Joao.Fadista_at_agrsci.dk> 	
Web:	 www.agrsci.org <http://www.agrsci.org/> 	

News and news media <http://www.agrsci.org/navigation/nyheder_og_presse> .

This email may contain information that is confidential. Any use or publication of this email without written permission from Faculty of Agricultural Sciences is not allowed. If you are not the intended recipient, please notify Faculty of Agricultural Sciences immediately and delete this email.

        [[alternative HTML version deleted]]

R-help_at_stat.math.ethz.ch 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. Received on Thu 31 May 2007 - 15:33:47 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 31 May 2007 - 16:31:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.