Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- VERBOSITY_LEVEL=1;
- ExecuteAFile (HYPHY_LIB_DIRECTORY+"TemplateBatchFiles"+DIRECTORY_SEPARATOR+"bayesgraph.ibf");
- SetDialogPrompt("Select file containing binary data matrix:");
- mat = import_data(PROMPT_FOR_FILE, 1); // 1 if there is a header row
- // also sets [names] and [num_nodes]
- nodes = {};
- for (i = 0; i < num_nodes; i=i+1) {
- // node_id, max_parents, sample_size, nlevels
- nodes[Abs(nodes)] = add_discrete_node(names[i], 2, 0, 2);
- }
- BayesianGraphicalModel bgm = (nodes);
- attach_data("bgm", mat, 0, 0, 0);
- res = order_MCMC ("bgm", 10000, 10000, 100);
- fprintf(stdout, res);
- write_edgelist("edgelist.out", res, num_nodes, 1);
- mcmc_graph_to_dotfile("bgm.dot", 0.5, res, nodes);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement