Displaying 20 results from an estimated 20000 matches similar to: "percentage from density()"
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
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,
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.
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/
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
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
2011 Aug 31
1
density function cannot work well on UNIX R version 2.13.
Hi, there,
I found density function?cannot work well on UNIX.R
version 2.13.1 (2011-07-08), Platform: i386-pc-solaris2.10 (32-bit)
Here is an example from R doucments which can work well on other version.
plot(density(c(-20,rep(0,98),20)), xlim = c(-4,4))#
But right now the estimated probablity =0 for all point.
Do I need do something about float point?
Thanks.
Alex
2010 Sep 23
3
help in density estimation
Hi, guys,
I'm using kernel "density" estimation. But how can I return to a density
estimation for a fixed point?
For example,
b<-runif(1000,0,1)
f<-density(b)
How can I get the value of density(b) at b=0.5?
Your help is extremely appreciated. Thanks.
Jay
--
View this message in context: http://r.789695.n4.nabble.com/help-in-density-estimation-tp2552264p2552264.html
Sent
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:
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
2010 Jul 20
2
Constrain density to 0 at 0?
I'm plotting some trip length frequencies using the following code:
plot( density(zTestData$Distance, weights=zTestData$Actual),
xlim=c(0,10),
main="Test TLFD",
xlab="Distance",
col=6 )
lines(density(zTestData$Distance, weights=zTestData$FlatWeight), col=2)
lines(density(zTestData$Distance, weights=zTestData$BrdWeight ), col=3)
which works fine except the
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.
2011 Sep 08
3
Density function: Area under density plot is not equal to 1. Why?
Hi, I have a vector 'data' of 58 probability values (bounded between 0 and 1) and want to draw a probability density function of these values. For this, I used the commands:
data <- runif(58)
a <- density(data, from=0, to=1)
plot(a, type="l",lwd=3)
But then, when I try to approximate the area under the plotted curve with the command:
area <- sum(a$y)*(a$x[1]-a$y[2])
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 Nov 25
3
plotting density for truncated distribution
I am using density() to plot a density curves. However, one of my variables
is truncated at zero, but has most of its density around zero. I would like
to know how to plot this with the density function.
The problem is that if I do this the regular way density(), values near zero
automatically get a very low value because there are no observed values
below zero. Furthermore there is some density
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
2003 May 08
2
approximation of CDF
Hi all,
is there any package in R capable of smooth approximation of CDF
basing on given sample?
(Thus, I am not speaking about ecdf)
In particular, I expect very much that the approximation should
subject to the property:
f(x0)<=f(x1) for x0<x1, where x0 and x1 belong to range of
the sample given.
Polynomial approximation could be OK for me as well.
P.S.
2012 May 17
1
oldlogspline probabilities
I using oldlogspline (from logspline package) to model data distributions, and having a problem.
My data are search area sizes. They are based on circular search radii from random points to the nearest edge of the nearest grass tussock. Search area sizes are distributed from 0 (the random point intercepts a tussock) and upwards (as points are further from any tussocks). The density of all my
2006 Aug 30
2
density() with from, to or cut and comparrison of density()
Hi
the function density() does normally integrate to one - I've checked it
and it works and I also read the previous threads.
But I realised that it does not integrate to one if I use from, to or cut.
My scenario: I simulated densities of a plants originating from an sseed
source at distance zero. Therefore the density of the plants will be
highest close to zero. Is there anything I can do
2011 Mar 03
1
Ploting Histogram with Y axis is percentage of sample for each bin
I'm trying to do something very simple...
I wan to plot a histogram where the y axis represent the percentage of the
total sample that each bin represents.
I know how to plot a histogram with the counts and density... but can't find
anything that gives me perenct of sample on the y axis.
Any help is appriciated
Below is the script I'm working with
par(mfrow=c(1,2))