search for: simvar

Displaying 3 results from an estimated 3 matches for "simvar".

Did you mean: simiar
2003 Dec 10
0
nested analysis with lme - odd result?
...ng wrong or should I expect such 'over-detection'? I was expecting near zero variance in those other levels except say, 5% of the time. Here's some example code with variance simulated in level 2 and spurious variance appearing frequently in level 1: library(nlme) # 4 level nesting simVar <- c(0,1,0,.1) # first is level one, last becomes error nAtLevel <- c(5,5,5,5) # number of replicates at each level F1V <- F2V <- F3V <- residV <- numeric(0) for (rep in 1:100){ F1f <- F2f <- F3f <- value <- numeric(0) mn <- numeric(length(nAtLevel)) # d...
2003 Oct 16
1
Improving efficiency in "outer"-like calculation
Hello, I am doing mcmc=10000 simulations from a posterior distribution of the parameters of a mixture of K=6 normal densities. I have mcmc by K matrices simMeans, simVars and simWeights containing the simulation output: one row for each simulation, one column for each normal component of the mixture. One thing I would like to do is a plot of the posterior predictive density. In order to do that I define a vector x of points at which I want to evaluate this density...
2003 Oct 17
1
Modifying dim attribute of elements of a list
I am creating lists of vectors withing a loop. I also would like to change the dim attribute to the vectors in order to make them matrices. I have tried the following, but it doesn't work... > sim <- c('simMeans','simVars','simWeights') > indexTable <- table(modelIndex) > for (i in sim) { + assign(tmp <- paste(i,'By',sep=''),split(get(i), modelIndex)) + lapply(seq(along=indexTable),function(j) attr(get(tmp)[[j]],'dim') <<- c(indexTable[j],K)) + } Error i...