search for: tempb

Displaying 10 results from an estimated 10 matches for "tempb".

Did you mean: temp
2006 Jun 26
2
probably need to se sapply but i can't get it
Hi : I think I need to use sapply but I can't figure this out. Suppose I have two vectors : tempa ( 4, 6,10 ) and tempb ( 11,23 ,39 ) I want a function that returns 4:11,6:23 and 10:39 as vectors. I tried : sapply(1:length(tempa) function (z) seq(tempa[z],tempb[z]) but i got 3 really strange vectors back in the sense that the numbers in them did not make no sense to me. obviously, i must be doing something w...
2006 Nov 16
1
getting a title in a plot during an lapply
In my code below tempa and tempb are numeric vectors that I combined into a dataframe along with the deciles of tempa. I have an lapply statement that goes through the dataframe and does ten plots according to the appropriate decile. The code is below and it works fine. There are no bugs so I figure there was no need to include st...
2012 Jul 03
2
EM algorithm to find MLE of coeff in mixed effects model
...b.array is all values of bi_k and bi_j for b_i b.list=list() for (i in 1:n) { b.list[[i]]=t(t(halfb)+miu.m[i,]) } #generate a list, each page contains Xi,yi,Zi, data.list=list() for (i in 1:n) { data.list[[i]]=list(Xi=Xi,yi=y.m[i,],Zi=Zi,b=b.list[[i]]) } #update sigma^2 t1=proc.time() tempaa=c() tempbb=c() for (j in 1:n) { #tempaa[j]=Eh4new(datai=data.list[[j]],weights.m=weights.mat,beta=beta.old) tempbb[j]=Eh4newv2(datai=data.list[[j]],weights.m=weights.mat,beta=beta.old) } var.new=mean(tempbb) if (ECM==T){var.old=var.new} sumXiXi=matrix(rowSums(sapply(data.list,function(s){t(s$Xi)%*%(s$Xi)})...
2012 Jul 03
0
need help EM algorithm to find MLE of coeff in mixed effects model
...b.array is all values of bi_k and bi_j for b_i b.list=list() for (i in 1:n) { b.list[[i]]=t(t(halfb)+miu.m[i,]) } #generate a list, each page contains Xi,yi,Zi, data.list=list() for (i in 1:n) { data.list[[i]]=list(Xi=Xi,yi=y.m[i,],Zi=Zi,b=b.list[[i]]) } #update sigma^2 t1=proc.time() tempaa=c() tempbb=c() for (j in 1:n) { #tempaa[j]=Eh4new(datai=data.list[[j]],weights.m=weights.mat,beta=beta.old) tempbb[j]=Eh4newv2(datai=data.list[[j]],weights.m=weights.mat,beta=beta.old) } var.new=mean(tempbb) if (ECM==T){var.old=var.new} sumXiXi=matrix(rowSums(sapply(data.list,function(s){t(s$Xi)%*%(s$Xi)}...
2011 Aug 01
4
Use dump or write? or what?
...ile calculate another set and append, repeat. But I can't figure out how to write it to file and then append subsequent t-tests. (maybe too tired ;} ) I have tried to use "dump" and "file.append" to no avial. ttest_results = tempfile() two_sample_ttest <- t.test (tempA, tempB, var.equal = TRUE) welch_ttest <- t.test (tempA, tempB, var.equal = FALSE) dump (two_sample_ttest, file = "dumpdata.txt"", append=TRUE) ttest_results <- file.append (ttest_results, two_sample_ttest) Any suggestions, M -- Matt Curcio M: 401-316-5358 E: matt.curcio.ri at gm...
2006 Jun 27
1
related to my previous sapply question]
in my previous post in which i asked about creating sequences from two vectors of numbers, all suggestions worked. tradevectors<-mapply(seq,from=tempa,to=tempb) or tradevectors<-sapply(1:length(tempa),function(x) seq(tempa[x],tempb[x]) >both return a list with 3 components. the problem is that i want to take these 3 sequences and use them as the indices of two other vectors, X and Y and mutiply them ( element by element ) >so, i tried &...
2008 Jun 04
2
converting a table to a dataframe or a matrix
...0.5]", "(-0.5,-0.25]", "(-0.25,0]", "(0,0.25]", "(0.25,0.5]", "(0.5,0.75]", "(0.75,1]"), c("0", "1", "2")), .Names = c("", ""))) print(temp) tempa <- as.data.frame(temp) tempb <- as.matrix(temp) print(str(tempa)) print(str(tempb))
2006 Jun 28
2
hopefully my last question on lapply
Marc and many other people ( whose names escape me ) have been very helpful in explaining the use of lapply to me. In his last response, Marc explained that if tradevectors is a list of vectors of different lengths ( excuse my terminology ) then lapply(tradevectors,function(x) G[x]*B[x] ) will go through each component of the list as if it was a vector and apply the element by element
2012 May 30
1
caret() train based on cross validation - split dataset to keep sites together?
...EXAMPLE SCRIPT FOR MODEL FITTING fitControl <- trainControl(method = "repeatedcv", number=10, repeats=3) tuning <- read.table("temptunegrid.txt",head=T,sep=",") tuning # # Model with 100 iterations registerDoMC(4) tempmod100its <- train(watmntemp~tempa + tempb + tempc + tempd + tempe + netarea + netbuffor + strmslope + netsoilprm + netslope + gwndx + mnaspect + urb + ag + forest + buffor + tempa7day + tempb7day + tempc7day + tempd7day + tempe7day + tempa30day + tempb30day + tempc30day + tempd30day + tempe30day, data = temp.train, method = "nne...
2008 Oct 22
4
A matrix automation problem
[I am really sorry if it is double posted, I doubt me previous post could not reach forum due to some problem with net] Suppose I have a matrix : a = matrix(1:9, 3) >From this matrix, I construct 9 additional matrices : i = 1:9 bi = a * i Now combining all those 9 new matrices, I construct a final metrix as : c = b1 b4 b7 b2 b5 b8 b3 b6 b8 I want to automate this procedure for any