BayesianNetworkRegression.Fit!Method
Fit!(X::AbstractArray{T}, y::AbstractVector{U}, R; η=1.01,ζ=1.0,ι=1.0,aΔ=1.0,bΔ=1.0, 
     ν=10, nburn=30000, nsamples=20000, x_transform=true, suppress_timer=false, num_chains=2, seed=nothing, purge_burn=nothing) where {T,U}

Fit the Bayesian Network Regression model, generating nsamples Gibbs samples after nburn burn-in are discarded

Road map of fit!:

Arguments

  • X: matrix, required, matrix of unweighted symmetric adjacency matrices to be used as predictors. Two options: 2D matrix with each row the upper triangle of the adjacency matrix associated with one sample 1D matrix with each row the adjacency matrix relating the nodes to one another
  • y: vector, required, vector of response variables
  • R: integer, required, the dimensionality of the latent variables u, a hyperparameter
  • η: float, default=1.01, hyperparameter used for sampling the 0 value of the πᵥ parameter, must be > 1
  • ζ: float, default=1.0, hyperparameter used for sampling θ
  • ι: float, default=1.0, hyperparameter used for sampling θ
  • : float, default=1.0, hyperparameter used for sampling Δ
  • : float, default=1.0, hyperparameter used for sampling Δ
  • ν: integer, default=10, hyperparameter used for sampling M, must be > R
  • nburn: integer, default=30000, number of burn-in samples to generate and discard
  • nsamples: integer, default=20000, number of Gibbs samples to generate after burn-in
  • x_transform: boolean, default=true, set to false if X has been pre-transformed into one row per sample. Otherwise the X will be transformed automatically.
  • suppress_timer: boolean, default=false, set to true to suppress "progress meter" output
  • num_chains: integer, default=2, number of separate sampling chains to run (for checking convergence)
  • seed: integer, default=nothing, random seed used for repeatability
  • purge_burn: integer, default=nothing, if set must be less than the number of burn-in samples (and ideally burn-in is a multiple of this value). After how many burn-in samples to delete previous burn-in samples.
  • filename: logfile with the parameters used for the fit, default="parameters.log". The file will be overwritten if a new name is not specified.

Returns

Results object with the state table from the first chain and PSRF r-hat values for γ and ξ

source
BayesianNetworkRegression.SummaryMethod
Summary(results::Results;interval::Int=95,digits::Int=3)

Generate summary statistics for results: point estimates and credible intervals for edge coefficients, probabilities of influence for individual nodes

Arguments

  • results: a Results object, returned from running Fit!
  • interval: (optional) Integer, level for credible intervals. Default is 95%.
  • digits: (optional) Integer, number of digits (after the decimal) to round results to. Default is 3.

Returns

A BNRSummary object containing a matrix of edge coefficient point estimates (coef_matrix), a matrix of edge coefficient credible intervals (ci_matrix), and a DataFrame containing the probability of influence of each node (pi_nodes).

source