FRemoved a bunch of prints, str's and cats

This commit is contained in:
2022-04-07 10:06:30 +01:00
parent 9739770393
commit 99fa481fcb
4 changed files with 18 additions and 31 deletions

View File

@@ -57,10 +57,13 @@ parseScenario <- function(press, prefix = "p") {
ncol = 3,
dimnames = list(NULL, c("growth", "confidence", "layer"))
)
for (col in 2:ncol(press)) {
coefs[col - 1, ] <- as.numeric(split(press[1, col]))[match(c("growth", "confidence", "layer"), states)]
}
press[is.na(press)] <- 0
if (sum(duplicated(pressNames)) > 0) {
cat("Duplicated pressure node names found")
print(pressNodes[duplicated(pressNames)])
@@ -145,13 +148,12 @@ buildGraph <- function(model, desc) {
c(model$nodes$growth[nodeRef], model$edges$values[rows]),
c("(Intercept)", model$edges$input[rows])
)
# str(coefVal)
outDist[[idx]] <- list(coef = coefVal, sd = model$nodes$confidence[nodeRef])
}
print("Saving model prior to network modelling")
modelDefn <- paste0(inputText, edges)
# save(modelDefn, file = "buildGraph.RData")
net <- model2network(paste0(inputText, edges), debug = FALSE)
@@ -169,7 +171,7 @@ buildGraph <- function(model, desc) {
cfit <- custom.fit(net, allDists)
cat("about to calculate sample distributions")
print("about to calculate sample distributions")
sampleDists <- cpdist(cfit, nodes = outNodes, evidence = TRUE, n = 10000, method = "lw")
summDists <- summary(sampleDists)