Displaying 20 results from an estimated 6000 matches similar to: "Converting 2D matrix to 3D array"
2008 Jun 26
2
constructing arbitrary (positive definite) covariance matrix
Dear list,
I am trying to use the 'mvrnorm' function from the MASS package for
simulating multivariate Gaussian data with given covariance matrix.
The diagonal elements of my covariance matrix should be the same,
i.e., all variables have the same marginal variance. Also all
correlations between all pair of variables should be identical, but
could be any value in [-1,1]. The problem I am
2007 Mar 16
1
ideas to speed up code: converting a matrix of integers to a matrix of normally distributed values
Hi all,
[this is a bit hard to describe, so if my initial description is
confusing, please try running my code below]
#WHAT I'M TRYING TO DO
I'd appreciate any help in trying to speed up some code. I've written
a script that converts a matrix of integers (usually between 1-10,000
- these represent allele names) into two new matrices of normally
distributed values (representing
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],]
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
2013 Mar 18
0
Problem with generated parameter estimates
Dear All,
I would be very grateful for your help concerning the following question:
Below mentioned programme is available on net to generate longitudinal
data. Usually we get almost same parameter estimates as used to generate
the data. The problem here is I am not able to get it for data used here,
despite increasing sample size and number of simulations. Is it normal to
expect this type of
2012 Nov 24
0
Plot of 3d stock price density
Hi,
I have thought a lot about my problem and also posted it on
stackexchange, the post can be found here:
http://stats.stackexchange.com/questions/44276/how-to-plot-3d-gbm
but I have got no useful answer, that's why I trry the last
possibility, which is to ask you professional guys.
I want to recreate the following picture with my own code, the picture
can be found in my other post:
2012 Jun 10
2
mvrnorm limits
Dear All,
I am using the following commands to generate a given dataset:
a <-c(0.348,0.007,0.503,0.58,0.21)
cov <-c(0.0448,0,0,0,0,0.0001,0.0001,0,0,0,-0.0055,-0.0005,0.0495,0,0,0.0218,0.0009,-0.0253,0.1103,0,-0.0102,-0.0007,0.00631,0.0067,0.0132)
b <-matrix(cov,nrow=5, ncol = 5, byrow = TRUE,dimnames = NULL)
g <-mvrnorm(10000,a,b)
is there a way to place limits on the simulated
2008 Jan 04
1
GLMMs fitted with lmer (R) & glimmix (SAS)
I'm fitting generalized linear mixed models to using several fixed effects (main effects and a couple of interactions) and a grouping factor (site) to explain the variation in a dichotomous response variable (family=binomial). I wanted to compare the output I obtained using PROC GLIMMIX in SAS with that obtained using lmer in R (version 2.6.1 in Windows). When using lmer I'm specifying
2009 May 22
0
EM algorithm mixture of multivariate
Hi, i would to know, if someone have ever write the code to estimate the
parameter (mixing proportion, mean, a var/cov matrix) of a mixture of two
multivariate normal distribution. I wrote it and it works (it could find
mean and mixing proportion, if I fix the var/cov matrix), while if I fix
anything, it doesn't work. My suspect is that when the algorithm iterates
the var/cov matrix, something
2009 May 22
0
EM algorithm mixture of multivariate gaussian
Hi, i would to know, if someone have ever write the code to estimate the
parameter (mixing proportion, mean, a var/cov matrix) of a mixture of two
multivariate normal distribution. I wrote it and it works (it could find
mean and mixing proportion, if I fix the var/cov matrix), while if I fix
anything, it doesn't work. My suspect is that when the algorithm iterates
the var/cov matrix, something
2018 Mar 04
0
lmrob gives NA coefficients
Hard to help you if you don't provide a reproducible example.
On Sun, Mar 4, 2018 at 1:05 PM, Christien Kerbert <
christienkerbert at gmail.com> wrote:
> d is the number of observed variables (d = 3 in this example). n is the
> number of observations.
>
> 2018-03-04 11:30 GMT+01:00 Eric Berger <ericjberger at gmail.com>:
>
>> What is 'd'? What is
2011 Feb 08
1
Simulation of Multivariate Fractional Gaussian Noise and Fractional Brownian Motion
Dear R Helpers,
I have searched for any R package or code for simulating multivariate
fractional Brownian motion (mFBM) or multivariate fractional Gaussian noise
(mFGN) when a covariance matrix are given. Unfortunately, I could not find
such a package or code.
Can you suggest any solution for multivariate FBM and FGN simulation? Thank
you for your help.
Best Regards,
Ryan
-----
Wonsang You
2006 Mar 03
1
Fractional brownian surfaces
Hi list,
I'm trying to generate fractional brownian surfaces in R.
[A detailed description with respect to various techniques to generating
these neutral landscapes has been described by Timothy Keitt (spectral
representation of neutral landscapes, Landscape Ecology, 2000) and
probably various other authours.]
Are there any packages that deal with this or related items? I've been
2018 Mar 03
0
lmrob gives NA coefficients
> On Mar 3, 2018, at 3:04 PM, Christien Kerbert <christienkerbert at gmail.com> wrote:
>
> Dear list members,
>
> I want to perform an MM-regression. This seems an easy task using the
> function lmrob(), however, this function provides me with NA coefficients.
> My data generating process is as follows:
>
> rho <- 0.15 # low interdependency
> Sigma <-
2010 Nov 19
2
simple loop problemo (Geo brownian motion)
I would like to plot multiple random walks onto the same graph. My p
variable dictates how may random walks there will be.
par(mfrow=c(1,1))
p <- 100
N <- 1000
S0 <- 10
mu <- 0.03
sigma <- 0.2
nu <- mu-sigma^2/2
x <- matrix(rep(0,(N+1)*p),nrow=(N+1))
y <- matrix(rep(0,(N+1)*p),nrow=(N+1))
t<- (c(0:N))/N
for (j in 1:p)
{
z <- rnorm(N,0,1)
x[1,j] <- 0
y[1,j]
2018 Mar 04
1
lmrob gives NA coefficients
d is the number of observed variables (d = 3 in this example). n is the
number of observations.
2018-03-04 11:30 GMT+01:00 Eric Berger <ericjberger at gmail.com>:
> What is 'd'? What is 'n'?
>
>
> On Sun, Mar 4, 2018 at 12:14 PM, Christien Kerbert <
> christienkerbert at gmail.com> wrote:
>
>> Thanks for your reply.
>>
>> I use
2007 May 31
0
adehabitat version 1.6
Dear all,
I have just uploaded to CRAN the version 1.6 of the
package 'adehabitat'. Significant changes are
listed below:
* The package has been reorganized into four parts (see
?adehabitat-package for a description): (i) management of raster maps,
(ii) habitat selection / ecological niche analysis, (iii) home range
analysis, and (iv) analysis of animals trajects. The package contains
2007 May 31
0
adehabitat version 1.6
Dear all,
I have just uploaded to CRAN the version 1.6 of the
package 'adehabitat'. Significant changes are
listed below:
* The package has been reorganized into four parts (see
?adehabitat-package for a description): (i) management of raster maps,
(ii) habitat selection / ecological niche analysis, (iii) home range
analysis, and (iv) analysis of animals trajects. The package contains
2009 Apr 03
2
Geometric Brownian Motion Process with Jumps
Hi,
I have been using maxLik to do some MLE of Geometric Brownian Motion Process and everything has been going fine, but know I have tried to do it with jumps. I have create a vector of jumps and then added this into my log-likelihood equation, know I am getting a message:
NA in the initial gradient
My codes is hear
#
n<-length(combinedlr)
j<-c(1,2,3,4,5,6,7,8,9,10)
2018 Mar 04
2
lmrob gives NA coefficients
Thanks for your reply.
I use mvrnorm from the *MASS* package and lmrob from the *robustbase*
package.
To further explain my data generating process, the idea is as follows. The
explanatory variables are generated my a multivariate normal distribution
where the covariance matrix of the variables is defined by Sigma in my
code, with ones on the diagonal and rho = 0.15 on the non-diagonal. Then y