similar to: Create an AR(1) covariance matrix

Displaying 20 results from an estimated 10000 matches similar to: "Create an AR(1) covariance matrix"

2011 Oct 19
1
Sparse covariance estimation (via glasso) shrinking to a "nonzero" constant
I've only been using R on and off for 9 months and started using the glasso package for sparse covariance estimation. I know the concept is to shrink some of the elements of the covariance matrix to zero. However, say I have a dataset that I know has some underlying "baseline" covariance/correlation (say, a value of 0.3), how can I change or incorporate that into to the
2009 Feb 24
1
replace zeros in a block diagonal matrix with small random values?
Hi All. Imagine you have a large block diagonal matrix. I'd like to replace the zeros in this matrix with small random (runif) numbers. Any ideas for a simple and efficient way to do this? Best regards, Rick DeShon
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
2018 Mar 04
0
lmrob gives NA coefficients
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 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
2012 Feb 18
3
R help
Dear all, I need to generate numbers from multivariate normal with large dimensions (5,000,000). Below is my code and the error I got from R. Sigma in the code is the covariance matrix. Can anyone give some idea on how to take care of this error. Thank you. Hannah > m <- 5000000 > m1 <- 0.5*m > rho <- 0.5 > Sigma <- rho* matrix(1, m, m)+diag(1-rho, m)
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
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
2018 Mar 03
2
lmrob gives NA coefficients
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 <- matrix(rho, d, d); diag(Sigma) <- 1 x.clean <- mvrnorm(n, rep(0,d), Sigma) beta <- c(1.0, 2.0, 3.0, 4.0) error <- rnorm(n = n,
2012 Sep 27
2
Generating an autocorrelated binary variable
Hi R-fellows, I am trying to simulate a multivariate correlated sample via the Gaussian copula method. One variable is a binary variable, that should be autocorrelated. The autocorrelation should be rho = 0.2. Furthermore, the overall probability to get either outcome of the binary variable should be 0.5. Below you can see the R code (I use for simplicity a diagonal matrix in rmvnorm even if it
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
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 <-
2004 Sep 14
3
repeated measures and covariance structures
Hello- I'm trying to do some repeated measures ANOVAs. In the past, using SAS, I have used the framework outlined in Littell et al.'s "SAS System for Mixed Models", using the REPEATED statement in PROC MIXED to model variation across time within an experimental unit. SAS allows you to specify different within-unit covariance structures (e.g., compound symmetric, AR(1), etc.) to
2007 Dec 14
1
Quadratic Programming
Hi all! I have a little question concerning quadprog. To make it simple I'll start by stating the problem: I want to minimize h(d,delta)=0.5d^T B d +nabla(f(x))^T d +rho*delta^2 With respect to d\in R^n and delta \in R. I obviously have constraints (depending on both d and delta). Solve.QP does give me a good result for d but I cannot obtain anything for delta. Simce dim(Dmat)=n and
2004 Jun 07
2
MCLUST Covariance Parameterization.
Hello all (especially MCLUS users). I'm trying to make use of the MCLUST package by C. Fraley and A. Raftery. My problem is trying to figure out how the (model) identifier (e.g, EII, VII, VVI, etc.) relates to the covariance matrix. The parameterization of the covariance matrix makes use of the method of decomposition in Banfield and Rraftery (1993) and Fraley and Raftery (2002) where
2006 Feb 20
1
Extracting variance components from lmer
Hi All. I need a bit of help extracting the residual error variance from the VarCorr structure from lmer. #Here's a 2-way random effects model lmer.1 <- lmer(rating ~ (1|person)+(1|rater), data = dat) #Get the structure vc.fit <- VarCorr(lmer.1) #results in..... $person 1 x 1 Matrix of class "dpoMatrix" (Intercept) (Intercept) 0.7755392 $rater 1 x 1 Matrix
2012 Apr 26
2
ErrError in f(x, ...) : object 'g.' not found
Hi , R is a new language for me so sorry in advance if this error is to basic for posting. I have tried the R manual and search online for quite a few, if anyone could help i would be very thankful. Here is my code. kappa = 1.1 theta = 0.1 sigma = 0.4 rho = -0.6 v0 = 0.2 r = 0.05 T = 0.5 s0 = 1 K = 0.5 type = 1 Hestoncall = function(kappa,theta,sigma,rho,v0,r,T,s0,K,type) { u = 0.5 b
2012 Mar 29
1
Error, Variable is Missing
Hi, I am writing a function to plot a pdf of a distribution, GNL.pdf.fn = function(x,mu,sigma,alpha,beta,rho) { y = x-rho*mu cf.fn = function(s){ cplex = complex(1,0,1) temp1 = alpha*beta*exp(-sigma*s^2/2) temp2 = (alpha-cplex*s)*(beta+cplex*s) out = (temp1/temp2)^rho out } temp.fn = function(s){ (Mod(cf.fn(s)))*cos(Arg(cf.fn(s))-s*y) } int.fn =
2007 Jan 06
1
help with gls
Hello R-users, I am using gls function in R to fit a model with certain correlation structure. The medol as: fit.a<-gls(y~1,data=test.data,correlation=corAR1(form=~1|aa),method="ML") mu<-summary(fit.a)$coefficient With the toy data I made to test, the estimate of mu is exactly equal to the overall mean of y which can not be true. But, if I make a toy data with y more than two
2010 Jun 23
2
question about a program
Dear all, I have the following program for a multiple comparison procedure. There are two functions for the two steps. First step is to calculate the critical values, while the second step is the actual procedure [see below: program with two functions]. This work fine. However, However I want to put them into one function for the convenience of later use [see below: program with one
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