search for: niter

Displaying 20 results from an estimated 56 matches for "niter".

Did you mean: inter
2011 Aug 29
3
how to start R script editor by default
Hi All, 1) Is it possible to set the options such that R opens a new script editor every time I start the R and 2) specify the size of windows. Thanks for the suggestion and Best regards, Krishna [[alternative HTML version deleted]]
2005 Jun 08
6
Random seed problem in MCMC coupling of chains
Hello! I am performing coupling of chains in MCMC and I need the same value of seed for two chains. I will show demo of what I want: R code, which might show my example is: niter <- 3 nchain <- 2 tmpSeed <- 123 for (i in 1:niter) { # iterations for (j in 1:nchain) { # chains set.seed(tmpSeed) a <- runif(1) cat("iter:", i, "chain:", j, "runif:", a, "\n") tmpSeed <- .Random.seed } } I get this: iter:...
2007 Jun 01
2
Interaction term in lmer
...: trt (fixed) + center (random) + trt*center interaction. Then, I want to compare these 2 models with Likelihood Ratio Test. Here are my lmer codes that I don't feel comfortable about their correctness. model1 <- try(lmer(cbind( yvect, nvect-yvect) ~ 1 + (1 | center), family = binomial, niter = 25, method = "Laplace", control = list(usePQL = FALSE) )) model2 <- try(lmer(cbind( yvect, nvect-yvect) ~ trt*center + ( 1 | center) , family = binomial, niter = 25, method = "Laplace", control = list(usePQL = FALSE) )) (I have attached outputs below) What I don...
2011 Jun 08
1
using stimulate(model) for parametric bootstrapping in lmer repeatabilities
...(lme4::VarCorr(model)$C, "stddev")^2 + attr(lme4::VarCorr(model)$D, "stddev")^2 ) My question is can I use stimulate(model) to generate values that I can then use to do parametric bootstrap analysis and generate the confidence intervals? Something like this: n<-length(A) niter<-1000 y<-matrix(nrow=n,ncol=niter*2) for (i in 1:niter) { y[,I(i*2-1):I(i*2)]<-simulate(model)[,1] } rvalues<-numeric() for (i in 1:niter) { yboot<-cbind(y[,I(i*2-1)],y[,I(i*2)]) mboot<-lmer(y~A+B+(1|C/D)+(1|E),binomial) rvalues[i]<- attr(lme4::VarCorr(mboot)$E, "stddev&...
2007 Jan 05
1
help for memory problem with 64-bit machines
...-------------------------------------------- > > ## > ## (1) For illustration of use, a small data set with very few iterations > ## of the algorithm, using the RM criterion. > ## > > data(swiss) > anneal(cor(swiss),2,3,nsol=4,niter=10,criterion="RM") *** caught segfault *** address 0x47cd37c, cause 'memory not mapped' Traceback: 1: .Fortran("anneal", as.integer(criterio), as.integer(p), as.double(as.vector(mat)), as.integer(kmin), as.integer(kmax), as.double(valores), as...
2003 Dec 09
2
problem with pls(x, y, ..., ncomp = 16): Error in inherit s( x, "data.frame") : subscript out of bounds
...of components. Then why would you specify ncomp as well? Andy > From: ryszard.czerminski at pharma.novartis.com > > When I try to use ncomp parameter in pls procedure I get > following error: > > > library(pls.pcr) > > m <- pls(x, y, validation = "CV", niter = 68, ncomp = 16) > Error in inherits(x, "data.frame") : subscript out of bounds > > Without ncomp parameter everything seems to work OK > > > dim(x) > [1] 68 116 > > dim(y) > [1] 68 1 > > m <- pls(x, y, validation = "CV", niter = 68) &...
2013 Mar 26
2
Problem with nested for-loop
...(rep(1:10000,each=11)) j1data=cbind(its,j1data) #set up a matrix full of zeros "lnbm" where prediction results are placed #set up for loop that first loops over iteration, then species #(total iterations=10000it/spp*11spp=110000 iterations)and then over each tree #(total # of trees=259) niter=10000 nspp=11 ntrees=259 lnbm=matrix(0,10000,259) k=numeric() for (i in 1:ntrees) { for (j in 1:nspp) { for (m in 1:niter) { k=((j1data$its[m]-1)*1000)+(j1data$spp[j]) #print(k) lnbm[m,i]=j1data$b0[k]+j1data$b1[k]*predictdata$lndbh[i] } } } Thanks [[alternative H...
2013 Jan 18
0
problem that arises after using the new version of "BRugs"
...B <- spline.des(allKnots, x, derivs = rep(drv, length(x)), outer.ok = TRUE)$design Z <- B %*% LZ attr(Z, "range.x") <- range.x attr(Z, "intKnots") <- intKnots return(Z) } BRugsMCMC<- function (data, inits, parametersToSave, nBurnin, nIter, nThin, modelFile) { if ((nBurnin < 100) | (nIter < 100)) stop("currently only working for chains longer than 100") if ((100 * round(nBurnin/100) != nBurnin) | (100 * round(nIter/100) != nIter)) warning("chain lengths not multiples o...
2007 Sep 25
0
R lmer with problem of 'sd slot has negative entries'
...ary(Matrix) library(lme4) library(car) library(arm) y <- c(14, 9, 19, 12, 10, 12, 8, 11, 15, 4, 14, 13, 8, 3) n <- c( 20, 20, 20, 20, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18) center <- seq(1:14) example1 <- lmer(cbind( y, n - y) ~ 1 + ( 1 | center) , family = binomial, niter = 50, method = "Laplace", control = list (usePQL = FALSE)) fixef(example1) se.fixef(example1) example2 <- lmer(cbind( y, n - y) ~ 1 + ( 1 | center) , family = binomial, niter = 50, method = "Laplace", control = list (usePQL = TRUE)) fixef(example2) se.fixef(e...
2007 Sep 28
0
lmer giving negative, or no, estimated standard errors
...library(Matrix) library(lme4) library(car) library(arm) y <- c(14, 9, 19, 12, 10, 12, 8, 11, 15, 4, 14, 13, 8, 3) n <- c( 20, 20, 20, 20, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18) center <- seq(1:14) example1 <- lmer(cbind( y, n - y) ~ 1 + ( 1 | center) , family = binomial, niter = 50, method = "Laplace", control = list (usePQL = FALSE)) fixef(example1) se.fixef(example1) example2 <- lmer(cbind( y, n - y) ~ 1 + ( 1 | center) , family = binomial, niter = 50, method = "Laplace", control = list (usePQL = TRUE)) fixef(example2) se.fixef(examp...
2011 Oct 19
1
Sparse covariance estimation (via glasso) shrinking to a "nonzero" constant
...a) = "integer" mode(itrace) = "integer" mode(ipen) = "integer" mode(is) = "integer" mode(thr) = "double" junk <- .Fortran("glasso", n, s, rho, ia, is, itrace, ipen, thr, maxit = maxit, ww = ww, xx = xx, niter = integer(1), del = double(1), ierr = integer(1), PACKAGE = "glasso") ww = matrix(junk$ww, ncol = n) xx = matrix(junk$xx, ncol = n) if (junk$ierr != 0) { stop("memory allocation error") } critfun = function(Sigmahati, s, rho, penalize.d...
2005 Feb 10
2
Writing output to a file in a loop
...#39;t know how to do that in any other way, to ommit this problem. Below I enclose the code: ############################################################ library(tseries) wig20 <- read.csv("wig20.txt", sep=";", dec=",") m <- 2321 #upper bound of time series niter <- 10 #length(wig20$CLOSE)- m fcv <- 0 for (i in 1:niter){ m <- m + 1 r <- 100*diff(log(wig20$CLOSE[1:m])) y <- r - mean(r) fit <- garch(y, order = c(1,1)) sink("garch21.txt", append = TRUE) summary(fit) logLik(fit) sink() cv <- predict(fit...
2006 May 26
2
lme, best model without convergence
...f I get convergence depends on how the method (ML/REM) and which (and how much) parameters will depend randomly on the cluster-variable. How get the bist fit without convergence? I set the parameters msVerbose and returnObject to TRUE: lmeControl(maxIter=50000, msMaxIter=200, tolerance=1e-4, niter=50, msTol=1e-5, nlmStepMax=500, ,msVerbose=TRUE ,returnObject=TRUE ) However, the lme-functions does not produce verbose output, nor does it return the best fit if lme is not converging. It returns only an error: Error in lme.formula(y ~ lndbh + I(lndbh^2) + lnh + I(lnh^2), random = ~lndbh...
2009 May 29
1
Problem making a package using S4 objects.
...LASS_REMORA_CONFIGURATION, representation(number_clusters = "numeric", class_name = "character", weighting_function="character", scale_variance="logical", s="numeric", d="numeric", alfa="numeric", eta = "numeric", niter="numeric", niter_changes="numeric", perform_sum="logical", verbose="logical"), prototype = list(number_clusters=numeric(), class_name=character(), weighting_function=character(), scale_variance=logical(), s=numeric(), d=numeric(), alfa=numeric(), eta=nu...
2002 May 31
0
Convergence and singularity in glmmPQL
...> doubt5.pql<-glmmPQL(random = ~ 1 | groupid/participantid, + fixed = r.info.doubt ~ is.prot + is.cath + is.union + is.sport + is.busi, + data = fgdata.10statements.df, + na.action=na.omit, + niter=50, + family = binomial) (the version without niter=50 just failed to converge after 10 interations; adding niter=50 gives: iteration 1 ... iteration 26 Error in solve.default(estimates[dimE[1] - (p:1), dimE[2] - (p:1), drop = FALSE]) : singular matrix `a' in so...
2008 Apr 23
1
significant variables in GPLS ?
...mes="ID") # > spex_X<-read.csv("F:/GPLS/spex_X.csv", header=TRUE, sep=";")#, row.names="ID") # > > test <- glpls1a(spex_X, spex_Y$A_mell,K.prov=7, br=FALSE) > names(test) [1] "coefficients" "convergence" "niter" "family" [5] "link" "levs" "bias.reduction" coefficients = regression coefficients convergence = whether convergence is achieved niter total = number of iterations bias.reduction = whether Firth's procedure...
2010 Nov 10
1
Difficult doubt about choose distances randomly in a matrix with a probability of event
I would like to build a model in R to simulate the seed dispersal by one plant. The plant produced 5 seeds and the probability of falling inside the eight closest space was 0.8 and in the next space 0.2 and in the rest space 0: 0 0 0 0 0 0 0.2 0.2 0.2 0.2 0.2 0 0.2 0.8 0.8 0.8 0.2 0 0.2 0.8 1 0.8 0.2 0 0.2 0.8 0.8 0.8 0.2 0 0.2 0.2 0.2 0.2 0.2 0 0 0 0 0 0 0
2012 Nov 15
1
confidence intervals with glmmPQL
...polynomial regression full model with three length terms: l, l^2, and l^3 (l=length). The length terms and intercept were the fixed effects and the random effect was a paired haul (n=18). m1<-glmmPQL(fixed=Proportion~1+Length+second+third,random=~1|Pair,family=binomial,data=species,verbose=T,niter=2,weight=(Experimental+Control)) For the majority of the models, I ended up with a constant model with no length effect. The issue I am having is with the confidence intervals that were calculated. For two models the CIs are not symmetrical around the mean proportion from the model. The CIs for...
2007 Oct 09
2
Help with gamm errors
...ssed internally to glmmPQL (see results of traceback()) [large data vector scrolls off screen] 6: eval(expr, envir, enclos) 5: eval(mcall) 4: glmmPQL(y ~ X - 1, random = rand, data = strip.offset(mf), family = family, correlation = correlation, control = control, weights = weights, niter = niterPQL, verbose = verbosePQL) 3: eval(expr, envir, enclos) 2: eval(parse(text = paste("ret$lme<-glmmPQL(", deparse(fixed.formula), ",random=rand,data=strip.offset(mf),family=family,correlation=correlation,co ntrol=control,", "weights=weights,niter=niterPQL...
2003 May 30
1
Error using glmmPQL
...d/participantid, + fixed = r.info.doubt ~ + realage + minority + female + education + income + scenario, + data = fgdata.df[coded.resource,], + na.action=na.omit, + niter=50, + family=binomial(link=probit)) iteration 1 iteration 2 iteration 3 iteration 4 iteration 5 iteration 6 iteration 7 iteration 8 Error in logLik.reStruct(object, conLin) : NA/NaN/Inf in foreign function call (arg 3) The traceback() output is very long, so...