Displaying 4 results from an estimated 4 matches for "simualte".
2008 Jun 26
2
constructing arbitrary (positive definite) covariance matrix
...ly appreciated.
Examples
########
COV<-function (p = 3, sd = 1, r= 0.5){
cov <- diag(sd^2, ncol=p, nrow=p)
for (i in 1:p) {
for (j in 1:p) {
if (i != j) {
cov[i, j] <- r * sd*sd
}
}
}
cov
}
> library(MASS)
> ### Simualte multivarite gaussin data (works OK)
> Sigma<-COV(p = 3, sd = 2, r= 0.5)
> mu<-1:3
> mvrnorm(5, mu=mu, Sigma=Sigma)
[,1] [,2] [,3]
[1,] 1.2979984 1.843248 4.460891
[2,] 2.1061054 1.457201 3.774833
[3,] 2.1578538 2.761939 4.589977
[4,] 0.8775056 4.240710 2.203712
[5,]...
2003 Sep 03
1
glmmPQL probelm
Dear listers,
First let me appologize if the same mail arrives multiple times. Recently I
had some probelms sending my e-mails to the list.
I encountered a problem when running glmmPQL procuedure doing multilevel
modeling with a dichotomous outcome.
Those are the two error messages I usually get:
Error in logLik.reStruct(object, conLin) :
NA/NaN/Inf in foreign function call (arg 3)
2003 Oct 25
0
memory optimization and use of recursion
Hi listers,
In light with the recent discussion on the optimizing the use of memory in
straneous proceudres i present you m problem, and hope to some additional
ideas.
I'm running a simualtion that in each step uses quite an amount of memory
(but not exceedingly) - just to give you an idea - I create a pseudo
population (n=1000, m=3) run lme and lm model and multiply impute (M=5) and
do the
2003 Mar 03
0
R-devel RNG change
I find the documention for RNGversion in R-devel is a bit misleading,
and suggest adding a sentence to make it clear that the meaning of
"default" is not set to its meaning in the earlier R version:
`RNGversion' can be used to set the random generators as they were
in an earlier R{} version (for reproducibility). RNGversion does
not set the meaning of