similar to: Kernel Density Estimation in R

Displaying 20 results from an estimated 10000 matches similar to: "Kernel Density Estimation in R"

2013 Mar 18
2
Fit a mixture of lognormal and normal distributions
Hello I am trying to find an automated way of fitting a mixture of normal and log-normal distributions to data which is clearly bimodal. Here's a simulated example: x.1<-rnorm(6000, 2.4, 0.6)x.2<-rlnorm(10000, 1.3,0.1)X<-c(x.1, x.2) hist(X,100,freq=FALSE, ylim=c(0,1.5))lines(density(x.1), lty=2, lwd=2)lines(density(x.2), lty=2, lwd=2)lines(density(X), lty=4) Currently i am using
2007 Nov 05
1
Combining Density plots
Hello, What I am trying to do is: Generate a density plot of a population of data. This data has a bimodal distribution so I've isolated a couple of possible sub-populations and I want to overlay these two density plots over the first to see whether they are contributing to the bimodal population. I can do this fine with plot(density(...)) and lines(density(...)) . But the resulting plots
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
2008 May 29
1
Bimodal Distribution
Hello R Users, I am doing a Latin Hypercube type simulation. I have found the improvedLHS function and have used it to generate a bunch of properly distributed uniform probabilities. Now I am using functions like qlnorm to transform that into the appropriately lognormal or triangularly distributed parameters for my modes. However I have a parameter which I believe is bimodally distributed,
2004 Oct 12
1
bandwidths for bivariate density estimation
Hi, I am using the KernSmooth package to estimate nonparametrically bivariate density functions. However, it seems that the bandwidths (one for each co-ordinate direction) have to be selected manually. This does not apply for the univariate case, for which dpik (included in KernSmooth) uses up-to-date plug-in rules. Does anyone know about a package, or function, which estimates bandwidths
2008 Dec 08
1
Multivariate kernel density estimation
I would like to estimate a 95% highest density area for a multivariate parameter space (In the context of anova). Unfortunately I have only experience with univariate kernel density estimation, which is remarkebly easier :) Using Gibbs, i have sampled from a posterior distirbution of an Anova model with k means (mu) and 1 common residual variance (s2). The means are independent of eachother, but
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
2003 Apr 09
3
plotting the lognormal density curve
I am trying to plot a lognormal density curve on top of an existing histogram. Can anybody suggest a simple way to do this? Even if someone could just explain how to plot a regular normal density curve on top of an existing histogram, it would be a big help. Also, is there some way to search through the R-help archives other than simple browsing? Thank you so much. Your help and time is greatly
2006 Jan 31
1
Density estimation with monotonic constaints
Hi All, I have a sample x={x1,x2,..,xn} fom a distribution with density f. I wish to estimate the density. I know a priori that the density is monotonically decreasing. Is there a way to do this in R? Thanks Debayan
2002 Jul 29
1
density estimation on 2-D bounded domain
Dear R experts, density estimation on a 2 dimensional bounded domain --------------------------------------------------------------------- I am currently trying to estimate the probability density (PD) of cancers within the breast using the sm library with the routine sm.density Of course a practical PD must be limited by the curve of the breast outline. I don't have a clue after perusing
2009 Nov 05
5
Density estimate with bounds
Dear R users, I would like to show the estimated density of a (0, 1) uniformly distributed random variable. The density curve, however, goes beyond 0 and 1 because of the kernel smoothing. Example: x = runif(10000) plot(density(x)) Is there a way to estimate the density curve strictly within (0, 1) and still use some sort of smoothing? Any help would be greatly appreciated. Best regards,
2009 Aug 26
2
Statistical question about logistic regression simulation
Hi R help list I'm simulating logistic regression data with a specified odds ratio (beta) and have a problem/unexpected behaviour that occurs. The datasets includes a lognormal exposure and diseased and healthy subjects. Here is my loop: ors <- vector() for(i in 1:200){ # First, I create a vector with a lognormally distributed exposure: n <- 10000 # number of study subjects
2009 Aug 22
1
kernel density estimates
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 the distribution of q. Hence, I used the given code for kernel density estimation to estimate the
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
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 =
2010 Sep 23
3
help in density estimation
Hi, guys, I'm using kernel "density" estimation. But how can I return to a density estimation for a fixed point? For example, b<-runif(1000,0,1) f<-density(b) How can I get the value of density(b) at b=0.5? Your help is extremely appreciated. Thanks. Jay -- View this message in context: http://r.789695.n4.nabble.com/help-in-density-estimation-tp2552264p2552264.html Sent
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
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),
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]]