similar to: Strange results from Multivariate Normal Density

Displaying 20 results from an estimated 1000 matches similar to: "Strange results from Multivariate Normal Density"

2013 Mar 21
1
"adaptIntegrate" function
Hi all, it seems that there is problem with function "adaptIntegrate", when the integration limits is infinity. Please see the code below. The second integration does not seem to work. Can anyone familiar with this give some help? Thank you with much. Hanna library(mnormt) library(cubature) ff <- function(x, rho){ mu <- rep(0,3) Sigma
2009 Jun 04
1
Using WinBUGS from R: A Multi-Way Array Problem
Please suggest a way out to the following problem. I have a T by n data matrix (say Y) where coulmns are time series of length T. To do some analysis in WinBUGS I need to construct my data as follows. yy<-rep(Y,k) ## this will be a vector Yk<-array(yy,dim=c(T,n,k)) ## data array Here the definition of dim indices is first index: T rows second index: n columns third index: for kth T by n
2013 Mar 05
2
Error message
Dear all, I got an error message when running the following code. Can anyone give any suggestions on fixing this type of error? Thank you very much in advance. Hanna > integrand <- function(x, rho, a, b, z){ + x1 <- x[1] + x2 <- x[2] + Sigma <- matrix(c(1, rho, rho, 1), 2,2) + mu <- rep(0,2) + f <-
2010 Aug 02
2
Dealing with a lot of parameters in a function
Hi all, I'm trying to define and log-likelihood function to work with MLE. There will be parameters like mu_i, sigma_i, tau_i, ro_i, for i between 1 to 24. Instead of listing all the parameters, one by one in the function definition, is there a neat way to do it in R ? The example is as follows: ll<- function(mu1=-0.5,b=1.2,tau_1=0.5,sigma_1=0.5,ro_1=0.7) { if (tau1>0 &&
2012 Jul 27
3
bivariate normal
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 the number of observations. Basically what I need is a function that takes as arguments a
2010 Oct 15
1
Problem using BRugs
Hi R users, I am trying to call openbugs from R. And I got the following error message: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ model is syntactically correct expected the collection operator c error pos 8 (error on line 1) variable ww is not defined in model or in data set [1] "C:\\DOCUME~1\\maomao\\LOCALS~1\\Temp\\RtmpqJk9R3/inits1.txt"
2008 Jul 23
1
R2WinBUGS problem
Dear friends - I'm on winXP, R 2.71 - I have with some help dveloped this multivariate normal model, which gives very plausible results in WinBUGS even without any initial values specified. However, when I then try to run the same model via the bugs function in R2WinBUGS with inits specified as inits=NULL the program stops in a dead end. So I have tried to make inits for the bugs function
2011 Feb 09
2
Generate multivariate normal data with a random correlation matrix
Hi All. I'd like to generate a sample of n observations from a k dimensional multivariate normal distribution with a random correlation matrix. My solution: The lower (or upper) triangle of the correlation matrix has n.tri=(d/2)(d+1)-d entries. Take a uniform sample of n.tri possible correlations (runi(n.tr,-.99,.99) Populate a triangle of the matrix with the sampled correlations Mirror the
2006 Jun 02
1
Multivariate skew-t cdf
Dear All, I am using the pmst function from the sn package (version 0.4-0). After inserting the example from the help page, I get non-trivial answers, so everything is fine. However, when I try to extend it to higher dimension: xi <- alpha <- x <- rep(0,27) Omega <- diag(0,27) p1 <- pmst(x, xi, Omega, alpha, df = 5) I get the following result: >p1 [1] 0 attr(,"error")
2010 Apr 08
1
a small question about R with Winbugs
I try to do a test for dirichlet process for Multivariate normal, but Winbugs always says "expected multivariate node", does that mean I miss something at initialization? I will really appreciate the help to solve this problem Here is the R code, and Winbugs code. model { for(i in 1:N){ y[i,1:2] ~ dmnorm(mu[i,],tau[i,,]) S[i] ~ dcat(pi[]) mu[i,1:2] <- mu.star[S[i],]
2011 Jun 25
2
Multivariate normal density in C for R
Does anyone know of a package that uses C code to calculate a multivariate normal density? My goal is to find a faster way to calculate MVN densities and avoid R loops or apply functions, such as when X and mu are N x K matrices, as opposed to vectors, and in this particular case, speed really matters. I would like to be able to use .C or .Call to pass X, mu, Sigma, and N to a C program and have
2006 Jan 23
1
mutlivariate normal and t distributions
Dear R-help list members, I have created a package 'mnormt' with facilities for the multivariate normal and t distributions. The core part is simply an interface to Fortran routines by Alan Genz for computing the integral of two densities over rectangular regions, using an adaptive integration method. Other R functions compute densities and generate random numbers. The starting
2013 Jun 24
0
Running MCMC using R2WinBUGS
Hi All: Not sure why my previous question never got posted. Here I am seeking some help on my code. I am using the following code to run MCMC simulation on the following data using the model below: # Data matrix<-NULL > csvs<-paste("MVN", 1:2,".csv",sep="") > for (i in 1:length(csvs)){ + matrix[[i]]<- read.csv(file=csvs[i],header=TRUE) +
2007 May 10
1
Re : CDF of a Multivariate Normal
Hello, In my simulations, I have to use the values of the cumulative distribution function of a multivariate normal with known mean vector and dispersion matrix. Please, can you tell me if there is a package in R to do that? Thank you very much for your greatly appreciate cooperation. Bernard Colin Colin Bernard Professeur titulaire Département de Mathématiques Faculté des Sciences Université
2010 Jun 16
1
generating samples from multivariate distributions
Sir, I want to draw random from any multivariate disrtibution. Is there any function in R to do this? Regards, Suman Dhara [[alternative HTML version deleted]]
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
2018 Mar 22
1
Cannot install broom package
Hello, I've problems installing several packages in my R on Fedora 27 64 bit. I found out that it has to do something with a missing compiler (libgfortran.so.3, see below). It works if I downgrade the current version of libgfortran to the specified version by downloading libgfortran-6.2.1-2.fc25.x86_64.rpm and manually installing it. However, I don't want to mess up my system,
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 Oct 02
0
Multivariate Laplace density
Can anyone show how to calculate a multivariate Laplace density? Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Multivariate-Laplace-density-tp3864072p3864072.html Sent from the R help mailing list archive at Nabble.com.
2005 May 02
1
Multivariate kernel density estimation
Hi, I need to estimate the density at the mean of a sample of a few thousands data points with a dimesion up to 5. The data is uni-modal and regularly shaped. I couldn't find any kernel density package for R which supports more than 3 dimensions. Have I overlooked a package or does somebody have code for this purpose? Any other advice? Regards, Stephan