Displaying 20 results from an estimated 400 matches similar to: "Bivariate kernel density bandwidth selection"
2012 Jan 19
1
converting a for loop into a foreach loop
Dear all,
Just wondering if someone could help me out converting my code from a for()
loop into a foreach() loop or using one of the apply() function. I have a
very large dataset and so I'm hoping to make use of a parallel backend to
speed up the processing time. I'm having trouble getting selecting three
variables in the dataset to use in the foreach() loops. My for() loop code
is:
2020 Oct 28
2
R optim() function
Hi R-Help,
I am using R to do functional outlier detection (using PCA to reduce to 2 dimensions - the functional boxplot methodology used in the Rainbow package), and using Hscv.diag function to calculate the bandwidth matrix where this line of code is run:
result <- optim(diag(Hstart), scv.mat.temp, method = "Nelder-Mead", control = list(trace = as.numeric(verbose)))
Within the
2010 Apr 06
2
checking bivariate normality
x <- iris$Sepal.Length[1:50]/iris$Sepal.Width[1:50]
y <- iris$Petal.Length[1:50]/iris$Petal.Width[1:50]
I want to check whether (x,y) follows a bivariate normal distribution or
not, using density plot or scatter plot. Is it possible to plot a bivariate
density in R. I cant find any.
Arindam Fadikar
M.Stat
Indian Statistical Institute.
New Delhi, India
[[alternative HTML version
2011 Dec 22
1
overlaid filled contour plots
I'm trying to make a set of contour plots of bivariate kernel density
estimates, showing three such plots overlaid,
similar to this plot
http://euclid.psych.yorku.ca/SCS/Private/Test/ridge-boot2.pdf
except that I would like to have the contours *filled* (using
transparent colors). To make this reproducible, I've
saved the results of KernSmooth::bkde2D() in the following file:
2011 Sep 09
2
How to translate the 2D-density matrix (the output of bkde2D function) into matrix of datapoints' amounts?
It is known that function bkde2D (package "KernSmooth") returns a matrix of
density estimates over the mesh induced by x1 and x2. In Details it is
written that "... heights of the kernel, scaled by the bandwidths, at each
datapoint are summed. This sum, after a normalization, is the corresponding
fhat value in the output".
There are several questions:
1) How to calculate
2010 Feb 06
1
Why does smoothScatter clip when xlim and ylim increased?
Hi:
Is there a way to get smoothScatter to not clip when I increase the xlim and
ylim parameters?
Consider the following example:
set.seed(17)
x1<-rnorm(100)
x2<-rnorm(100)
smoothScatter(x1,x2)
#Now if I increase xlim and ylim notice that the plot seems to be clipped at
the former xlim, and ylim boundaries:
smoothScatter(x1,x2, xlim=c(-5,5), ylim=c(-5,5))
Thanks.
Jen
sessionInfo()
R
2003 May 12
1
Name spaces in R 1.7.0
Dear all,
a colleague of mine has some code that calls "linbin2D" in package
"KernSmooth" directly. That code is broken under R 1.7.0 since
"KernSmooth" does not export "linbin2D" from its namespace. Via
trial and error we found to possible solutions:
1) Edit the file NAMESPACE in the directory where KernSmooth is
installed such that linbin2D is
2009 Nov 26
2
Export kde object as shapefile
I am trying to estimate home range size using the plug-in method with kernel
density estimation in the kernel smoothing (ks) package. Unless there is
another way I am not familiar with, in order to calculate spatial area under
the space I need to convert my kde () object into a spatial object somehow
in order to calculate its spatial area. Could someone demonstrate how this
might be done?
--
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
2005 Apr 28
1
strange behaviour of importFrom directive in name space
Dear listers,
After activating the name space for my bioconductor package (prada) I
successfully ran R CMD check. However when loading the package in R and
running the examples the imported function brewer.pal from package
RColorBrewer is not found. I can directly call brewer.pal from the
RColorBrewer name space typing RColorBrewer::brewer.pal, but it is not
imported into my prada name space. When
2005 Apr 28
1
strange behaviour of importFrom directive in name space
Dear listers,
After activating the name space for my bioconductor package (prada) I
successfully ran R CMD check. However when loading the package in R and
running the examples the imported function brewer.pal from package
RColorBrewer is not found. I can directly call brewer.pal from the
RColorBrewer name space typing RColorBrewer::brewer.pal, but it is not
imported into my prada name space. When
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
2007 Sep 07
1
contourplot lines, text, and mtext
If I have a contourplot (in the lattice package) and I want to add
straight lines to it, how do I do this?
I see that there are llines() and lsegement() functions for lattice
plots, but they don't seem to do anything in this case:
library(lattice)
library(KernSmooth)
x=rnorm(10000)
y=x+rnorm(x,0,.5)
a=bkde2D(cbind(x,y),.7)
z=as.vector(a$fhat)
grid=expand.grid(x=a$x1,y=a$x2)
grid$z=z
2011 Feb 24
2
how to plot equalprobable error ellipse?
hi,R users,
Now I have some scatter figures, is there some method can plot equalprobable
error ellipse ?
--
TANG Jie
Email: totangjie@gmail.com
Tel: 0086-2154896104
Shanghai Typhoon Institute,China
[[alternative HTML version deleted]]
2004 Apr 10
2
Density Estimation
Dear Sir/Madam;
Would you please tell me what is the command that allows the estimation of the Kernel Density for some data.
Thanks,
Thami Rachidi
[[alternative HTML version deleted]]
2007 May 19
2
density
Hello,
I have a n*2 matrix, called "plan", which contains n observations from 2 variates.
I want a kernel density estimate of the joint distribution of these 2 variates.
I try : density(plan). Unfortunately, R thinks there is 2n observations (if n=10, 20 observations), where there is only n.
How to to make a multivariate kernel density estimate ?
Thank you very much.
2008 Sep 15
1
How to plot contours for joint density of 2 independently distributed r.v.?
X and Y are independently distributed random variables.
I would like to study the contours of the joint density of these two
variables.
Any function to call?
Thank you very much!
--
View this message in context: http://www.nabble.com/How-to-plot-contours-for-joint-density-of-2-independently-distributed-r.v.--tp19493126p19493126.html
Sent from the R help mailing list archive at Nabble.com.
2012 Mar 10
1
How to fit a line through the "Mountain crest", i.e., through the highest density of points - in a "loess-like" fashion.
Hi,
I'm trying to normalize data by fitting a line through the highest density
of points (in a 2D plot).
In other words, if you visualize the data as a density plot, the fit I'm
trying to achieve is the line that goes through the "crest" of the mountain.
This is similar yet different to what LOESS does. I've been using loess
before, but it does not exactly that as it takes
2012 Jun 19
1
3-D plot of a bidimensional lognormal distribution
Hi and thanks in advance to everyone who will be able to help me.
I have 2 independent lognormal distributions with different means and sd. I
want to plot them togheter in a 3D plot.
How can i do this??? I'm getting crazy...
Thanks
Ale
--
View this message in context: http://r.789695.n4.nabble.com/3-D-plot-of-a-bidimensional-lognormal-distribution-tp4633866.html
Sent from the R help
2013 Sep 22
2
colores
Como usas la función image puedes consultar la ayuda ?image o help(image) y
encontrarás el siguiente ejemplo donde se usa un diferente color Palette
(mencionada por pepeceb en su respuesta).
x <- 10*(1:nrow(volcano))
y <- 10*(1:ncol(volcano))
image(x, y, volcano, col = terrain.colors(100), axes = FALSE)
# O puedes usar directamente el número para indicar el color
image(x, y, volcano, col =