Displaying 20 results from an estimated 10000 matches similar to: "Area of density"
2001 May 10
3
lookup function for density(...) objects
Hi folks:
Is there a lookup function that returns the variate given the cumulative
probability for an object returned by the density(...) function?
> mydata _ as.vector(mymatrix)
> mydata.density _ density(mydata)
> mydata.p80 _ lookup(mydata.density, p=0.8) # is there any function to
accomplish this task?
Thanks.
Rajiv.
--------
Rajiv Prasad, Postdoctoral Research Associate,
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
2007 Jan 15
2
Kernel density output
Hi,
I'm using the density() command for a given vector x and I would like to know how to get the estimated value of the density for each element of the vector x instead of values corresponding to points from a grid.
Thanks
Florent Bresson
2003 Mar 01
2
density(), with argument of length 1 (PR#2593)
The following is from version 1.6.2 of R under Windows,
or 1.6.1 under Mac OSX/X11
> density(1)
Error in if (!(lo <- min(hi, IQR(x)/1.34))) (lo <- hi) || (lo <- abs(x[1])) || :
missing value where logical needed
I am not sure how this should be handled. I encountered it
in connection with densityplot(). In that connection, it
might be enough to modify density() so that it
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
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])
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
2010 Sep 22
2
Determine area between two density plots
Hi group,
I am creating two density plots as shown in the code below:
x1 <- c(1,4,5,3,2,3,4,5,6,5,4,3,2,1,1,1,2,3)
x2 <- c(1,4,5,3,5,7,4,5,6,1,1,1,2,1,1,1,2,3)
plot(density(x1, na.rm = TRUE))
polygon(density(x2, na.rm = TRUE), border="blue")
How can I determine the area that is covered between the two plots as
a number and how can I grey (or highlight with a pattern) the area
2009 Aug 19
2
how to fill the area under the density line with semitransparent colors
Dear R-listers,
I have created a plot to display the density lines for the same
variable by different entities. Now, I want to fill the area under the
density lines with semitransparent colors.
Though I have checked that in web-searching and book-reading, I still
do not perform that.
Could anyone please give me any helps or advice? Thank you in advance.
The data and code I used listed below:
#
2007 Oct 03
2
Shading area under density curves
Hello,
I have a question regarding shading regions under curves to display
95% confidence intervals. I generated bootstrap results for the slope
and intercept of a simple linear regression model using the following
code (borrowed from JJ Faraway 2005):
> attach(allposs.nine.d)
> x<-model.matrix(~log(d.dist,10))[,-1]
> bcoef<-matrix(0,1000,2)
> for(i in 1:1000){
+
2018 Mar 11
0
Empirical density estimation
On 3/11/2018 3:35 PM, Christofer Bogaso wrote:
> But for my reporting purpose, I need to generate a bell curve like
> plot based on empirical PDF, that also contains original points.
>
> Any idea would be helpful. Thanks,
>
Christofer,
something like the following may get you what you want:
## get the kernel density estimate
dens <- density(Dat)
## estimate the density at
2017 Aug 26
1
Fwd: Find maxima of a function
Hi,
Thanks for your mail, and time
It is not working for some arguments, when mean value is like >6.
case
mc0 <- c(0.08844446,0.1744455,0.1379778,0.1209769,0.1573065,0.
1134463,0.2074027)
rv <-UnivarMixingDistribution(Norm(486.4255, 53.24133),
Norm(664.0713, 3.674773),
Norm(669.0484, 4.101381),
2005 Nov 01
3
Area under standard normal density
What is the correct syntax for finding the area under the standard
normal density for a particular value of z?
Thanks
[[alternative HTML version deleted]]
2007 May 21
1
Graphically show population density for a specific geographic area using R
Hi,
we all know that R is powerful in dealing with graphics.
I am now trying to use R to show some geographic attributes for a
specific geographic area on a graph. For example, if I would like to
generate a graph showing the population densities (in terms of the
intensity of colors) for Illinois State by zip codes. I did some
research; and it seems that package "maptools" is
2005 Dec 10
2
Problems with integrate
Hi,
Having a weird problem with the integrate function.
I have a function which calculates a loss density: I'd like to integrate
it to get the distribution.
The loss density function is:
lossdensity<-function(p,Beta,R=0.4){
# the second derivative of the PDF
# p is the default probability of the pool at which we are evaluating
the lossdensity
# Beta is the correlation with the market
2018 Mar 11
2
Empirical density estimation
But for my reporting purpose, I need to generate a bell curve like
plot based on empirical PDF, that also contains original points.
Any idea would be helpful. Thanks,
On Mon, Mar 12, 2018 at 3:49 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
> You need to re-read ?density and perhaps think again -- or do some study --
> about how a (kernel) density estimate works. The points at
2011 Aug 15
2
area under the curve
HI there, I have been trying to use a code posted on R help to be able to calculate area under the curve for complicated data points and there seems to be an issue with the code: no "b" object found. I am not a good R user and can''t find were the problem is. Any help? Thanks!!
This is the code ( as a test run I gave it this info because I know the answer:
x<-seq(1:50)
2017 Aug 26
0
Find maxima of a function
Please keep the list in cc.
Sorry, it didn't work as expected. Maybe someone else have an appropriate
solution.
Best,
Ulrik
On Sa., 26. Aug. 2017, 12:57 niharika singhal <niharikasinghal1990 at gmail.com>
wrote:
> Hi
>
> Thanks for you mail,
> I really appreciate your time on my problem
>
> I have posted this problem on
>
>
>
2007 Aug 05
1
Selectively shading areas under two density curves
Dear Listers,
I am drawing a plot of two density curves, for male and female incomes. I would
like to shade/hatch/color (whatever) the areas under the curves which are
distinctive for each gender. This is the code I have tried so far:
m <- density(topmal.d$y, bw = "sj")
f <- density(topfem.d$y, bw = "sj")
par(mfrow = c(1,1))
plot(x = c(0,400), y = c(0,0.02), type =
2011 Jan 26
2
Colour area under density curve
Hello,
I have this code to plot a certain normal distribution and represent the pnorm
value for a certain "x":
x<-300
xx <- seq(2.5,7.5, by=0.1)
yy <- dnorm(xx,5.01,0.77)
d<-signif(pnorm(log(x), 5.01,0.77),4)
xpts <- round(exp(0:8))
par(bg = "antiquewhite")
plot(xx,yy, type="l", col="blue", lwd=2, xaxt="n",