Exemplo n.º 1
0
	void init_GqG() const
	/* initialise predict given a change to q,G
	 *  Implementation: Update rootq
	 */
	{
		first_init = false;
		for (FM::Vec::const_iterator qi = this->q.begin(); qi != this->q.end(); ++qi) {
			if (*qi < 0)
				error (Numeric_exception("Negative q in init_GqG"));
			rootq[qi.index()] = std::sqrt(*qi);
		}
	}
Exemplo n.º 2
0
void General_LzUnAd_observe_model::Likelihood_uncorrelated::Lz (const Uncorrelated_addative_observe_model& model)
/* Set the observation zz and Zv about which to evaluate the Likelihood function
 * Postcond: Observation Information: z,Zv_inv,detZterm
 */
{
	zset = true;
					// Compute inverse of Zv and its reciprocal condition number
	Float rcond = FM::UdUrcond(model.Zv);
	model.rclimit.check_PD(rcond, "Z not PD in observe");

	Bayes_base::Float detZ = 1;
	
	for (FM::Vec::const_iterator zi = model.Zv.begin(), zi_end = model.Zv.end(); zi != zi_end; ++zi) {
		detZ *= *zi;
		Zv_inv[zi.index()] = 1 / (*zi);		// Protected from /0 by rcond check
	}
	using namespace std;
	logdetZ = log(detZ);		// Protected from ln(0) by rcond check
}