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 UNIVERSITY OF AARHUS 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@agrsci.dk <mailto:Joao.Fadista@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]]