R/J_nMF.R

Defines functions J_nMF

Documented in J_nMF

#' naive mean field copuling strength reconstruction for ising model
#' @param returns the return data.frame for stock market OR the configuation matrix for other system
#' @return a interaction strength J matrix 
#' @export

J_nMF=function(returns){
  covMat=cov(returns)
  site_mean=colMeans(returns)
  J_nMF_mat=solve(diag(1- site_mean^2)) - solve(covMat)
  return(J_nMF_mat)
}
zlfccnu/econophysics documentation built on Feb. 23, 2022, 10:22 p.m.