similar to: Simplify formula for iterative programming

Displaying 20 results from an estimated 6000 matches similar to: "Simplify formula for iterative programming"

2005 May 26
1
Simplify formula for heterogeneity
Dear R-ians, I'm looking for a computational simplified formula to calculate a measure for heterogeneity (let's say H ): H = sqrt [ (Si (Sj (Xi - Xj)?? ) ) /n ] where: sqrt = square root Si = summation over i (= 0 to n) Sj = summation over j (= 0 to n) Xi = element of X with index i Xj = element of X with index j I can simplify the formula to: H = sqrt [ ( 2 * n * Si (Xi) - 2 Si (Sj
2005 Nov 04
2
Simplify iterative programming
Dear, I am looking for the simplification of a formula to improve the calculation speed of my program. Therefore I want to simplify the following formula: H = sum{i=0..n-1 , [ sum {j=0..m-1 , sqrt ( (Ai - Bj)^2 + (Ci - Dj)^2) } ] } where: A, C = two vectors (with numerical data) of length n B, D = two vectors (with numerical data) of length m sqrt = square root Ai = element of A with index
2006 Jan 11
1
F-test degree of freedoms in lme4 ?
I have a problem moving from multistratum aov analysis to lmer. My dataset has observations of ampl at 4 levels of gapf and 2 levels of bl on 6 subjects levels VP, with 2 replicates wg each, and is balanced. Here is the summary of this set with aov: >> summary(aov(ampl~gapf*bl+Error(VP/(bl*gapf)),hframe2)) > >Error: VP > Df Sum Sq Mean Sq F value Pr(>F) >Residuals
2006 Feb 19
2
Computing means, variances and sums
There has been a recent thread on R-help on this, which resurrected concepts from bug reports PR#1228 and PR#6743. Since the discussion has included a lot of erroneous 'information' based on misunderstandings of floating-point computations, this is an attempt to set the record straight and explain the solutions adopted. The problem was that var(rep(0.02, 10)) was observed to be (on
2009 Aug 14
1
Saving Iterative Components
Dear All, I am trying to iterate an iterative process (i know R is not the best place for so much looping but i have to so tough!) and store the resulting data from each iteration to then be graphed. In simple form the script looks like this for(i in tracks) { a <- (subset(data, data$Id==i)) result.dataset <- function(a, other.arguements) ### this function is the other
2011 Dec 05
3
iterative variable names
Hi, I'm trying to assign iterative names to variable, but all my attempts have failed. I have a loop, and for every iteration, I need to create a variable, and I'd like to name them iteratively, such as: for(i in 1:10) { x_i <- c(values) } I need it to return ten variables: x_1, x_2, ..., x_10 How can I do it? Thank you very much! Beatriz -- View this message in context:
2006 Mar 15
2
difftime arguments
Hi I just started using RGui.exe under widnows. I have a text file containing date arranged in columns and rows, each column has the same format, each row with different formats. 3 of the columns are something like this 1/12/2006 3:59:45 PM I need to calculate the different in seconds between 2 selected periods using their row’s index My solution: Read the file in a data frame and
2005 Jan 17
1
merge data frames taking mean/mode of multiple macthes
Hello :) I have two data frames, one has properties taken on a piece by piece basis and the other has performance on a lot by lot basis. I wish to combine these two data frames but the problem is that each lot has multiple pieces and hence i need to take a mean of the properties of multiple pieces and match it to the row having data about the lot. I was wondering if there is a simple commmand,
2005 Oct 11
1
iterative output to file by row
Hi, I'm sort of a newbie to using R to deal with array data. I'm trying to create a simple filtering function, which outputs only the rows of a data frame that satisfies a specific criterion. I've set up an iterative loop to apply the condition to each row. I can create a new matrix and use rbind to fill it in row by row in the loop, before writing the whole matrix to file. But
2009 Jan 12
0
[LLVMdev] Is it possible to use the SimpleRegisterCoalescing pass in an iterative way?
On Friday 09 January 2009 03:36, Roman Levenstein wrote: > Hi, > > I'm implementing some variations of graph-coloring register allocators for > LLVM. Many of them perform their phases (e.g. coalescing, graph > simplification, spilling, color selection) in an iterative way. Since > LLVM provides an implementation of the coalescing in the > SimpleRegisterCoalescing class
2006 Sep 25
1
apply: new behaviour for factors in R-2.4.0
Dear R-core There is a different output for the apply function due to the change of unlist as mentioned in the R news. Newly, applying as.factor() (or factor()) in str(dat <- data.frame(x = 1:10, f1 = gl(2,5,labels = c("A", "B")))) (d1 <- apply(dat,2,as.factor)) newly returns a character matrix while in R-2.3.1 the same command resulted in an integer matrix that was
2007 Jun 19
2
Preconditions for a variance analysis
Hello everbody, i'm currently using the anova()-test for a small data.frame of 40 rows and 2 columns. It works well, but is there any preconditions for a valid variance analysis, that i should consider? Thank you for your answer, Daniel
2006 Apr 25
1
summary.lme: argument "adjustSigma"
Dear R-list I have a question concerning the argument "adjustSigma" in the function "lme" of the package "nlme". The help page says: "the residual standard error is multiplied by sqrt(nobs/(nobs - npar)), converting it to a REML-like estimate." Having a look into the code I found: stdFixed <- sqrt(diag(as.matrix(object$varFix))) if (object$method
2015 Jan 01
1
Reimplement stats:::plotNode as iterative to avoid recursion limits?
Hi All, I've gotten a number of reports from users about gplots::heatmap.2 generating 'node stack overflow' errors. As it turns out, these errors originate in stats:::plotNode, and are triggered when it is passed a dendrogram that is too deeply nested. While increasing the stack size (which is a compile-time option for byte coded functions) can allow a particular instance to
2005 May 15
3
adjusted p-values with TukeyHSD?
hi list, i have to ask you again, having tried and searched for several days... i want to do a TukeyHSD after an Anova, and want to get the adjusted p-values after the Tukey Correction. i found the p.adjust function, but it can only correct for "holm", "hochberg", bonferroni", but not "Tukey". Is it not possbile to get adjusted p-values after
2010 Jan 30
3
iterative regressions, adding a new line of data each time
Hi, I am pretty new to R. I'm trying run a regression repeatedly, adding a new data point each time, and then storing the predicted Y values. For example, let's say I have 500 data points and I run the regression. I would then like to store the Y value, run the regression again using 501 data points, store the new Y, run the regression with 502 data points, store the Y, and so on. What I
2010 Sep 24
1
Saving iterative components
Hi, I need help! I am trying to iterate an iterative process to do cross vadation and store the results each time. I have a Spatial data.frame, called Tmese > str(Tmese) Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots ..@ data :'data.frame': 14 obs. of 17 variables: .. ..$ ID : int [1:14] 73 68 49 62 51 79 69 77 57 53 ... .. ..$
2008 Jul 29
3
finding a faster way to do an iterative computation
useR's, I am trying trying to find out if there is a faster way to do a certain computation. I have successfully used FOR loops and the apply function to do this, but it can take some time to fully compute, but I was wondering if anyone may know of a different function or way to do this: > x [1] 1 2 3 4 5 > xk [1] 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 I want to do:
2009 Jan 09
4
[LLVMdev] Is it possible to use the SimpleRegisterCoalescing pass in an iterative way?
Hi, I'm implementing some variations of graph-coloring register allocators for LLVM. Many of them perform their phases (e.g. coalescing, graph simplification, spilling, color selection) in an iterative way. Since LLVM provides an implementation of the coalescing in the SimpleRegisterCoalescing class already, I would like to reuse it (even though I could of course create my own coalescing
2006 Jan 18
3
linear contrasts with anova
I have some doubts about the validity of my procedure to estimeate linear contrasts ina a factorial design. For sake of semplicity, let's imagine a one way ANOVA with three levels. I am interested to test the significance of the difference between the first and third level (called here contrast C1) and between the first and the seconda level (called here contrast C2). I used the following