search for: bootsamples

Displaying 4 results from an estimated 4 matches for "bootsamples".

2007 Apr 16
1
My First Function: cryptic error message
...or disguised parts that would reveal my plans for world domination. The function is right here at the top: #################### # bagging function: bagger <- function (length = 25, formula, dataframe) { trees <- vector(mode = "list", length = length) n <- nrow(dataframe) bootsamples <- rmultinom (length(trees), n, rep(1,n)/n) mod <- rpart(formula, data = dataframe, control = rpart.control(xval = 0)) for (i in 1:length(trees)) { trees[[i]] <- update(mod, weights = bootsamples[, i]) } } #brin...
2012 Jan 19
1
snow - bootstrapped correlation ranking
...lp me adjusting the following code to parallelized snow code: #Creating a data set (not needed to be parallel) n<-100 p<-100 x<-matrix(rnorm(n*p),p) y<-rnorm(n) # Bootstrapping nboot<-1000 alpha<-0.05 rhoboot <- array(0, dim=c(p,nboot)) bootranks <- array(0, dim=c(p,nboot)) bootsamples <- array( floor(runif(n*nboot)*n+1), dim=c(n,nboot)) for (i in 1:nboot){ rhoboot[,i] <- cor(y[bootsamples[,i]],x[bootsamples[,i],]) bootranks[,i] <- p+1rank(abs(rhoboot[,i])) } # Summarise results rankhigh = apply(bootranks, 1, quantile, probs=alpha/2) ranklow = apply(bootranks, 1, quantil...
2006 Jun 23
1
Problems creating packages.
I'm creating my own package for personal and I'm having trouble getting it to a point where R (v 2.3.1) will recognise it. I've followed two different tutorials for how to create the package structure and the DESCRIPTION file ( http://web.maths.unsw.edu.au/~wand/webcpdg/rpack.html , http://www.maths.bris.ac.uk/~maman/computerstuff/Rhelp/Rpackages.html#Lin-Lin ). I'm still getting
2011 Aug 12
2
Getting bootstrap statistic to work
Hi R-help, I am trying to implement a nonparametric bootstrap to find the standard errors of a simple statistics - the ratio of two scalars. I am having difficulty getting boot() to work correctly. I code a function to create the ratio of the relevant scalars. theta(data, i). When I call the function for my data and every observation appearing once, theta(test, c(1)), I get the correct