Below are samples from a kernel density estimated "data" with gaussian
kernel.
I really like this solution of estimation of a kernel because it is nice
and elegant.
fit<-density(data)
rnorm(N, sample(data, size = N, replace = TRUE), fit$bw) #samples from
kernel density estimation
I am however in
Dear Bert,
Thanks for the pointer. I had been looking for quite some time on the
r-mailing list and didn't stumble upon the right approach.
But you were right, a broader search would have led me to the right place.
My apologies for that.
Just to close this post and give an answer to future person
Please learn to search!
A google search on "R density estimation" brought up the akj()
function in the quantreg package, which would seem to do what you
requested. However, I didn't look very hard and there are probably
still others in other packages.
-- Bert
On Wed, Feb 13, 2013 at 8:35 AM, Rob
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-s
Hello,
I am wanting to run a simulation study in R comparing several different
bandwidth selection methods for data simulated from several different
distribution types (normal, lognormal, bimodal, etc.) and wanted to know how
to calculate the mean integrated square errors for the optimal smoothin
m(500)
plot(density(x))
at<-seq(-2, 2, 0.25)
points(my.density(x, at=at))
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Carsten Harlaß
> Sent: 27 June 2011 20:19
> To: dcarl...@tamu.edu
> Cc: r-hel
Behalf Of Carsten Harlaß
Sent: Sunday, June 26, 2011 7:02 PM
To: r-help@r-project.org
Subject: [R] Kernel Density Estimation at manually specified points
Hello,
my name is Carsten. This ist my first post to R-help mailing list.
I estimate densities with the function "d
r-help-boun...@r-project.org] On
> Behalf Of Carsten Harlaß
> Sent: Sunday, June 26, 2011 7:02 PM
> To: r-help@r-project.org
> Subject: [R] Kernel Density Estimation at manually specified points
>
> Hello,
>
> my name is Carsten. This ist my first post
day, June 26, 2011 7:02 PM
To: r-help@r-project.org
Subject: [R] Kernel Density Estimation at manually specified points
Hello,
my name is Carsten. This ist my first post to R-help mailing list.
I estimate densities with the function "density" out of the package
"st
Hello,
my name is Carsten. This ist my first post to R-help mailing list.
I estimate densities with the function "density" out of the package
"stats".
A simplified example:
#generation of test data
n=10
z = rnorm(n)
#density estimation
f
quot;)
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111
From: Muzna Alvi [mailto:muzna.a...@gmail.com]
Sent: Sunday, April 03, 2011 12:52 PM
To: Greg Snow
Cc: r-help@r-project.org
Subject: Re: [R] kernel density plot
i am sorry greg, can you
i
> > Sent: Sunday, April 03, 2011 4:56 AM
> > To: r-help@r-project.org
> > Subject: [R] kernel density plot
> >
> > I am using the following commands for plotting kernel density for three
> > kinds of crops
> >
> > density(s22$Net_income_T
Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Muzna Alvi
> Sent: Sunday, April 03, 2011 4:56 AM
> To: r-help@r-project.org
> Subject: [R] kernel density plot
>
> I am using the following commands for plotting kernel
On Apr 3, 2011, at 7:55 AM, David Winsemius wrote:
On Apr 3, 2011, at 6:56 AM, Muzna Alvi wrote:
I am using the following commands for plotting kernel density for
three
kinds of crops
density(s22$Net_income_Total.1, bw="nrd0",adjust=1,
kernel=c("gaussian"))->t
plot(t, xlim=c(-3,4)
On Apr 3, 2011, at 6:56 AM, Muzna Alvi wrote:
I am using the following commands for plotting kernel density for
three
kinds of crops
density(s22$Net_income_Total.1, bw="nrd0",adjust=1,
kernel=c("gaussian"))->t
plot(t, xlim=c(-3,4), main="Net Income Distribution", axes=F,
ylim=c(0,0.0
I am using the following commands for plotting kernel density for three
kinds of crops
density(s22$Net_income_Total.1, bw="nrd0",adjust=1,
kernel=c("gaussian"))->t
plot(t, xlim=c(-3,4), main="Net Income Distribution", axes=F,
ylim=c(0,0.00035). xlab="Value in Rupees")
par(new=T)
density(s3
Hi:
y <- rnorm(50)
kd <- sm.density(y, model = "Normal")
str(kd)
List of 10
$ eval.points: num [1:100] -3.79 -3.72 -3.64 -3.57 -3.5 ...
$ estimate : num [1:100] 0.00124 0.00169 0.00225 0.00295 0.00381 ...
$ h : num 0.53
$ h.weights : num [1:50] 1 1 1 1 1 1 1 1 1 1 ...
$ weights
Hi all (again),
many thanks for the answer to the optimization problem. All is fine now. The
problem now is with kernel estimators in sm. package. I do all the work and
the graphics good, but I need the density function data for each point, and
I don't know how to get it. The only thing I get is
Hi you all!
I have a very serious problem.
What I am going to do is a kernel density estimation (Nadaraya-Watson) but
without any helping packages. I want to do it on my own and just use R as a
calculator.
The problem is that the matrix which I need does not seem to be calculated
correctly in m
Hi:
Perhaps this will do; the data were read into a data.frame object named xx.
# Melt the data - constructs a factor 'variable' whose levels are the
variable names
# and a numeric variable named 'value' containing, oddly enough, the numeric
values.
# Requires package reshape.
library(reshape)
l
Hi r-sers,
I have a data of relative frequencies for the interval of 0-20,
20-40,...380-400. I would like the two data on the same graph using the same
x-axis label. My question is how to get a smooth curve using kernel density
code if it possible for this data.
> cbind(rel_obs,rel_gen)
at, axes=FALSE, box=FALSE, drawpoints=TRUE); axes3d(c('x','y','z'))
Von: Duncan Murdoch
An: Pascal Martin
CC: r-help@r-project.org
Gesendet: Dienstag, den 4. Mai 2010, 16:46:03 Uhr
Betreff: Re: [R] Kernel density estimate plot for 3-
An: Duncan Murdoch
Gesendet: Dienstag, den 4. Mai 2010, 17:03:46 Uhr
Betreff: AW: [R] Kernel density estimate plot for 3-dimensional data
#B <- pp3(runif(300), runif(300), runif(300), box3(c(0,1)))
creates a 3d pattern with random points.
But I want it
On 04/05/2010 10:33 AM, Pascal Martin wrote:
Hi!
I have a problem with Kernel density estimate plot for 3-dimensional data in
ks-package.
Here the example:
# load ks, spatstat
# three-dimensional kernel density of B
B <- pp3(runif(300), runif(300), runif(300), box3(c(0,1)))
x <- unclass(B$data
Hi!
I have a problem with Kernel density estimate plot for 3-dimensional data in
ks-package.
Here the example:
# load ks, spatstat
# three-dimensional kernel density of B
B <- pp3(runif(300), runif(300), runif(300), box3(c(0,1)))
x <- unclass(B$data)$df
H <- Hpi(x)
fhat <- kde(x, H=H)
plot(fhat)
Dear everyone,
I'm coding the Horowitz-Spokoiny (2001) test [1], and I would be very
grateful or some advice regarding the Kernel density (apologies
beforehand if my terminology is not fully correct). I have looked into
ksmooth and npreg, but with no success.
Given a (n x p) matrix of covariate
Hi,
I am interested to use Kernel Density Estimation on bivariate data for
multi-class classification.
So far, I have managed to use the 'ks' package to plot the contours of the
kernel density estimates based on 8-class training dataset with only 2
variables.
However, I do not know how to m
Hi,
I am interested to use Kernel Density Estimation on bivariate data for
multi-class classification.
So far, I have managed to use the 'ks' package to plot the contours of the
kernel density estimates based on 8-class training dataset with only 2
variables.
However, I do not know how
On Aug 22, 2009, at 9:44 AM, maram salem wrote:
Dear All,
I have a variable q which is a vector of 1000 simulated positive
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 th
Dear All,
I have a variable q which is a vector of 1000 simulated positive 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 th
Hi,
I previously received help in extract data from a shapefile and now my question
is about kernel density estimation. My objective is to have 3 kernel density
plots; 2 for the each set of cases and the 3rd is the difference in kernel
densities between the 2 sets of cases. Previously, I used
Hello everybody,
I would like to determine kernel densities along a maze. I have distances
from each point of the maze to its neighbours and I managed by means of the
mat2listw-function in the Spdep package to assign neighbours to each point.
Each point now has a value for a Z-variable an
32 matches
Mail list logo