search for: nreps

Displaying 20 results from an estimated 46 matches for "nreps".

Did you mean: reps
2009 Jul 22
1
R extract vertices for polygon
Dear R users, I'm trying to extract from a given matrix (GROUP) the coordinates of the vertices of the different groups (i.e. 3, 7, 1 . . .) to plot the polygons to delineate the area in which each group "wins" and colour it diferentially. I can make a simple point plot, but I would like to add polygons with full colored area. The example is with a 5x5 matrix, but I'm working
2005 Sep 08
0
Effect of data set size on calculation
Dear listers, I have a piece of code which performs an ANOVA type of analysis on 2D GC data. The code is shown below: # ANOVA 2D GC analysis # maxc <- number of samples # nreps <- number of samples maxc <- 2 nreps <- 4 sscl <- NULL cmean <- NULL # # Initial stat. variable # dftot <- nrow(mat)-1 dfcl <- maxc - 1 dferr <- dftot - dfcl totmean <- mean(mat) sstot <- sd(mat)^2*dftot # # Calculate class-to-class variance #...
2011 Feb 02
2
Help with one of "those" apply functions
Hello there, I'm still struggling with the *apply commands. I have 5 people with id's from 10 to 14. I have varying amounts (nrep) of repeated outcome (value) measured on them. nrep <- 1:5 id <- rep(c("p1", "p2", "p3", "p4", "p5"), nrep) value <- rnorm(length(id)) I want to create a new vector that contains the sum of the
2004 Mar 30
1
classification with nnet: handling unequal class sizes
...<- table(...)) diag(tab) <- 0 cat("error rate = ", round(100*sum(tab)/length(list(...)[[1]]), 2), "%\n") invisible() } CVnn2 <- function(formula, data, size = c(0,4,4,10,10), lambda = c(0, rep(c(0.001, 0.01),2)), nreps = 1, nifold = 5, verbose = 99, ...) { resmatrix <- function(predict.matrix,learn, data, ri, i) { rae.matrix <- predict.matrix rae.matrix[,] <- 0 rae.vector <- as.numeric(as.factor((predict(learn, data[ri == i,], type = "class")))) for (k i...
2004 Sep 23
0
nnet and weights: error analysis using V&R example
...seed(123) rand <- sample(10, dim(fgl)[1], replace = T) fgl1 <- fgl fgl1[1:9] <- lapply(fgl[, 1:9], function(x) {r <- range(x); (x - r[1])/diff(r)}) CVnn2 <- function(formula, data, size = c(0,4,4,10,10), lambda = c(0, rep(c(0.001, 0.01),2)), nreps = 1, nifold = 5, verbose = 99, ...) { CVnn1 <- function(formula, data, nreps=1, ri, verbose, ...) { totalerror <- 0 truth <- data[,deparse(formula[[2]])] res <- matrix(0, nrow(data), length(levels(truth))) if(verbose > 20) cat("...
2004 Sep 23
0
nnet with weights parameter: odd error
...resolve the problem- it is really very strange and I need your help! I tried it very simple in defining the weights as = 1 for each obs (as it is by default)!: CVnn2 <- function(formula, data, size = c(0,4,4,10,10), lambda = c(0, rep(c(0.001, 0.01),2)), nreps = 1, nifold = 5, verbose = 99, ...) { resmatrix <- function(predict.matrix, learn, data, ri, i) { rae.matrix <- predict.matrix rae.matrix[,] <- 0 rae.vector <- as.numeric(as.factor((predict(learn, data[ri == i,],...
2011 Mar 03
3
Probabilities greather than 1 in HIST
Dear all, I am a newbie in R and could not find help on this problem. I am trying to plot an histogram with probabilities in the y axis. This is the code I am using: #TLC uniform n=30 mi=1; mx=6 nrep=1000 xbar=rep(0,nrep) for (i in 1:nrep) {xbar[i]=mean(runif(n,min=mi,max=mx))} hist(xbar,prob=TRUE,breaks="Sturges",xlim=c(1,6),main=paste("n =",n), xlab="Média",
2011 Jan 05
0
Nnet and AIC: selection of a parsimonious parameterisation
...s[, 2:8] # excludes names, authors? predictions attach(cpus2) cpus3 <- data.frame(syct = syct-2, mmin = mmin-3, mmax = mmax-4, cach=cach/256,chmin=chmin/100, chmax=chmax/100, perf) detach() CVnn.cpus <- function(formula, data = cpus3[cpus.samp, ], maxSize = 10, decayRange = c(0,0.2), nreps = 5, nifold = 10, alpha= 9/10, linout = TRUE, skip = TRUE, maxit = 1000,...){ #nreps=number of attempts to fit a nnet model with randomly chosen initial parameters # The one with the smallest RSS on the training data is then chosen nnWtsPrunning <-function(nn,data,alpha,i){ truth...
2005 Apr 20
1
negative p-values from fisher's test (PR#7801)
Full_Name: Martha Nason Version: 2.0.1 OS: Windows XP Submission from: (NULL) (137.187.154.154) I am running simulations using fisher's test on 2 x c tables and a very small p.value from fisher's test (<2.2e-16) is returned as a negative number. Code follows. > set.seed(0) > nreps.outer <-7 > pvalue.fisher <- rep(NA,nreps.outer) > > population1 <- c( rep("A",300),seq(1:100)) > > population2 <- c( rep("A",100),seq(101:200)) > > > for (j in 1:nreps.outer){ + n1 <- sample(30:100,1) + n2 <- sample(30:100,1) + +...
2012 Jan 13
0
Example of "task seeds" with R parallel. Critique?
...ons that try to manage seeds for me. That's why I wish I could integrate task-based seeds into parallel itself. RNGkind("L'Ecuyer-CMRG") set.seed(23456) library(parallel) ## nrep = number of repetitions (or tasks) ## streamsPerRep = number of streams needed by each repetition nReps <- 2000 streamsPerRep <- 2 ## projSeeds=list of lists of stream seeds projSeeds <- vector(mode="list", nReps) for (i in 1:nReps) projSeeds[[i]] <- vector(mode="list", streamsPerRep) runif(1) ##establishes .Random.seed ##Grab first seed s <- .Random.seed origSeed...
2006 Aug 24
2
Why are lagged correlations typically negative?
...2, use="complete") [1] -1 > (T1<-rnorm(3)) [1] -0.84258593 -0.49161602 0.03805543 > (T2<-c(T1[2:3],NA)) [1] -0.49161602 0.03805543 NA > cor(T1,T2, use="complete") [1] 1 ########### # More advanced simulation example ########### > lags function(nobs,nreps,rho=1){ OUT<-data.frame(NEG=rep(NA,nreps),COR=rep(NA,nreps)) nran<-nobs+1 #need to generate 1 more random number than there are observations for(i in 1:nreps){ V1<-rnorm(nran) V2<-sqrt(1-rho^2)*rnorm(nran)+rho*V1 #print(cor(V1,V2)) V1<-V1[1:nran-1] V2...
2006 Nov 23
1
statistics help
hi im a bioinformatics student as i have never had any previous programming experience i need help this is the question i need to answer: Random walk model we want to model a random walk where you take a step to the left with probability p and one to the right with probability 1-p. Now assume that there is a line of 11 squares. once you are in square 0 or in square 10 the walk ends. The aim
2012 Oct 20
1
Logistic regression/Cut point? predict ??
...lt;-prediction(pred,z) auc<-performance(rocpreds,"auc")@y.values output<-c(int,slope,cutmid,accuracy,auc) names(output)<-c("Intercept","Slope","CutPoint","Accuracy","AUC") return(output) } y<-fitglm(.05,1) y nreps <- 500; output<-data.frame(matrix(rep(NA),nreps,6,ncol=6)) mysigma<-.5 mytau<-.1 i<-1 for(j in 1:nreps) { output[j,1:5]<-fitglm(mysigma,mytau) output[j,6]<-j } names(output)<-c("Intercept","Slope","CutPoint","Accuracy",&quo...
2018 Feb 15
2
package MonteCarlo error: object 'packages' not found
R-users, I can't tell what's causing the following error. The vignette does not make a reference to a "packages" option or parameter. > library(MonteCarlo) Loading required package: abind Loading required package: codetools Loading required package: rlecuyer Loading required package: snow Loading required package: snowfall > infest_kud_fun<-function(x,A,B){ +??
2013 Apr 03
0
Help with lmRob function
Hi, I am fairly new to R and have encountered an issue with the lmRob function that I have been unable to resolve. I am trying to run a robust regression using the lmRob function which runs successfully, but the results are rather strange. I'm not sure it's important, but my model has 3 dichotomous categorical variables and 2 continuous variables in it. When I look at a summary of my
2012 Sep 18
2
extracting column and regular interval in R
Dear R users, i have a matrix with 31 rows and 444 columns and i want to extract every 37th column of that matrix starting from 1. more precisely i want to select columns 1, 38,75, 112 and so on. then doing the same by starting from column number 2(2,39,76,113.......). i know that there is a manual way of doing it but i wanted to make it more quickly as i have fairly large data to dealth with.
2006 Jun 18
1
bug with boot.sw98 function (PR#8999)
Full_Name: Nuno Monteiro Version: 2.3.1 OS: Windows XP HE Submission from: (NULL) (84.9.38.207) I'm using the FEAR library to perform Data Envelopment analysis with a 36,000 obs dataset. The function dea is working fine but then when I try to use the boot.sw98 to come up with some sensitivity analysis I get the following error:
2011 May 04
1
hurdle, simulated power
Hi all-- We are planning an intervention study for adolescent alcohol use, and I am planning to use simulations based on a hurdle model (using the hurdle() function in package pscl) for sample size estimation. The simulation code and power code are below -- note that at the moment the "power" code is just returning the coefficients, as something isn't working quite right. The
2006 Jan 12
1
"infinite recursion" in do.call when lme4 loaded only
A larg program which worked with lme4/R about a year ago failed when I re-run it today. I reproduced the problem with the program below. -- When lme4 is not loaded, the program runs ok and fast enough -- When lme4 is loaded (but never used), the do.call fails with infinite recursion after 60 seconds. Memory used increases beyond bonds in task manager. -- I tested a few S3 based packages
2006 Jan 12
1
"infinite recursion" in do.call when lme4 loaded only
A larg program which worked with lme4/R about a year ago failed when I re-run it today. I reproduced the problem with the program below. -- When lme4 is not loaded, the program runs ok and fast enough -- When lme4 is loaded (but never used), the do.call fails with infinite recursion after 60 seconds. Memory used increases beyond bonds in task manager. -- I tested a few S3 based packages