search for: cand2

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

Did you mean: band2
2009 Oct 08
3
foreach loop - rejection method
Hi Everybody, Thanks in advance for your help. This is my first time using the foreach statement and I cant get it to work properly so here is what i have test<-function(){ repeat { cand2[l-1]<-rinvgamma(1,phi,lambda[l-1]) q2<-dinvgamma(cand2[l-1],phi,lambda[l-1]) p2<-cand2[l-1]^-1.5*exp(-y[l]^2/(2*cand2[l-1]))*exp(-((log(cand2[l-1])-mu_t_cand[l-1])^2)/2*sigmasq) ratio<-p2/(c[l-1]*q2) if (runif(1)< ratio) {break} } f2[l-1]<-min(p2,c[l-1]*q2) }} foreach(l=2:(n-1),.c...
2012 Jan 24
2
Writing a function to return column position XXXX
...zip ind_ite_con ind_uni_con AL 36106 $251,895.80 $22,874.43 AL 35802 $141,373.60 $7,100.00 AL 35201 $273,208.50 $18,193.66 AR 72404 $186,918.00 $25,391.00 AR 72217 $451,127.00 $27,255.23 AR 7.28E+08 $58,336.22 $5,293.82 So far I have: col.id<-function(x) any(grep("$",x)) sapply(cand2,col.id) However, this returns TRUE for all columns (even those that do not contain the $). Any assistance is appreciated. Thank you, Dan [[alternative HTML version deleted]]
2012 Oct 11
2
survey package question
Hello, I have got a cluster sample using an election dataset where I already had the final results of a county-specific election. I am trying to figure out what would be the best sampling design for my data. The structure of the dataset is: 1) polling station (in general schools where people vote, for a county, for example, there are 15 polling stations) 2) inside each polling station, there
2020 Jan 03
10
Writing loop transformations on the right representation is more productive
...optimization * Loop idiom recognition Optimization Pipeline --------------------- The optimization pipeline for the hierarchy DAG is straightforward: void optimizeLoopNest() { RedOriginal = generateLoopHierarchy(); List = createCandidates(RedOriginal); sort(List, [](Cand1,Cand2) { return estimateExecutionTime(Cand2) - estimateExecutionTime(Cand1); } ); if (List[0] != RedOriginal) emit(List[0]); } Subtree exploration is done recursively, optimizing inner nodes which can be (re-)used when optimizing outer...