similar to: help in density estimation

Displaying 20 results from an estimated 3000 matches similar to: "help in density estimation"

2007 Apr 02
3
Random number from density()
Hello, I'm writing some genetic simulations in R where I would like to place genes along a chromosome proportional to the density of markers in a given region. For example, a chromosome can be presented as a list of marker locations: Chr1<-c(0, 6.5, 17.5, 26.2, 30.5, 36.4, 44.8, 45.7, 47.8, 48.7, 49.2, 50.9, 52.9, 54.5, 56.5, 58.9, 61.2, 64.1) Where the numbers refer to the locations of
2006 Jun 07
4
Density Estimation
Dear R-list, I have made a simple kernel density estimation by x <- c(2,1,3,2,3,0,4,5,10,11,12,11,10) kde <- density(x,n=100) Now I would like to know the estimated probability that a new observation falls into the interval 0<x<3. How can I integrate over the corresponding interval? In several R-packages for kernel density estimation I did not found a corresponding function. I
2003 Jan 13
2
density estimation
I've been trying to figure this out for a while, but my knowledge of R is obviously still too limited. The context is as follows: I have some time series, and I would like to estimate their densities, and then use the actual densities in a monte carlo simulation. Now, I can easily estimate the density using density(); I can write a random number generator to fit an arbitrary density
2010 Jun 14
1
script development for Unconditional Density and Probability estimation
Hello, I'd like to automate this script a bit more and cycle several parameters(both the species and the metric). For example where AnnualDepth occurs, I need to process about 12 metrics so instead of writing this entire script 12 times once for each metric I'd like to be able to automatically get another metric. Any suggestion will be greatly appreciated. Currently running Windows
2010 Sep 07
1
boundary correction - univariate kernel density estimation
Hey, Does anyone know of a package in R that provides univariate kernel density estimation with boundary correction ? or how to easily extend an existing bivariate kernel density estimation function (e.g. lambdahat in the spatialkernel package) with boundary corrections to allow univariate density estimation? Thanks a lot, Steve B. -- View this message in context:
2005 Mar 07
1
Density estimation when an end may not go to zero?
All the density estimators I've found in R seem to force the ends to go to zero. What can we do if we don't believe that, e.g., with something that might be a uniform distribution or a truncated normal with only observations above mu+sigma observed? The closest I could come to this was to artificially extend the numbers beyond the range, thereby forcing the density estimator
2008 Apr 23
1
Density estimation
Hi, I am analysing a dataset containing genetic distances within and between species. I want to show a overlap of the distributions of the intra- and interspecific values; on a second graph I use a cut-off value to determine these boundaries. As the dataset contains >30 000 values, I would like to do this with a simple line rather than superimposed histograms. Hence, density plots. With
2012 Jul 11
2
Computing inverse cdf (quantile function) from a KDE
Hello, I wanted to know if there is a simple way of getting the inverse cdf for a KDE estimate of a density (using the ks or KernSmooth packages) in R ? The method I'm using now is to perform a numerical integration of the pdf to get the cdf and then doing a search for the desired probablity value, which is highly inefficient and very slow. Thanks, -fj [[alternative HTML version deleted]]
2008 Aug 29
3
Density estimates in modelling framework
Hi all, Do any packages implement density estimation in a modelling framework? I want to be able to do something like: dmodel <- density(~ a + b, data = mydata) predict(dmodel, newdata) This isn't how sm or KernSmooth or base density estimation works. Are there other packages that do density estimation? Or is there some reason that this is a bad idea. Hadley -- http://had.co.nz/
2008 Jul 25
1
Percentile Estimation From Kernel Density Estimate
Has anyone developed a defensible method of estimating percentiles from a univariate kernel density estimate? I am working on a problem in which the density estimate is of interest, but I would also like to estimate the value of the variable for which the distribution was, say, 0.20. I spent some time searching the archives and found some message from 2006 that implied such a method was not
2012 Jan 27
4
percentage from density()
Hi folks, I know that density function will give a estimated density for a give dataset. Now from that I want to have a percentage estimation for a certain range. For examle: > y = density(c(-20,rep(0,98),20)) > plot(y, xlim=c(-4,4)) Now if I want to know the percentage of data lying in (-20,2). Basically it should be the area of the curve from -20 to 2. Anybody knows a simple
2009 Nov 05
5
Density estimate with bounds
Dear R users, I would like to show the estimated density of a (0, 1) uniformly distributed random variable. The density curve, however, goes beyond 0 and 1 because of the kernel smoothing. Example: x = runif(10000) plot(density(x)) Is there a way to estimate the density curve strictly within (0, 1) and still use some sort of smoothing? Any help would be greatly appreciated. Best regards,
2008 Dec 11
2
how to get the CDF of a density() estimation?
Hi, I've estimated a simple kernel density of a univariate variable with density(), but after I would like to find out the CDF at specific values. How can I do it? thanks for your help, with it I am very close to finish my first little bit more serious work in R, Viktor
2008 Feb 05
2
two densities with same stepsize
Hi there, I have two series of data. plotting the density function of both gives me an idea about the difference of the data. But I would like to quantify the difference I see. a <- rnorm(100) b <- rnorm(100) da <- density(a) db <- density(b) The problem is that da$x and db$x are different and so I have difficulties to compare them... Is there any way to force the density
2001 Jul 12
0
density estimation from interval-censored data
I am aware of the nice R package "logspline", which does smooth density estimation from interval-censored data (that is, values that are known to lie in a specified interval rather than known exactly). Function logspline.fit uses a maximum penalized likelihood method, with the penalty related to the number of knots used in a cubic regression-spline fit. I need to be able to do some
2012 Jun 27
2
density function
Hello, I need density function so that I can find expected value (using integration). I use density(): f= density(data) but f isn't a function and I can't get values and integrate it This is very urget, so please help. Greetings Peter -- View this message in context: http://r.789695.n4.nabble.com/density-function-tp4634563.html Sent from the R help mailing list archive at Nabble.com.
2012 Oct 01
3
calculating probability from the density function
Hello, I have a data x with normal (or very close to normal) distribution, I can plot a density distribution with density(x,...). My question is is there any way to calculate an area under this distribution (=probability) for particular range of x values, let's say for x from 0 to 2? I was not able to find any kind of simple procedure to do this. Thanks in advance for your help, Evgeny.
2010 Dec 07
3
how to get vector of data from line ?
I have created a density line d<- density(X) now I need to read values from that line for example what is the value of this line at x = 1, 2, 3 etc... -- View this message in context: http://r.789695.n4.nabble.com/how-to-get-vector-of-data-from-line-tp3076943p3076943.html Sent from the R help mailing list archive at Nabble.com.
2012 Mar 09
1
nonparametric densities for bounded distributions
Can anyone recommend a good nonparametric density approach for data bounded (say between 0 and 1)? For example, using the basic Gaussian density approach doesn't generate a very realistic shape (nor should it): > set.seed(1) > dat <- rbeta(100, 1, 2) > plot(density(dat)) (note the area outside of 0/1) The data I have may be bimodal or have other odd properties (e.g. point mass
2009 Dec 13
2
A random number from any distribution?‏
Hello, I have some data, and I want to generate random numbers following the distribution of this data (in other words, to generate a synthetic data set sharing the same stats as a given data set). Reading an old thread I found the following text: >If you can compute the quantile function of the distribution (i.e., the >inverse of the integral of the pdf), then you can use the