Displaying 20 results from an estimated 300 matches similar to: "strange results with dmvnorm"
2006 Jan 20
2
big difference in estimate between dmvnorm and dnorm, how come?
Dear R community,
I was trying to estimate density at point zero of a multivariate
distribution (9 dimensions) and for this I was using a multinormal
approximation and the function dmvnorm , gtools package.
To have a sense of the error I tried to look the mismatch between a
unidimensional version of my distribution and estimate density at
point zero with function density, dmvnorm and dnorm.
At
2013 Jun 06
1
dmvnorm
Summary:
+ I am writing an R extension that needs to call dmvnorm more than
10,000 times during a model fitting computation.
+ My extension uses openmp for parallel execution.
+ As of R 3.0, it is no longer permitted for threads to call the R
interpreter because there is a stack overflow check that always trips
because the thread's stack is different from what R is expecting.
+
2010 Mar 13
2
dmvnorm masked by emdbook
I am using curve3d in the emdbook package to graph a gaussian copula density
function generated via the copula package. Unfortunately, it appears that
emdbook masks dmvnorm from the package mvtnorm in a way that prohibits
copula from generating the gaussian copula. (Sounds very confusing!) For
example,
> library(copula)
> f<-function(x,y) dcopula(normalCopula(0),c(x,y))
>
2007 Feb 26
3
returns from dnorm and dmvnorm
Hi All,
Why would calls to dnorm and dmvnorm return values that are above 1? For
example,
> dnorm(0.00003,mean=0, sd=0.1)
[1] 3.989423
This is happening on two different installations of R that I have.
Thank you.
Hailu
[[alternative HTML version deleted]]
2009 Nov 18
2
Error "system is computationally singular" by using function dmvnorm
Dear R users,
i try to use function dmvnorm(x, mean, sigma, log=FALSE)
from R package mvtnorm to calculate the probability of x
under the multivariate normal distribution with mean equal
to mean and covariance matrix sigma.
I become the following
Error in solve.default(cov, ...) :
system is computationally singular: reciprocal condition
number = 1.81093e-19
What could be the reason of it?
2011 Aug 30
2
Multivariate Normal: Help wanted!
I have the following function, a MSE calc based on some Multivariate normals:
MV.MSE<-function(n,EP,X,S){
(dmvnorm(X,mean=rep(0,2),I+S+EP)-dmvnorm(X,mean=rep(0,2),I+S))^2
+
1/n*(dmvnorm(X,mean=rep(0,2),1+S+EP/2)*det(4*pi*EP)^-.5-
(dmvnorm(X,mean=rep(0,2),I+S+EP ))^2)}
I can get the MV.MSE for given values of the function e.g
2010 Jun 23
3
integrate dmvtnorm
Hello, everyone,
I have a question about integration of product of two densities.
Here is the sample code; however the mean of first density is a function of
another random variable, which is to be integrated.
##
f=function(x) {dmvnorm(c(0.6, 0.8), mean=c(0.75, 0.75/x))*dnorm(x, mean=0.6,
sd=0.15)}
integrate(f, lower=-Inf, upper=Inf)
## error message
Error in dmvnorm(c(0.6, 0.8), mean = c(0.75,
2001 Aug 30
1
MCMC coding problem
Dear All,
I am trying to convert some S-plus code that I have to run MCMC into
R-code. The program works in S-plus, but runs slowly.
I have managed to source the program into R. R recognizes that the program
is there; for example, it will display the code when I type the function
name at the prompt. However, the program will not run. When I try to run
the program, I get the following error
2002 Apr 03
3
non-stationary covariance
Hi !
Sorry for my ignorance. I have two questions:
1) which is in R the function to make a covariogram of spatial data ?
2) does anyone know if there exist the possibility in R of performing
kriging with an arbitrary covariance function ?
If I have well understood the Krig procedure offers only three
possibilities (expcov, gauscov and sphercov) that are the common models
for stationary and
2012 Apr 25
2
comparison of bivariate normal distributions
sorry for cross-posting
Dear all,
I have tow (several) bivariate distributions with a known mean and variance-covariance structure (hence a known density function) that I would like to compare in order to get an intersect that tells me something about "how different" these distributions are (as t-statistics for univariate distributions).
In order to visualize what I mean hear a little
2008 Oct 01
2
Bivariate normal
Package mvtnorm provides dmvnorm, pmvnorm that can be used to compute
Pr(X=x,Y=y) and Pr(X<x,Y<y) for a bivariate normal.
Are there functions that would compute Pr(X<x,Y=y)?
I'm currently using "integrate" with dmvnorm but it is too slow.
2008 Mar 23
2
problem with 'install.packages'
Hi, All:
Is there a way to identify whether any users are using a
particular package in a shared network R installation?
I ask, because we have such a multiple-user installation and when
I tried to install a package using Rgui that was in use by Rterm on a
single-user installation, 'install.packages' deleted the existing
package but failed to install the new version;
2013 Jan 28
1
Adding 95% contours around scatterplot points with ggplot2
Hi all,
I have been looking for means of add a contour around some points in a
scatterplot as a means of representing the center of density for of the
data. I'm imagining something like a 95% confidence estimate drawn around
the data.
So far I have found some code for drawing polygons around the data. These
look nice, but in some cases the polygons are strongly influenced by
outlying points.
2020 Jun 04
2
mclust package installation is preparing for lazy loading and never finishes
Hi,
After loading R 4.0.0 on Ubuntu 20.04.
R version 4.0.0 (2020-04-24) -- "Arbor Day"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()'
2009 Jun 22
1
The gradient of a multivariate normal density with respect to its parameters
Does anybody know of a function that implements the derivative (gradient) of
the multivariate normal density with respect to the *parameters*?
It?s easy enough to implement myself, but I?d like to avoid reinventing the
wheel (with some bugs) if possible. Here?s a simple example of the result
I?d like, using numerical differentiation:
library(mvtnorm)
library(numDeriv)
f=function(pars, xx, yy)
2013 Oct 20
5
nlminb() - how do I constrain the parameter vector properly?
Greets,
I'm trying to use nlminb() to estimate the parameters of a bivariate normal sample and during one of the iterations it passes a parameter vector to the likelihood function resulting in an invalid covariance matrix that causes dmvnorm() to throw an error. Thus, it seems I need to somehow communicate to nlminb() that the final three parameters in my parameter vector are used to
2008 Aug 01
2
contour lines in windows device but neither in pdf nor in postscript
library(mvtnorm)
x = seq(-4,4,length=201)
xy = expand.grid(x,x)
sigma = (diag(c(1,1))+1)/2
d2 = matrix(dmvnorm(xy,sigma=sigma),201)
xsamp = rmvnorm(200,sigma=sigma)
contour(x,x,d2)
points(xsamp,col=3,pch=16)
pdf("pdftry.pdf")
contour(x,x,d2)
points(xsamp,col=3,pch=16)
dev.off()
postscript("pstry.ps")
contour(x,x,d2)
points(xsamp,col=3,pch=16)
dev.off()
# I can see
2002 Nov 12
1
Probabilities for bivariate normal distribution with adapt
Dear R-List:
I`m trying to calculate the probabilities for a bivariate normal
distribution while using the mvtnorm-package(dmvnorm) and the
adapt-package for multidimensional integration.
The problem is that I can`t specify the upper bound in the adapt-package
the way I need it because I don`t need a rectangular area. I want to
calculate the probability starting at the origin under the line y=x.
2005 Feb 24
1
Density of the Multivariate T Distribution
Hi,
I am looking for an efficient way to compute the
values of the density function of a multivariate T
distribution - something like "dmvnorm", but for T
distr. Does this exist somewhere?
Many thanks,
Jan Bulla
Goettingen University
2011 May 12
2
Exporting interactive 3D plots with axes and labels
Hi,
I have a question about exporting interactive 3D plots. I use the following code to plot a contour of a trivariate normal distribution:
library(mvtnorm)
library(rgl)
library(misc3d)
n=25
x=seq(-3,3,length=n)
X=cbind(rep(x,each=n**2),rep(rep(x,each=n),n),rep(x,n**2))
p=array(dmvnorm(X,sigma=diag(3)*0.5+0.5),c(n,n,n))
contour3d(p,x,x,x,level=mean(p))
lim=c(-3,3)