Appendix B
Bayesian Network File Creation
To analyze the outputs of the biophysical model in a Bayesian network, numerical outputs of coral cover are translated to likelihood data in three steps.
First, in the MATLAB program, decadal time slices of the output data are taken. In other words, projected coral cover (replicates of 10 data points per line in the intervention table) are captured at years 2020, 2030, 2040, 2050, and 2060. Outputs are then organized according to the design table and exported to a Microsoft (MS) Excel table. Here, output years are stored in column 1; scenarios, conditions, and interventions then become grouping variables in columns 2 to 8 (see Figure B.1). Coral cover (the output variable) becomes the last column. Levels within each grouping variable (e.g., representative concentration pathway [RCP]2.6 versus RCP8.5) are stacked vertically, with the number of replicate model runs (10) for each line in the intervention table (192) and numbers of time slices (5) determining the number of rows in the output table (9,600).
Second, the database is then converted to a tab-delimited text file and imported into the software Netica using the method described by Ni et al. (2011), but see also Nicol and Chadès (2017). Briefly, in preparation for data import into Netica, an empty Bayesian network must be constructed with all independent (parent) nodes completed with titles and level descriptions identical to column headers and row information in the MS Excel file. All parent nodes should be set to discrete, that is, using distinct levels, whereas coral cover is a continuous variable (see Figure B.2).
Third, the data file is imported into Netica via a learning algorithm. This process is built into Netica and can be run by importing the data file via the Cases tab in the menu line, then Learn, then Incorporate Case File (see Figure B.3). In the subsequent menu, the user is asked to browse for the data file. Upon import, Netica converts the distributions of coral cover within and among years, scenarios, and interventions to distributions of conditional likelihoods linked in the network. The Bayesian network is then ready to query.