search for: nstart

Displaying 20 results from an estimated 54 matches for "nstart".

Did you mean: start
2009 Apr 26
2
eager to learn how to use "sapply", "lapply", ...
...really like to shake my C programming style off. I am staring at my R script and thinking "how can I improve it ?" For instance, I have a lot of loops similar to the following one and wonder whether I can replace them with a proper call to a high level R function that does the same: Nstart <- Nfour/(2^Lev) + 1 Nfinish <- Nstart -1 + Nfour/(2^Lev) LengLev <- Nfinish - Nstart + 1 NW <- floor(LengLev*N/Nfour) if(NW > 0){ for(j in Nstart:(Nstart + NW -1)){ Dw <- abs(Y[j]) Rnorm <- Rnorm + Dw^2 } } Than...
2005 Dec 02
1
k-means / role of 'nstart'
Hello, the k-means {stats} help and the Hartigan&Won paper say nothing about the way random sets works (parameter nstart). I would expect to get the different results for each random initial set but I always obtain only one result: how is it selected? Charles Raux
2013 Mar 13
1
Empty cluster / segfault using vanilla kmeans with version 2.15.2
Hello, here is a working reproducible example which crashes R using kmeans or gives empty clusters using the nstart option with R 15.2. library(cluster) kmeans(ruspini,4) kmeans(ruspini,4,nstart=2) kmeans(ruspini,4,nstart=4) kmeans(ruspini,4,nstart=10) ?kmeans either we got empty always clusters and or, after some further commands an segfault. regards, Detlef Groth ------------ [R] Empty cluster / segfau...
2005 Sep 20
2
script.aculo.us: pause before effect.appear
...the images randomly appear at different times; e.g. the 3rd image might start appearing 2 seconds after load, the 6th image immediately after load, the first image 1 second after load, etc... How can I achieve this affect? --- example HTML and Javascript --- function img_appear() { var ndur=2, nstart=1, nend=22; for(var loop = nstart; loop < nend; loop++) { var nid=''a''+loop; new Effect.Appear(nid, {transition: Effect.Transitions.linear, duration: ndur}); } } <body onload="img_appear()"> <div class="images"> <img src="1.jpg" al...
2012 Jan 14
1
Error: unexpected '<' in "<" when modifying existing functions
Hi. I am trying to modify kmeans function. It seems that is failing something obvious with the workspace. I am a newbie and here is my code: myk = function (x, centers, iter.max = 10, nstart = 1, algorithm = c("Hartigan-Wong", + "Lloyd", "Forgy", "MacQueen")) + { + do_one <- function(nmeth) { + Z <- switch(nmeth, { + Z <- .Fortran(R_kmns, as.double(x), as.integer(m), + as.integer(ncol(x)), cent...
2004 Sep 06
1
A naive lsoda question....
...quot;rx"]; ry <- p["ry"] Kx <- p["Kx"]; Ky <- p["Ky"] phix <- p["phix"]; phiy <- p["phiy"] dx.dt <- rx*x*(1 - x/Kx) - phix*x*y dy.dt <- ry*y*(1 - y/Ky) - phiy*x*y list(c(dx.dt, dy.dt)) } # running lsoda nstart <- c(x=0.5, y=0.5) parms <- c(rx=1, ry=1, Kx=1, Ky=1, phix=1.2, phiy=0.8) tmax <- 100 times <- seq(0,tmax) require(odesolve) out <- as.data.frame(lsoda(nstart, times, lotvol, parms)) Thanks, Manojit
2000 Apr 11
0
aggregate.ts (PR#514)
...Series: Start = 2 End = 8 Frequency = 0.5 [1] 2 4 6 8 S> x <- rts(1:10) S> aggregate(x, nf=0.5, fun = min) [1] 1 3 5 7 9 start deltat frequency 1 2 0.5 I have edited the aggregate.ts function to reproduce the S-PLUS behaviour, which I find more intuitive: old: #nstart <- ceiling(tsp(x)[1] * nfrequency)/nfrequency #x <- as.matrix(window(x, start = nstart)) new: nstart <- tsp(x)[1] # Can't use nstart <- start(x) as this causes problems if # you get a vector of length 2. x <- as.matrix(x) I have tried this on a range of e...
2007 Jul 09
1
factanal frustration!
Hi. It seems that nearly every time I try to use factanal I get the following response: >faa2db1<-factanal(mretdb1,factors=2,method="mle",control=list(nstart=25)) Error in factanal(mretdb1, factors = 2, method = "mle", control = list(nstart = 25)) : unable to optimize from these starting value(s) > In the case cited above, mretdb1 is synthetic data created from two factors, that is, mretdb1 has dimensions 3050*1000, and each of t...
2014 Oct 31
0
[PATCH 1/3] fish: rl.{c, h} - escaping functions for readline
...+1, p+1+m, strlen (p+1+m) + 1); + } + } + + return start; +} + +// backslash scape +char * +bs_escape_filename (char *p) +{ + char *start = p; + // four times original length - if all chars are unprintable + // new string would be \xXY\xWZ + char *n = calloc(strlen(p) * 4 + 1, 1); + char *nstart = n; + if (strlen(p) == 0) { + n[0] = '\0'; + return n; + } + + for (; *p; p++, n++) { + int m = 1; + + switch (*p) { + case '\\': break; + case '\a': *(n++) = '\\'; *n = 'a'; break; + case '\b': *(n++) = '\\'...
2014 Oct 31
6
[PATCH 0/3] WIP readline escaping functions
From: Maros Zatko <hacxman@gmail.com> Auxiliary functions for readline to support space character escaping in filenames in future. Escaping function is taken from fish.c (used to be parse_quoted_string) plus its un-escaping counterpart. There are a few tests for both. Maros Zatko (3): fish: rl.{c,h} - escaping functions for readline fish: basic tests for readline escaping autotools:
2009 Jun 10
1
Weird behavior in receive_data function
...file 1 and file 2 have the same name, just binary difference): Step 1: backup File 1 Step 2: backup Fil 2 -- Daniel Li File 1: This is the first time backup file. > count = 1; > nSize = 1; > nBlock = 256; > nInterval = 4; > nAdjust = 256; > > printf("\nstart to build origin files!\n"); > ch = 0; > for(l = 0; l < count; l++) > { > memset(buffer,0, 256); > sprintf(buffer,"media-test-3MB-file/origin/test/test%02d.dat",l); > printf("writting %s \n",buffer); > fd = open(buffer, O_RDWR|O_CREA...
2013 Feb 03
1
Empty cluster / segfault using vanilla kmeans with version 2.15.2
...a I'm clustering is constituted by the rows of a 320 x 6 matrix containing integers ranging from 1 to 7, no missing data. I applied kmeans() to this matrix, literally, 256 x 10⁶ times using R version 2.13.2 or 2.14.1, without never experiencing the slightest problem. My usual setup is with k=5, nstart=256, iter.max=50. Upgrading to R 2.15.2, I experienced either a warning message ('Empty cluster. Choose a better set of initial centers') or a catastrophic segfault. The only way I can get a solution whatsoever is putting nstart to its default value, i.e. 1. However, just repeating the clu...
2013 Aug 26
2
Perl interface isn't working in 1.2.x
On 08/25/2013 05:02 PM, Olly Betts wrote: > So the simple fix is > probably just to install the perl-Search-Xapian RPM instead. Thanks, the Centos 6 repos don't have that rpm and the http://xapian.org/download page seems to only cover the XS bindings, if I am reading this correctly: But I was able to remove the rpm packages and compile and install the core and swig from source.
2013 Jun 24
1
K-means results understanding!!!
...n R. I am applying kmeans-algorithms to my big data file, and it is producing the results of the clusters. Q1) Does anybody knows how to find out in which cluster (I have fixed numberofclusters = 5 ) which data have been used? COMMAND (kmeans.results <- kmeans(mydata,centers =5, iter.max= 1000, nstart =10000)) Q2) When I call kmeans.results I have the following output: K-means clustering with 5 clusters of sizes 17, 1, 6, 4, 32 Cluster means: [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] 1 0 0 0 0 0 0 0 0 0 0 0.0000000 0.000823529...
2005 Jun 14
1
KMEANS output...
Using R 2.1.0 on Windows 2 questions: 1. Is there a way to parse the output from kmeans within R? 2. If the answer to 1. is convoluted or impossible, how do you save the output from kmeans in a plain text file for further processing outside R? Example: > ktx<-kmeans(x,12, nstart = 200) I would like to parse ktx within R to extract cluster sizes, sum-of-squares values, etc., OR save ktx in a plain text file in Windows to post-process it with a parser I would have to write. Thanks! Omer Cell: (914) 671-7447
2012 Feb 02
0
bigkmeans not parallel
...s to run the loop system.time(x <- foreach(j=1:times ) %dopar% check(j)) user system elapsed ----- ------ 4 system.time(x <- foreach(j=1:times ) %do% check(j)) user system elapsed ----- ------- 16 But when I run my data in bigkmeans >ans <- bigkmeans(data,200,nstart=5,iter.max=20) I see only one R process in system monitor, and only one CPU usage is high. I guess it's not really parallel. I also tried DoSNOW, though it's used for multi clusters. >cl <- makeCluster(8,type="SOCK") >registerDoSNOW(cl) >ans <- bigkmeans(data,200...
2012 Feb 20
1
bigmemory not really parallel
Hi, all, I have a really big matrix that I want to run k-means on. I tried: >data <- read.big.memory('mydata.csv',type='double',backingfile='mydata.bin',descriptorfile='mydata.desc') I'm using doMC to register multicore. >library(doMC) >registerDoMC(cores=8) >ans<-bigkmeans(data,k) In system monitor, it seems only one thread running R. Is
2004 Jul 21
0
loglin( tab, margin, start = bad.start ) kills R (PR#7123)
..."This should not happen"), stop("This should not happen"), : Incorrect specification of 'table' or 'start' appl/loglin.c assumes that start (aka 'fit') has enough memory allocated. Possible fix in stats/R/loglin.R : ntab <- length(table) + nstart <- length( start ) + if (nstart != ntab ) stop(" start and table must be same length " ) > version _ platform sparc-unknown-linux-gnu arch sparc os linux-gnu system sparc, linux-gnu status...
2014 Jun 30
0
convergence warning in betamix()
Hi, I am running some rather complex mixtures of beta regressions using the betamix() command from the betareg package (V. 3.0-4). If I am doing exploratory regressions with only one random starting value (nstart=1) I obtain results which converge after about 100 iterations. However, if I run regressions with nstart=100 random starting values I obtain solutions amended with a warning that no convergence resulted after 200 iterations. I conclude that 1) the initial regression converges to a local optimum, 2)...
2013 Aug 21
2
Perl interface isn't working in 1.2.x
...;get_doccount(); # $qp->set_stemmer(new Search::Xapian::Stem("english")); # $qp->set_stemming_strategy(STEM_SOME); # $qp->set_default_op($defaultop); my $par = $qp->parse_query($query); my $enq = $db->enquire( $par ); my @matches = $enq->matches($nstart,$nrecords); my $mset = $enq->get_mset($nstart,$nrecords); my $est = $mset->get_matches_estimated(); my $totTime=0; foreach my $match ( @matches ) { my $doc = $match->get_document(); my $id = $match->get_docid(); my $eterm = $enq->get_mat...