Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. VERBOSITY_LEVEL=1;
  2.  
  3. ExecuteAFile (HYPHY_LIB_DIRECTORY+"TemplateBatchFiles"+DIRECTORY_SEPARATOR+"bayesgraph.ibf");
  4.  
  5. SetDialogPrompt("Select file containing binary data matrix:");
  6. mat = import_data(PROMPT_FOR_FILE, 1); // 1 if there is a header row
  7. // also sets [names] and [num_nodes]
  8.  
  9. nodes = {};
  10. for (i = 0; i < num_nodes; i=i+1) {
  11. // node_id, max_parents, sample_size, nlevels
  12. nodes[Abs(nodes)] = add_discrete_node(names[i], 2, 0, 2);
  13. }
  14.  
  15. BayesianGraphicalModel bgm = (nodes);
  16.  
  17. attach_data("bgm", mat, 0, 0, 0);
  18.  
  19. res = order_MCMC ("bgm", 10000, 10000, 100);
  20.  
  21. fprintf(stdout, res);
  22.  
  23. write_edgelist("edgelist.out", res, num_nodes, 1);
  24.  
  25. mcmc_graph_to_dotfile("bgm.dot", 0.5, res, nodes);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement