# Generate num=1000 random strings of n=3 binary spin variables under bvec and Mmat.
num <- 1000; bvec <- c(0,0.5,0.25); Mmat <- matrix(0.1,3,3) - diag(0.1,3,3);
data <- rfvbm(num,bvec,Mmat)
# Fit a fully visible Boltzmann machine to data, starting from parameters bvec and Mmat.
model <- fitfvbm(data,bvec,Mmat)
#Propose a null hypothesis model
nullmodel <- list(bvec = c(0,0,0), Mmat = matrix(0,3,3))
# Compute z-scores
fvbmtests(data,model,nullmodel)
Run the code above in your browser using DataLab