Displaying 20 results from an estimated 40000 matches similar to: "Weighed 2D kernel density estimator"
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/
2004 Feb 12
1
Kernel Density Estimator for 2D Binned Data
Dear All,
I am researching financial market microstructure and have approx 4 x
10^7 multivariate 2D data samples which I have counted into a 250 x 390
bin matrix (frequency counted 2D histogram) in order to more efficiently
manage the volume of data.
I now wish to construct a smooth kernel density estimate (Gaussian
kernel function) using this binned data.
Does anyone in the R community know
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
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 15
4
density estimates for fixed points
Problem:
Based on a n x 2 data matrix i want a kernel estimate of the bivariate
density. However, i also wish to specify wich points the density should be
calculated at.
I can offcourse just write the full kernel density estimate as a R-code, but
surely there must already exist some package for this operation?
The package density(), seems to create a new matrix (depending on n), where
the
2006 Jun 24
1
Overlaying 2D kernel density plots on scatterplot matrix
Hi all
We are pretty new to R here and trying to achieve something that we believe
is possible but it?s not easy to work out how to do it.
We are producing scatterplot matrices for e.g. 10 variables. What we would
like to do is superimpose 2D kernel density estimators on top of each plot
so that we end up with a scatterplot matrix of 2D kernel density (contour)
plots.
The kernel density plots
2006 Feb 15
1
using kernel density estimates to infer mode of distribution
Hello...
Is it possible to use "density" or another kernel density estimator to
identify the mode of a distribution? When I use 'density', the resulting
density plot of my data is much cleaner than the original noisy histogram,
and I can clearly see the signal that I am interested in. E.g., suppose my
data is actually drawn from two or more normal (or other)
2006 Feb 16
0
using kernel density estimates to infer mode of distribut ion
This might be of interest:
http://math.usu.edu/~minnotte/research/software/modetree.r
(I was not able to get to the link, but google has a cached version.)
Prof. Marron's SiZer maps may also be of interest, but AFAIK the code is in
Matlab only.
Andy
From: Dan Rabosky
>
>
> Hello...
>
> Is it possible to use "density" or another kernel density
> estimator to
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
2008 Nov 29
1
2D density tophat
Hello R users,
I have successfully created a square (or more generally, rectangular) tophat
smoothing routine based on altering the already available KDE2D. I would be
keen to implement a circular tophat routine also, however this appears to be
much more difficult to write efficiently (I have a routine, but it's very
slow). I tried to create one based on using crossdist to create a distance
2008 Jan 24
1
Calculating sum of squares from density estimates
Hi
I have some density estimates obtained from density(). I would like to
calculate the sum of squares of these. As the x values of the estimates
are not the same, and I would prefer not to restrict the estiomate to a
certain range of x values, how can I do the calculation?
Lets say:
d1 <- density(Data1)
d2 <- density(Data2)
If the x values would be the same, I would:
ssq <- sum(
2006 Oct 10
0
function used to smooth the scatter plot and generate a density map
Dear R-helpers,
I want to smooth a scatter plot (or 2d histogram) to generate the density
map using a squared Euclidean kernel function, with each data point
contributing a density of 1/(r*r + k) to each cell on the heatmap, where
r*r?was the squared Euclidean distance between the coordinates of the cell
and the coordinates of the point, and k was a constant smoothing factor.
There is figure to
2009 Aug 19
1
Fw: Hist & kernel density estimates
For the hist estimate
>par(mex=1.3)
>dens<-density(q)
>options(scipen=4)
> ylim<-range(dens$y)
> h<-hist(q,breaks="scott",freq=FALSE,probability=TRUE,
+? right=FALSE,xlim=c(9000,16000),ylim=ylim,main="Histogram of q(scott)")
> lines(dens)
>box()
?
For the kernel estimate>options(scipen=4)
> d <- density(q, bw =
2005 Dec 15
0
bivariate kernel density estimates at point locations ( r ather than at grid locations)
You can try `locfit', though it does local likelihood, rather than
garden-variety kernel density estimation. Here's an example:
library(locfit)
data(cldem)
den.fit <- locfit(~ x1 + x2, data=cltrain)
predict(den.fit, newdata=cltrain)
Andy
From: Strickland, Matthew
>
> Hi,
>
> My data consists of a set of point locations (x,y).
>
> I would like to know if there
2009 Aug 19
1
Hist & kernel density estimates
Dear All,
Attached are the codes of a histogram & a kernel density estimate and the output they produced.
In fact the variable q is a vector of 1000 simulated values; that is I generated 1000 samples from the pareto distribution, from each sample I calculated the value of q ( a certain fn in the sample observations), and thus I was left with 1000 values of q and I don't know the
2005 May 27
0
3D density estimation with library sm - no estimate returned
Dear List,
I have been trying to use library sm to do density estimation on a 3D
dataset. I am using the current MacOS X binary of sm from CRAN. If I do
this on a 2D dataset, sm.density returns a list including the component
"estimate" which contains the density estimate over a uniform grid. When
doing this with 3D data, although I get a nice plot (even when I don't ask
for one),
2007 Jun 28
0
new package benchden 1.0.0 : benchmark densities for nonparametric density estimation
The new package "benchden" 1.0.0 implements 28 benchmark densities for
nonparametric density estimation that were introduced by A. Berlinet and
L. Devroye ("A Comparison of Kernel Density Estimates", Pub. Inst. Stat.
Univ. Paris, XXXVIII, fasc. 3, 1994, 3-59,
http://cg.scs.carleton.ca/~luc/devs.html ). This collection includes a
variety of densities with different degrees of
2007 Jun 28
0
new package benchden 1.0.0 : benchmark densities for nonparametric density estimation
The new package "benchden" 1.0.0 implements 28 benchmark densities for
nonparametric density estimation that were introduced by A. Berlinet and
L. Devroye ("A Comparison of Kernel Density Estimates", Pub. Inst. Stat.
Univ. Paris, XXXVIII, fasc. 3, 1994, 3-59,
http://cg.scs.carleton.ca/~luc/devs.html ). This collection includes a
variety of densities with different degrees of
2006 Mar 23
1
comparative density estimates
I have two series of events over time and I want to construct a graph of the
relative frequency/density of these events that allows their
distributions to
be sensibly compared. The events are the milestones items in my project on
milestones in the history of data visualization [1], and I want to
compare trends
in Europe vs. North America.
I decided to use a graph of two overlaid density
2013 Feb 13
1
Kernel Density estimation at specific points
Dear All,
I was wondering whether someone has created a kernel density evaluator that
estimates the density at given specified points.
The regular density() function evaluates the kernel at equidistant points,
but I am interested in doing such evaluation along a list of values
existing in a pre-specified vector. (Similar to the option at() in the
kdensity command in Stata).
This question has