r - How to write stable method in pcSelect as similar as pc_stable -


in r code,pcalg package. how write stable method in pcselect similar pc_stable? want write stable method pcselect follows:

while (!done && any(g)) {   n.edgetests[ord+1] <- 0   done <- true   ind <- which(g)   remainingedgetests <- length(ind)   if(verbose>=1)   cat("order=",ord,"; remaining edges:",remainingedgetests,"\n", sep='')   if(method == "stable") {      #view(g)      ## order-independent version: compute adjacency sets vertex      ## don't update when edges deleted      g.l <- split(g, gl(p,p))      #view(g.l)   } 

however, g.l<-split(g,gl(p,p)) not success in here, please me ,thanks.

the difference between pc , pc stable change skeleton phase of algorithm, implemented skeleton() function in pcalg. pcselect() function trying learn adjacency set of 1 particular variable, not whole structure of graph, not call skeleton(). looks you're trying copy parts of skeleton have stable modification directly pcselect. however, in skeleton, g matrix, , in pcselect, g vector. that's giving error when try apply split() function, works on matrix not on vector.

so need achieve stable modification in pcselect? r documentation, looks pcselect implementation of pc-simple algorithm, published in buehlmann, p., kalisch, m. , maathuis, m.h. (2010). 'variable selection high-dimensional linear models: partially faithful distributions , pc-simple algorithm.' biometrika 97, 261–278. paper on arxiv here: http://arxiv.org/abs/0906.3204 .

in line 278 of arxiv version, authors describe how edges removed, creating new "active set" of regressors @ each stage. written, conditioning sets in correlation tests range on all variables in active set, before new active set created. in other words, variables not removed active set after each test; group of them removed @ end of each stage, there no dependence on order of tests within each stage. equivalent stable modification pc.

if pcselect implementation follows published description, needn't worry: has stable modification built in. source code of pcselect bit opaque, think that's it's doing. don't need change in pcselect!


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -