[R] Kernel Density Estimation: Generate a sample from Epanechnikov Kernel

2017-03-21 Thread Justin Thong
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

Re: [R] Kernel Density estimation at specific points

2013-02-14 Thread Robert Duval
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

Re: [R] Kernel Density estimation at specific points

2013-02-13 Thread Bert Gunter
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

[R] Kernel Density estimation at specific points

2013-02-13 Thread Robert Duval
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

[R] Kernel Density Estimation in R

2011-09-01 Thread drj571
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

Re: [R] Kernel Density Estimation at manually specified points

2011-06-28 Thread Stephen Ellison
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

Re: [R] Kernel Density Estimation at manually specified points

2011-06-27 Thread David Winsemius
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

Re: [R] Kernel Density Estimation at manually specified points

2011-06-27 Thread Carsten Harlaß
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

Re: [R] Kernel Density Estimation at manually specified points

2011-06-27 Thread David L Carlson
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

[R] Kernel Density Estimation at manually specified points

2011-06-26 Thread Carsten Harlaß
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

Re: [R] kernel density plot

2011-04-03 Thread Greg Snow
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

Re: [R] kernel density plot

2011-04-03 Thread Muzna Alvi
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

Re: [R] kernel density plot

2011-04-03 Thread Greg Snow
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

Re: [R] kernel density plot

2011-04-03 Thread David Winsemius
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)

Re: [R] kernel density plot

2011-04-03 Thread David Winsemius
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

[R] kernel density plot

2011-04-03 Thread Muzna Alvi
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

Re: [R] kernel density

2011-02-07 Thread Dennis Murphy
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

[R] kernel density

2011-02-07 Thread garciap
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

[R] Kernel density estimation - problem with matrix created in loop

2010-09-30 Thread Brocker84
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

Re: [R] kernel density to smooth plots

2010-05-10 Thread Dennis Murphy
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

[R] kernel density to smooth plots

2010-05-10 Thread Roslina Zakaria
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)    

Re: [R] Kernel density estimate plot for 3-dimensional data

2010-05-04 Thread Duncan Murdoch
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-

Re: [R] Kernel density estimate plot for 3-dimensional data

2010-05-04 Thread Pascal Martin
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

Re: [R] Kernel density estimate plot for 3-dimensional data

2010-05-04 Thread Duncan Murdoch
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

[R] Kernel density estimate plot for 3-dimensional data

2010-05-04 Thread Pascal Martin
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)

[R] Kernel density / weights matrix?

2010-02-09 Thread Stephan Lindner
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

[R] kernel density estimation and classification

2009-11-02 Thread wk y
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

[R] kernel density estimation and classification

2009-11-02 Thread wk y
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

Re: [R] kernel density estimates

2009-08-22 Thread David Winsemius
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

[R] kernel density estimates

2009-08-22 Thread maram salem
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

[R] kernel density estimation for univariate data using splancs

2009-08-18 Thread Kate Zinszer
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

[R] kernel density in space

2007-12-14 Thread Elke Moons
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