itsrainingdata / sparsebn

Software for learning sparse Bayesian networks
43 stars 8 forks source link

Improve output when estimate.parameters is singular #9

Closed itsrainingdata closed 7 years ago

itsrainingdata commented 7 years ago

Instead of returning an error when estimate.parameters encounters a singular Gram matrix, return valid estimates for those nodes that are nonsingular (< n parents). Output a warning, and return NA for nodes with > n parents.

Also, improve the error message, which is a bit cryptic:

  Error in fit_glm_dag(edges, data$data, call = "lm.fit", ...) :
        Node 465 has too many parents! <27 > 22>