similar to: Multivariate normal density in C for R

Displaying 20 results from an estimated 7000 matches similar to: "Multivariate normal density in C for R"

2010 Apr 12
1
Strange results from Multivariate Normal Density
Hello, I'm using dmnorm from the package {mnormt} and getting strange results. First, according to the documentation, dmnorm should return a vector of densities, and I'm only getting one value returned (which is what I would expect). I've been interpreting this as the joint density of all values in the x vector (which is what I want). Should a vector of densities be returned, and if
2003 Sep 30
2
truncated multivariate normal
Please, I would like to know how to generate a truncated multivariate normal distribution k - dimensional, X ~ NT(mu, Sigma), where the elements of X to be non-negative (except the first), and the first dimension is strictly larger than zero. Example: X ~ NT_2(mu, Sigma), where mu=c(0.5, 0.5) and Sigma=c([120, 191], [191,154]), with X_1>0 and X_2>=0 Could anybody help
2004 Jun 25
2
Simulating from a Multivariate Normal Distribution Using a Correlation Matrix
Hello, I would like to simulate randomly from a multivariate normal distribution using a correlation matrix, rho. I do not have sigma. I have searched the help archive and the R documentation as well as doing a standard google search. What I have seen is that one can either use rmvnorm in the package: mvtnorm or mvrnorm in the package: MASS. I believe I read somewhere that the latter was
2012 Feb 02
1
calculation of probability values from multivariate normal densities
Hi, I would like to know, if there's any R function, which allows calculation of probability values (0,1) from multivariate normal densities. I would be grateful for any output. Cheers, MG
2008 Jul 05
5
help about random generation of a Normal distribution of several variables
Hello. Somebody knows how can I generate a set of n random vectors of a normal distribution of several variables? For example, I want to generate n=100 random vectors of two dimensions for a normal with mean c(0,1) and variance matrix: matrix(c(2,1,1,3),2,2). Thanks in advance, Arnau.
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 Jul 06
1
Conditional Distribution of MVN variates
Hi Folks, Given k RVs with MVN distribution N(mu,S) (S a kxk covariance matrix), let (w.l.o.g.) X1 denote the first r of them, and X2 the last (k-r). Likewise, let mu1 and mu2 denote their respective expectations. Then, of course, the expectation of X2 given X1=x1 is mu2 + S21*inv(S22)*(x1 - mu1) and the covariance matrix of X2 given X1=x2 is S22 - S21*inv(X11)*S12 where Sij is the
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)
2007 Aug 13
1
simulate data from multivariate normal with pre-specified correlation matrix
For example, the correlation matrix is 3x3 and looks like 1 0.75 0 0 0 0.75 1 0 0 0 0 0 0 0 0 Can I write the code like this? p<- 3 # number of variables per observation N<- 10 # number of samples # define population correlation matrix sigma sigma<-matrix(0,p,p) #creates a px p matrix of 0 rank<-2 for (i in 1:rank){ for (j in 1:rank){ rho<-0.75
2009 Jun 26
1
The Claw Density and LOCFIT
I am trying to reproduce Figure 10.5 of Loader's book: Local Regression and Likelihood. The code provided in the book does not seem to work. I have managed (a while ago) to get the accompanied R-code for the figures in the book (file called lffigs.R) from somewhere - cannot find it on the web anymore. The code in the .R script file does not work either. Could anybody please direct me in
2011 Jan 22
1
faster mvrnorm alternative
Hello, does anybody know another faster function for random multivariate normal variable simulation? I'm using mvrnorm, but as profiling shows, my algorithm spends approximately 50 % in executing mvrnorm function. Maybe some of you knows much faster function for multivariate normal simulation? I would be very gratefull for advices. -- View this message in context:
2018 Jul 03
2
LVM problems
On Mon, Jul 2, 2018 at 7:53 PM, Ulf Volmer <u.volmer at u-v.de> wrote: > On 02.07.2018 18:23, Thomas Schweikle wrote: > >> System boots into emergency mode because it does not find any of the >> logical volumes defined, because it does not enable the LVM volume >> group. >> >> Giving "lvm", then "vgchange -a y", followed by CTRL-D
2007 Feb 13
4
Generating MVN Data
Dear All I want to generate multivariate normal data in R for a given covariance matrix, i.e. my generated data must have the given covariance matrix. I know the rmvnorm command is to be used but may be I am failing to properly assign the covariance matrix. Any help will be greatly appreciated thanks. M. R. Ahmad
2011 Feb 09
1
Plot bivariate density with densities margins
Dear R users, I would like to plot the bivariate density surface with its marginal densities on the sides of the 3D box, just like in the picture I attach. I tried to found information about how to do it but did not find anything. Does anyone know how to do it? Thanks in advance, Eduardo.
2008 Nov 22
5
What's the BEST way in R to adapt this vector?
Goal: Suppose you have a vector that is a discrete variable with values ranging from 1 to 3, and length of 10. We'll use this as the example: y <- c(1,2,3,1,2,3,1,2,3,1) ...and suppose you want your new vector (y.new) to be equal in length to the possible discrete values (3) times the length (10), and formatted in such a way that if y[1] == 1, then y.new[1:3] == c(1,0,0), and if y[2] ==
2007 Oct 11
2
test for whether dataset comes from a known MVN
Dear all, I have a multivariate dataset containing 100,000 or more points. I want find the p-value for the dataset of points coming from a particular multivariate normal distribution With mean vector u Covariance matrix s2 So H0: points ~ MVN( u, s2) H1: points not ~ MVN( u, s2) How do I find the p-value in R? To me this is a likelihood ratio test problem. In H0 the parameters are
2008 Sep 09
2
densities with overlapping area of 0.35
Hi, I like to generate two normal densities such that the overlapping area between them is 0.35. Is there any code/package available in R to do that?? Regards, Lavan -- View this message in context: http://www.nabble.com/densities-with-overlapping-area-of-0.35-tp19384741p19384741.html Sent from the R help mailing list archive at Nabble.com.
2008 Apr 14
5
Equivalent to a BY command in SAS
Hi, I'm very new to R and absolutely love it. Does anyone know how to use something in R that functions like a BY command in SAS? For example, let's say you have a variable x, and you want to see the mean. Easy... > mean(x) But what if you want to see the mean of x conditional on another discrete variable? My best attempts so far are something like... > mean(x, y_cat=1)
2014 Nov 25
5
Dealing with an unreliable remote
'Lo. I've run into a frustrating issue when trying to synchronize a directory hierarchy over a reliable (but slow) connection to an unreliable remote. Basically, I have the following: http://mvn-repository.io7m.com/com/io7m/ This is a set of nested directories containing binaries and sources for projects I develop/maintain. Every time a new release is made, I deploy the binaries and
2010 Apr 13
1
Lapack, determinant, multivariate normal density, solution to linear system, C language
r-devel list, I have recently written an R package that solves a linear least squares problem, and computes the multivariate normal density function. The bulk of the code is written in C, with interfacing code to the BLAS and Lapack libraries. The motivation here is speed. I ran into a problem computing the determinant of a symmetric matrix in packed storage. Apparently, there are no explicit