Re: [R] Bivariate Normal Distribution Plots

2018-04-13 Thread Marc Girondot via R-help
Try this code: # Standard deviations and correlation sig_x <- 1 sig_y <- 2 rho_xy <- 0.7 # Covariance between X and Y sig_xy <- rho_xy * sig_x *sig_y # Covariance matrix Sigma_xy <- matrix(c(sig_x ^ 2, sig_xy, sig_xy, sig_y ^ 2), nrow = 2, ncol = 2) # Load the mvtnorm package library("mvtnor

Re: [R] Bivariate Normal Distribution Plots

2018-04-12 Thread Richard M. Heiberger
Please look at my book Statistical Analysis and Data Display https://www.springer.com/us/book/9781493921218 Figures 3.8, 3.9, 3.10 The code for these figures is available in the HH package install.packages("HH") library(HH) HHscriptnames(3) ## this gives the filename on your computer containing

Re: [R] Bivariate Normal Distribution Plots

2018-04-12 Thread S Ellison
> -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of JEFFERY > REICHMAN > # Standard deviations and correlation > sig_x <- 1 > sig_y <- 1 > rho_xy <- 0.0 > > # Covariance between X and Y > sig_xy <- rho_xy * sig_x *sig_y > > # Covariance matrix > Sig

[R] Bivariate Normal Distribution Plots

2018-04-12 Thread JEFFERY REICHMAN
R-Help I am attempting to create a series of bivariate normal distributions. So using the mvtnorm library I have created the following code ... # Standard deviations and correlation sig_x <- 1 sig_y <- 1 rho_xy <- 0.0 # Covariance between X and Y sig_xy <- rho_xy * sig_x *sig_y # Covariance m

Re: [R] bivariate normal

2012-08-03 Thread cchevalier
Hello, The package pbivnorm will solve your problem. http://cran.r-project.org/web/packages/pbivnorm/index.html -- View this message in context: http://r.789695.n4.nabble.com/bivariate-normal-tp4638159p4639048.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Bivariate normal integral

2012-08-03 Thread cchevalier
The package pbivnorm will certainly solve your problem. It allows a vectorized call to the cdf of the bivariate normal distribution. -- View this message in context: http://r.789695.n4.nabble.com/Bivariate-normal-integral-tp4571018p4639041.html Sent from the R help mailing list archive at Nabbl

Re: [R] bivariate normal

2012-07-27 Thread David Winsemius
On Jul 27, 2012, at 10:45 AM, Anders Holm wrote: Dear list members I need a function that calculates the bivariate normal distribution for each observation. It is part of a likelihood function and I have 1000's of cases. As I understand it I cannot use packages like "mvtnorm" because i

Re: [R] bivariate normal

2012-07-27 Thread Rolf Turner
On 28/07/12 05:45, Anders Holm wrote: Dear list members I need a function that calculates the bivariate normal distribution for each observation. It is part of a likelihood function and I have 1000's of cases. As I understand it I cannot use packages like "mvtnorm" because it requres a covar

[R] bivariate normal

2012-07-27 Thread Anders Holm
Dear list members I need a function that calculates the bivariate normal distribution for each observation. It is part of a likelihood function and I have 1000's of cases. As I understand it I cannot use packages like "mvtnorm" because it requres a covariance matrix of the same dimension as t

Re: [R] Bivariate normal integral

