similar to: 2-dim density plot

Displaying 20 results from an estimated 10000 matches similar to: "2-dim density plot"

2011 Sep 09
3
get mean from cdf
Hi All, How can I get the expected value from a discrete cdf? Is there any R function that can do this? Thanks, Annie [[alternative HTML version deleted]]
2008 Sep 23
4
How to draw the graph of f(x,y) = x * y ?
Dear All, The function curve() draws the graph of functions from R to R. Is there some homologous function to curve() to draw functions from R^2 to R? Thanks in advance, Paul
2009 Mar 17
1
help with 3-D plot of kernel density estimates
Hi, I guess I have a naive question. I use kde2d function in a standard way to estimate kernel densities of x and y (x and y are vectors) and plot them using image(). f1=kde2d(x,y) image(f1) But what if I want to see kernel estimates of three variables, x, y and z (a vector) plotted together ? Something in which x<->y is plotted and colored according to the corresponding value of z ?
2007 Feb 09
3
two perspective plots in in plot
Dear all, I would like to put two perspective plots into one plot. The help page for ?persp shows how one can add points and lines but not another perspective plot. data(volcano) z <- 2 * volcano # Exaggerate the relief x <- 10 * (1:nrow(z)) # 10 meter spacing (S to N) y <- 10 * (1:ncol(z)) # 10 meter spacing (E to W) ## Don't draw the grid lines : border = NA persp(x,
2003 Jul 12
2
help with bivariate density plot question
Dear R users: I have a dataset with two variables (>20000 observations, two samples from same subject) and I used "kernSur" from library(Genkern) to get a estimated bivariate density and corresponding plots as follows: new.data.normal<-data.normal[!is.na(data.normal[,2]),] x<-new.data.normal[,2] y<-new.data.normal[,3] op <- KernSur(x,y, xgridsize=50, ygridsize=50,
2005 Feb 05
1
plot smooth density estimates for bivariate data
Hi, there. Suppose I have a bivarariate data matrix y1 and y2. I want to plot a 3-D picture of the estimated density f(y1, y2) against y1 and y2? How can I do that? Do I use persp() or density()? Thanks for your help. Yulei $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Yulei He 1586 Murfin Ave. Apt 37 Ann Arbor, MI 48105-3135 yuleih at umich.edu 734-647-0305(H) 734-763-0421(O) 734-763-0427(O)
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
2013 Feb 14
2
3D-plots of 2D-grids
Hello everybody, I have an Ascii-grid (100x100m) with population density over Switzerland (local coordinations system, CH LV03). Now I would like to have a nice graphic to present the data. I would like to make a plot that will show the density as the z-variable and raise for example a stacking pillar showing how high the density is in that hectare. I attached a map that's similar to what I
2009 Sep 10
2
index of min elements in matrix
Hi, All, How can I get the indices of the minimum elements in a matrix without using a loop? For example, if the matrix is 4 5 2 2 8 9 5 2 3 Then I want to output (1,3), (2,1), (3,2). Thanks, Annie [[alternative HTML version deleted]]
2009 Aug 08
1
generalized linear models
Hi, R users, I am trying to use glm to do logistic regression. I know generally when I have two covariates, say x1 and x2, then I do fit <- glm(y~x1+x2,famliy='binomial') But now my covariates form a n*p matrix, say x, so actually each column is a covariate. So I think I should do fit <- glm(y~x,family='binomial') Then I need to predict new data. How should I write the
2007 May 17
1
3d graph question
Hi, this is simple, I've generated a bivariate normal distribution with a known correlation. I want to plot the density function with p(y,x) on the vertical axis and x, and y on the horizontal axes. How is that done? Thanks in advance! library(MASS) mu <- c(0,1) # mean vector sigma <- matrix(c(1,.8,.8,1), ncol=2) tmp <- mvrnorm(1000, mu, sigma) cor(tmp)
2004 Mar 17
3
Persp plotting of kernel density estimate.
Dear All, I am trying to visualize the surface of a bivariate kernel density estimate. I have a vector of bivariate observations(x,y), and a function which computes the kernel density estimate z corresponding to each observation. I cannot generate the (x,y) data in the ascending order needed by persp(x,y,z). I was wondering whether there is an R version of the S function interp. Would anybody
2003 Jan 14
4
density plot - beginner's question
Hi, I am trying to plot densities given on a two dimensional grid. My data is in the an external file, and is arranged in three columns: x, y, density how may i get a plot of this? i would like to get (1) a three dimensional plot and (2) a color coded two dimensional plot. I have tried using image(x, y, density) but i am asked to put the data in ascending order. i am not sure how i may
2003 Jan 11
2
any plot ?
Dear R-ers: I'm sorry to disturb you, I want just ask if R can plot a given complicated density function. I mean if we have the expression of the density en we want to see how it's look like? and this is a density with two variables thus it's a 3D plot Thank you very much Hicham Amsterdam
2010 Feb 20
1
Add lines (contours) to lattice wireframe plot
Hi, I draw a surface corresponding to bivariate density of independent variables (rho=0) using persp(). Then I add a contour line (i.e., circle in my case) at a particular density. Below is a minimal example of what I have so far. # Bivariate density dnorm2d <- function(x, y, rho = 0) { xoy = (x^2 - 2 * rho * x * y + y^2)/(2 * (1 - rho^2)) density = exp(-xoy)/(2 * pi * sqrt(1 - rho^2))
2011 Jul 13
2
3D density plot of point set
Hello everybody, I would like to solve the problem described below in R (if possible). I am very new to R and have therefore no idea what to even look for in the docu. Therefore, if someone could tell me if this is possible in R and where I might find the respective docu then I would already be very thankful. I have a large set (a few million) of points in 3D. I would like to create a
2013 Jun 25
1
Correct scaling of axis in persp3d plot
Hi, I want to format my axis in my persp3d plot. With my data, which I attached I created a persp3d plot with the following code, which I summarized from different code snippets I found: library(rugarch)library(rgl)library(fGarch)fd <-as.data.frame(modelfit,which ='density')color <-rgb(85,141,85,maxColorValue=255)x <-seq(-0.2,0.2,length=100)y <-c(1:2318)f
2013 Oct 15
1
plotting a marginal distribution on the plane behind a persp() plot
R'istas: I am trying to plot a marginal distribution on the plane behind a persp() plot. My existing code is: library(MASS) X <- mvrnorm(1000,mu=c(0,0),Sigma=matrix(c(1,0,0,1),2)) X.kde <- kde2d(X[,1],X[,2],n=25) # X.kde is list: $x 1*n, $y 1*n, $z n*n persp(X.kde,phi=30,theta=60,xlab="x_b",ylab="x_a",zlab="f") ->res Any suggestions are very
2010 Apr 28
1
What is the best way to plots surfaces in 3 dimensions?
Hi R help, What is the best way to plots surfaces in 3 dimensions? I also have the following availability problem with "plot3d" and "scatterplot3d", and "wireframe": install.packages("scatterplot3d") Warning: unable to access index for repository http://cran.ch.r-project.org/bin/macosx/leopard/contrib/2.10 Warning message: In getDependencies(pkgs,
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