search for: sigma0

Displaying 9 results from an estimated 9 matches for "sigma0".

Did you mean: sigma
2009 Aug 20
1
Understanding R code
What is 1. par.ests <- optimfit$par 2. fisher <- hessb(negloglik, par.ests, maxvalue=maxima); 3. varcov <- solve(fisher); 4. par.ses <- sqrt(diag(varcov)); Thanks a lot, fit.GEV <- function(maxima) { sigma0 <- sqrt((6. * var(maxima))/pi) mu0 <- mean(maxima) - 0.57722 * sigma0 xi0 <- 0.1 theta <- c(xi0, mu0, sigma0) #10/5/2007: removed assign() for maxima.nl #10/5/2007: passed additional parameter to avoid using assign() negloglik <- function(theta, maxvalue) { -sum(dGEV(maxvalue,theta[...
2008 Nov 11
1
simulate data with binary outcome and correlated predictors
...be as precise as possible on the betas would be nice. Here is the code I wrote where all predictors are continuous with variance =1 and correlations between predictors vary for each condition of Y. _________ library(MASS) N<-1000 nbX<-3 propSick<-0.2 corrSick<-.8 corrHealthy<-.9 sigma0<-matrix(corrHealthy,nbX,nbX) diag(sigma0)<-1 sigma1<-matrix(corrSick,nbX,nbX) diag(sigma1)<-1 dataHealthy<-mvrnorm(N*(1-propSick),c(0,0,0),sigma0) dataSick<-mvrnorm(N*propSick,c(1,1,1),sigma1) dataS<-as.data.frame(matrix(0,ncol=4,nrow=N)) dimnames(dataS)[[2]]<-c("IV1&q...
2010 Jun 23
1
A question about R2Winbugs
...cluster mean mu q1=rep(1/K,K) # prior for Z(n,1) ## MCMC sampling data=list("X","m","s","N","T","K","alpha","sigmae","q1") inits=function(){list(a0=rbeta(1,1,1), qx=matrix(rgamma(K^2,alpha,1),nrow=K), sigma0.r=rbeta(K,1,1))} model.sim=bugs(data,inits,model.file="model.txt",parameters=c("mu","sigma"), n.chains=3,n.iter=3500,n.burnin=500,n.thin=1,bugs.directory="C:/Users/t-wec/Desktop/WinBUGS14",codaPkg=T,debug=T) mcmcout=read.bugs(model.sim) summary(mcmcout) -----...
2001 Nov 09
2
ks.test
Dear R-List members, I want to check if a set of measurements follows better a gamma or a lognormal distribution (see data below). Using shapiro.test I can test for normality (shapiro.test(log (Lt)). To test for gamma (and normal) distribution I would use ks.test but I need to specify its shape and scale. How should I calculate these values in R? I tried > Lt.fit <- glm(Lt ~ 1,
2009 Aug 21
3
extra .
sigma0 <- sqrt((6. * var(maxima))/pi) What does the '.' do here? -- View this message in context: http://www.nabble.com/extra-.-tp25073255p25073255.html Sent from the R help mailing list archive at Nabble.com.
2008 Sep 09
2
test for a single variance
Dear R Gurus: Is there a test for a single variance available in R, please? Thanks, Edna Bell
2009 May 03
3
Optim function in the loop
...nes of codes try to do some iterations to find the global optimal values, but the function does not execute properly. Every time codes stop after one iteration right after executing the optim() function. Does anyone could have me to take a look? Thanks. if (count>0){ k=k+0.05; mu0=c(83+k,0,0) Sigma0= diag(0.4,3) initpar=c(.1+10*k,10*k,10*k,10*k) # initial parameters for Phi[1,1], the 2 Q?s and R est=optim(initpar,Linn,NULL,method="BFGS",hessian=TRUE,control=list(trace=1,REPORT=1,maxit=300)) stderr=sqrt(diag(solve(est$hessian))) estimate=est$par u=cbind(estimate,stderr) if (u[1]...
2006 Jun 01
1
setting the random-effects covariance matrix in lme
...variance-covariance matrix of the random effects and the residual variance are conditional on a (binary) grouping variable. I guess the model would have the following form (in hierarchical notation) Yi|bi,k ~ N(XiB+Zibi, sigmak*Ident) bi|k ~ N(0, Dk) K~Bernoulli(p) I can obtain different sigmas (sigma0 and sigma1 based on the factor 'dx') using the weights option in the call to lme: lme(fixed = height ~ -1 + bage + mat_ht + pat_ht + dx + time:dx + time2:dx , weights=varIdent(form=~1|dx), random = ~ time + time2 |subject, data = pilot, na.action=na.omi...
2008 May 24
0
simulated annealing
...order to reach the optimal position, f(x; u(I))=f(x)+ (1/u(I)) u(x) Initialize parameters u and I , set a random partition, x, and initialize the auxiliary variables W, q, c, r, s, and the cost and penalty functions, f and h; For each proposed move, x->y compute the cost differentials sigma0 = f(y)-f(x) and sigma u=f(y,u)-f(x,u) Accept the move with the Metropolis probability, M(sigmau,I) If the move is accepted, update x, W, q, c, r, s, f and h; After each batch of Metropolis sampling steps, perform a cooling step update (1 + E1) ; (1 + E2) ; 0 < E1 < E2 << 1 : q...