2012-04-19 Thread peter dalgaard
On Apr 19, 2012, at 16:08 , juliane0212 wrote: > hello, > > I'm trying to improve the speed of my calculation but didn't get to a > satisfying result. > > It's about the numerical Integration of a bivariate normal distribution. > > The code I'm currently using > > x <- > qnorm(seq(.

Re: [R] Bivariate normal integral

2012-04-19 Thread juliane0212
I also tried: m1 <- length(x)-1 X1<- cbind(x[1:m1],x1[2:length(x)]) X2<- cbind(x[1:m1],x1[2:length(x)]) integral <- function(rho){ m1 <- length(x1)-1 integral <- apply(X2,1,function(y) apply(X1,1,function(x) pmvno

[R] Bivariate normal integral

2012-04-19 Thread juliane0212
hello, I'm trying to improve the speed of my calculation but didn't get to a satisfying result. It's about the numerical Integration of a bivariate normal distribution. The code I'm currently using x <- qnorm(seq(.Machine$double.xmin,c(1-2*.Machine$double.eps),by=0.01), mean=0,sd=1)

Re: [R] Bivariate normal regression in R

2011-08-25 Thread Viechtbauer Wolfgang (STAT)
--- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Dimitris Rizopoulos > Sent: Thursday, August 25, 2011 20:28 > To: DHIMAN BHADRA > Cc: r-help@r-project.org > Subject: Re: [R] Bivariate normal regression in R > > One possibility is func

Re: [R] Bivariate normal regression in R

2011-08-25 Thread Dimitris Rizopoulos
One possibility is function gls() from package nlme. Best, Dimitris On 8/25/2011 8:22 PM, DHIMAN BHADRA wrote: Hello everyone, I need to fit a bivariate normal regression model to a dataset where the same covariate (say, X) influences two separate but correlated responses (say, Y1 and Y2). So

[R] Bivariate normal regression in R

2011-08-25 Thread DHIMAN BHADRA
Hello everyone, I need to fit a bivariate normal regression model to a dataset where the same covariate (say, X) influences two separate but correlated responses (say, Y1 and Y2). So, the bivariate model would look like : Y1 = a1 + b1*X + e1 Y2 = a2 + b2*X + e2 where e1 and e2 are error terms wh

[R] bivariate normal and rho

2009-05-05 Thread Agostino Capponi
Hi, Let f(rho) = E[F_1(x) F_2(y)], i.e f(rho) is the expectation of F(x) * F(y) with respect to the bivariate Gaussian density with mean 0 and covariance matrix [1 rho; rho 1]. Moreover, assume F_1(x) and F_2(y) to be increasing functions of x and y respectively. I was wondering if it was true th

Re: [R] Bivariate normal

2008-10-01 Thread Ravi Varadhan
sha Pustota Cc: [EMAIL PROTECTED] Subject: Re: [R] Bivariate normal On 2/10/2008, at 4:43 AM, Sasha Pustota wrote: > Package mvtnorm provides dmvnorm, pmvnorm that can be used to compute > Pr(X=x,Y=y) and Pr(X > Are there functions that would compute Pr(X I'm currently using "i

Re: [R] Bivariate normal

2008-10-01 Thread Rolf Turner
On 2/10/2008, at 11:02 AM, Ravi Varadhan wrote: I think it is meaningful to ask for a non-trivial Pr (X < x, Y=y) when you are writing down the likelihood for parameter estimation. This is commonly the case in likelihood estimation in bivariate failure time models. If one interprets P

Re: [R] Bivariate normal

2008-10-01 Thread Rolf Turner
On 2/10/2008, at 4:43 AM, Sasha Pustota wrote: Package mvtnorm provides dmvnorm, pmvnorm that can be used to compute Pr(X=x,Y=y) and Pr(X Yes: foo <- function(x,y) { 0 } I'm currently using "integrate" with dmvnorm but it is too slow. Words fail me

Re: [R] Bivariate normal

2008-10-01 Thread Sasha Pustota
P.S. just "pnorm(x, mean=m, sd=s)", not "1-pnorm(x, mean=m, sd=s) + pnorm(-x, mean=m, sd=s)" On Wed, Oct 1, 2008 at 2:04 PM, Sasha Pustota <[EMAIL PROTECTED]> wrote: > Thanks Jay. I realized that I was doing it a silly way shortly after I > posted and that the answer i was looking for is simply >

Re: [R] Bivariate normal

2008-10-01 Thread Sasha Pustota
Thanks Jay. I realized that I was doing it a silly way shortly after I posted and that the answer i was looking for is simply condXY(y, x, my, mx, r) * dnorm(y, my) condXY <- function(y, x, my, mx, r) { m <- mx + r*(y - my) s <- sqrt(1-r^2) p <- 1 - pnorm(x, mean=m, sd=s) + pnorm(-x, mean=m

Re: [R] Bivariate normal

2008-10-01 Thread G. Jay Kerns
Dear Sasha, On Wed, Oct 1, 2008 at 11:43 AM, Sasha Pustota <[EMAIL PROTECTED]> wrote: > Package mvtnorm provides dmvnorm, pmvnorm that can be used to compute > Pr(X=x,Y=y) and Pr(X > Are there functions that would compute Pr(X I'm currently using "integrate" with dmvnorm but it is too slow. Stri

[R] Bivariate normal

2008-10-01 Thread Sasha Pustota
Package mvtnorm provides dmvnorm, pmvnorm that can be used to compute Pr(X=x,Y=y) and Pr(Xhttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] Bivariate normal equal-probability curve...

2008-01-04 Thread David B. Thompson, Ph.D., P.E.
Good morning and I appreciate the availability of a help-list. I am a professional hydrologist, but not a professional statistician. Yet I find myself using statistical tools at least part of the time. My discovery of the R-project through a friend has been most helpful. Here is my problem: