Displaying 20 results from an estimated 20000 matches similar to: "how to find how many modes in 2 dimensions case"
2000 Jun 20
1
density estimation in two dimensions
Hello,
I am a newbie to R and the subject of density estimation in two
dimensions or more.
I would like to have some advice concerning a comparison between the R
packages
for density estimation in bivariate or higher order problems; I mean
explicitly
the packages:
1) ash
2) KernSmooth
3) locfit
4) sm.
My specific problem now is having a set of numerical pairs (x_i, y_i),
arising from
a
2006 Jun 14
1
Estimate region of highest probabilty density
Estimate region of highest probabilty density
Dear R-community
I have data consisting of x and y. To each pair (x,y) a z value (weight) is assigned. With kde2d I can estimate the densities on a regular grid and based on this make a contour plot (not considering the z-values). According to an earlier post in the list I adjusted the kde2d to kde2d.weighted (see code below) to estimate the
2012 Apr 18
1
ggplot2 stat_density2d issue.
Hello,
I'd be very grateful for help with some ggplot2's stat_density2d issues.
First issue is with data limits. xlim() and ylim() doesn't seem to
work; instead, estimates (and plotting) seems to be constrained to
range(x), range(y) no matter what i do. The documentation says i can
pass in kde2d's parameters to ... but pussing kde2d's "lims" parameter
achieves
2002 Dec 09
1
3D density estimation
I am trying to carry out density estimation for three dimensions
(with anywhere between a few hundred and ~8000 data points). Which
leads me to ask:
a) is there any equivalent to kde2d (in MASS) or bkde2D (in
KernSmooth) out there for three dimensions?
b) if not, my skills only seem to extend as far as writing a function
which measures density as the number of data points falling within a
2011 Nov 24
2
Question on density values obtained from kde2d() from package MASS
Hello,
I am a little bit confused regarding the density values obtained from the function kde2d() from the package MASS because the are not in the intervall [0,1] as I would expect them to be. Here is an example:
x <- c(0.0036,0.0088,0.0042,0.0022,-0.0013,0.0007,0.0028,-0.0028,0.0019,0.0026,-0.0029,-0.0081,-0.0024,0.0090,0.0088,0.0038,0.0022,0.0068,0.0089,-0.0015,-0.0062,0.0066)
y <-
2006 Apr 23
3
bivariate weighted kernel density estimator
Is there code for bivariate kernel density estimation?
For bivariate kernels there is
kde2d in MASS
kde2d.g in GRASS
KernSur in GenKern
(list probably incomplete)
but none of them seems to accept a weight parameter
(like density does since R 2.2.0)
--
Erich Neuwirth, University of Vienna
Faculty of Computer Science
Computer Supported Didactics Working Group
Visit our SunSITE at
2007 Aug 10
1
kde2d error message
Hello!
I am trying to do a smooth with the kde2d function, and I'm getting an error
message about NAs. Does anyone have any suggestions? Does this function
not do well with NAs in general?
fit <- kde2d(X, Y, n=100,lims=c(range(X),range(Y)))
Error in if (from == to || length.out < 2) by <- 1 :
missing value where TRUE/FALSE needed
Thanks in advance!!
Jen
[[alternative
2007 Jun 07
0
How to get the number of modes using kde2d
Hi,
The silverman's paper introduction offer how to find a mode for one
dimensional data based
on software
http://www.stanford.edu/~kasparr/software/silverman.r,
for two dimensional data I use kde2d to smooth it out first, then I get a
matrix of densities for all the X(one dimension) cross Y(another
dimension).
I sort X and Y first before I pass the values to kde2d(x, y, c(hx, hy)),
the
2008 Jun 25
1
confidence bounds using contour plot
Hello
I'm trying to calculate 2d confindence bounds into a scatterplot using the
function "kde2d" (package MASS) and a contour plot.
I found a similar post providing a solution - unfortunatly I do not realy
understand which data I have to use to calculated the named "quantile":
Post URL: http://tolstoy.newcastle.edu.au/R/help/03b/5384.html
> (...)
>
>> Is
2009 Dec 02
2
Joint density kde2d works improperly?
Dear all,
Please, look at the following code:
attach(geyser)
f1 <- kde2d(duration, waiting, n = 5)
a <- 0
for (i in 1:5){
for (j in 1:5){
a <- a + f1$z[i,j]
}
}
As far as I understood from Help kde2d returns matrix elements of which are
values of joint probability mass function Pr(X=x,Y=y) therefore, sum of its
elements should sum to 1.
Which is not the case from my check.
Where is
2006 Feb 17
3
Matrix indexing in a loop
How do you specify matrix location a[i,j] (or a[i-1,j], etc.) in a "for"
loop?
I am looking for a flexible method of indexing neighbors over a series
of lags (1,2,3...) and I may wish to extend this method to 3D arrays.
Example:
Data matrix
> fun
[,1] [,2] [,3]
[1,] 1 5 9
[2,] 2 6 10
[3,] 3 7 11
[4,] 4 8 12
For each element a[i,j] in
2003 Oct 22
1
2 D non-parametric density estimation
I have spatial data in 2 dimensions - say (x,y). The correlation
between x and y is fairly substantial. My goal is to use a
non-parametric approach to estimate the multivariate density describing
the spatial locations. Ultimately, I would like to use this estimated
density to determine the area associated with a 95% probability contour
for the data.
Given the strong correlation between x and
2006 Jan 19
2
function kde2d
Good evening,
I am Marta Colombo, student at Milan's Politecnico.
Thank you very much for your kindness, this mailing list is really useful.
I am using the function kde2d for two-dimensional kernel density estimation and I'd like to know something more about this kind of density estimator. In particular I'd like to know: what bandwidth is used ?
Thank you in advance for your attention
2007 Nov 26
2
2d Joint Density Plot
Hi all,
I'm fairly new to R, so I'm still trying to feel out what is available to
me. I would like to be able to plot joint density in a two dimensional plot
where density is indicated by color or darkness gradients, like a 2d color
coded topographic map. Ideally, the output would be something I could then
plot other points or lines on.
Currently, I'm calculating joint density with
2009 Mar 17
1
help with 3-D plot of kernel density estimates
Hi,
I guess I have a naive question. I use kde2d function in a standard way to
estimate kernel densities of x and y (x and y are vectors) and plot them
using image().
f1=kde2d(x,y)
image(f1)
But what if I want to see kernel estimates of three variables, x, y and z (a
vector) plotted together ? Something in which x<->y is plotted and colored
according to the corresponding value of z ?
2010 Jul 28
1
kde on Torus
Hello,
I have 2D-data on a torus, i.e. they are scattered within [0:2pi) and are
supposed to be periodic with period 2pi.
Is there a way in R for a kernel density estimation for such data? I found this
article http://www.dmqte.unich.it/personal/dimarzio/density46.pdf
but
a) I don't fully understand the article (my knowledge in statistics is poor)
b) I did not understand which Eq.
2006 Feb 11
4
Need frequency distribution for x,y coordinates
Hi,
I have a set of data in x,y coordinates across the range of -5 to 5 in each
dimension. I would like to obtain the frequency distribution of the
different points, and then graph them so you can see which of the points are
the most frequently occurring.
This would seem to be easy in Matlab, which has the hist3 command for doing
frequency distributions/histograms in 3 dimensions. However,
2009 Feb 15
2
How to plot image of contour in percent?
I have searched this forum with keywords contour and percent, it only
give one irrelevent result.
My problems is how to plot contour in percent.
In my figure, I have use kde2d to generate density of an array with
two dimension point.
Using image and contour could plot it.
But the line contour generated represent absolute value of population,
not how much pecent point within this cycle.
So, i there
2005 Jan 14
1
kde2d and borders
Hallo,
I want to use kde2d to visualize data on a sphere given in spherical
coordinates. Now the problem is, that "phi == 2*pi = 0", so in principal
I have to connect (in a graphical view) the left and right border of my
plot (and the bottom and top). Has anyone any idea how to do that ?
Thanks,
Manuel
--
-------------------------------------
Manuel Metz
Sternwarte der
2004 Nov 17
2
Cross-correlated variables in kernel density estimation
Hi,
I am wondering if the kde2d 2-D kernel density estimation function in the
MASS package can take into account the effect of correlations between the
variables. I couldn't find any achieved information on this issue.
Unfortunately, I don't have the 2002 edition of Modern Applied Statistics
with S by Venables and Ripley in case it was described there.
Thanks in advance.
Adam