public double log_evidence_corpus_and_z(){
		double log_evidence_and_z = 0.0;
		
		for(int t=0;t < T;t++){
			int Nt = (int)(Nt_plus_beta[t]-beta);
			
			for(int k=0; k<Nt; k++){
				double Nt_plus_beta_minus_k = Math.log(Nt+beta-k);
				log_evidence_and_z -= Nt_plus_beta_minus_k;
			}
	
			for(int v=0; v<V;v++){
				double beta_nv = beta_n[v];
				int Nvt = (int)(Nvt_plus_beta_n[v][t]-beta_nv);
				
				for(int k=0; k<Nvt; k++){
					double Nvt_plus_beta_nv_minus_k = Math.log(Nvt+beta_nv-k);
					log_evidence_and_z += Nvt_plus_beta_nv_minus_k;
				}
			}
			
		}
		for(int d=0; d<D; d++){
			int Nd = (int)(Nd_plus_alpha[d]-alpha);
			
			for(int k=0; k<Nd; k++){
				double Nd_plus_alpha_minus_k = Math.log(Nd+alpha-k);
				log_evidence_and_z -= Nd_plus_alpha_minus_k;
			}
			
			for(int t=0; t<T; t++){
				double alpha_mt = alpha_m[t];
				int Ntd = (int)(Ntd_plus_alpha_m[d][t]-alpha_mt);
				
				for(int k=0; k<Ntd; k++){
					double Ntd_plus_alpha_mt_minus_k = Math.log(Ntd+alpha_mt-k);
					log_evidence_and_z += Ntd_plus_alpha_mt_minus_k;
				}
			}
		}
		
		return log_evidence_and_z;
	}