コード例 #1
0
		/// <summary> Get a probability estimator for a value
		/// 
		/// </summary>
		/// <param name="data">the value to estimate the probability of
		/// </param>
		/// <param name="given">the new value that data is conditional upon 
		/// </param>
		/// <returns> the estimator for the supplied value given the condition
		/// </returns>
		public virtual Estimator getEstimator(double given)
		{
			
			Estimator result = new DiscreteEstimator(m_Estimators.Length, false);
			for (int i = 0; i < m_Estimators.Length; i++)
			{
				result.addValue(i, m_Weights.getProbability(i) * m_Estimators[i].getProbability(given));
			}
			return result;
		}
コード例 #2
0
		/// <summary> Get a probability estimator for a value
		/// 
		/// </summary>
		/// <param name="data">the value to estimate the probability of
		/// </param>
		/// <param name="given">the new value that data is conditional upon 
		/// </param>
		/// <returns> the estimator for the supplied value given the condition
		/// </returns>
		public virtual Estimator getEstimator(double given)
		{
			
			Estimator result = new DiscreteEstimator(m_Estimators.Length, false);
			for (int i = 0; i < m_Estimators.Length; i++)
			{
				//System.out.println("Val " + i
				//			 + " Weight:" + m_Weights.getProbability(i)
				//			 +" EstProb(" + given + ")="
				//			 + m_Estimators[i].getProbability(given));
				result.addValue(i, m_Weights.getProbability(i) * m_Estimators[i].getProbability(given));
			}
			return result;
		}