protected void generateReferenceModelWithXVal(){
		m_allWordFrequencyWithXVal = 0;
		for(_Doc d: m_corpus.getCollection()){
			if(d instanceof _ParentDoc){
			
				for(_SparseFeature fv:d.getSparse()){
					int wid = fv.getIndex();
					double val = fv.getValue();
					
					m_allWordFrequencyWithXVal += val;
					if(m_wordSstat.containsKey(wid)){
						double oldVal = m_wordSstat.get(wid);
						m_wordSstat.put(wid, oldVal+val);
					}else{
						m_wordSstat.put(wid, val);
					}
				}
			}else{
				double docLenWithXVal = 0;
				
				for(_Word w:d.getWords()){
//					double xProportion = w.getXProb();
					int wid = w.getIndex();
					double val = 0;
//					double val = 1-xProportion;

					
					if (((_ChildDoc) d).m_wordXStat.containsKey(wid)) {
						val = ((_ChildDoc) d).m_wordXStat.get(wid);
					}
					
					docLenWithXVal += val;
					
					m_allWordFrequencyWithXVal += val;
					if(m_wordSstat.containsKey(wid)){
						double oldVal = m_wordSstat.get(wid);
						m_wordSstat.put(wid, oldVal+val);
					}else{
						m_wordSstat.put(wid, val);
					}
				}
				
				((_ChildDoc) d).setChildDocLenWithXVal(docLenWithXVal);
			}
				
		}
		
		for(int wid:m_wordSstat.keySet()){
			double val = m_wordSstat.get(wid);
			double prob = val/m_allWordFrequencyWithXVal;
			m_wordSstat.put(wid, prob);
		}
	}