in Section \[sec:ANNDesign\] using the *trainbr* function for Bayesian regularization. Each ANN is trained starting from different initial weights and biases, and with different division for the training and test data sets. To ensure good generalization, each ANN is retrained 5 times.

    net = fitnet(8, 'trainbr');
    net.performFcn = 'mse'; 
    numNN = 100; 
    numNNr = 5;
    NN = cell(numNNr, numNN);
    trace = cell(numNNr, numNN);
    perfs = zeros(numNNr, numNN);
    % train numNN ANNs
    for i = 1:numNN
       % retrain each ANN numNNr times
       for j = 1:numNNr
         [NN{j}{i},trace{j}{i}] = train(net, x, t); 
         y2 = NN{j}{i}(x2);
         perfs(j, i) = perform(NN{j}{i}, t2, y2);
         net = NN{j}{i};
       end
       % reinitialize initial weights and biases 
       net = init(net);
    end
    minPerf = min(perfs(:))
    [rowMin, colMin] = find(perfs == minPerf)
    net = NN{rowMin}{colMin};
    tr = trace{rowMin}{colMin};

The performance function, such as MSE, measures how well ANN can predict data, i.e., how well ANN can be generalized to new data. The test data sets are a good measure of generalization for ANNs since they are not used in training. A small performance function on the test data set indicates an ANN with good performance was found. In this work, the ANN with the lowest performance on the test data 