public void generateReferenceModel(){
		m_allWordFrequency = 0;
		for(_Doc d: m_corpus.getCollection()){
			_SparseFeature[] fv = d.getSparse();
			
			for(int i=0; i<fv.length; i++){
				int wid = fv[i].getIndex();
				double val = fv[i].getValue();
				
				m_allWordFrequency += val;
				if(m_wordSstat.containsKey(wid)){
					double oldVal = m_wordSstat.get(wid);
					m_wordSstat.put(wid, oldVal+val);
				}else{
					m_wordSstat.put(wid, val);
				}
				
			}
		}
		
		for(int wid:m_wordSstat.keySet()){
			double val = m_wordSstat.get(wid);
			double prob = val/m_allWordFrequency;
			m_wordSstat.put(wid, prob);
		}
	}