Calculates a number of distributions, e.g. P(A) and P(B) given the evidence (case data, e.g. row in a database), and if requested the log-likelihood of the data.

Namespace:  BayesServer.Inference
Assembly:  BayesServer.Inference (in BayesServer.Inference.dll)
Version: 2.2.0.0 (2.2.0.0)

Syntax

C#
bool Query(
	IQueryOptions queryOptions,
	IQueryOutput queryOutput
)
Visual Basic (Declaration)
Function Query ( _
	queryOptions As IQueryOptions, _
	queryOutput As IQueryOutput _
) As Boolean
Visual C++
bool Query(
	IQueryOptions^ queryOptions, 
	IQueryOutput^ queryOutput
)

Parameters

queryOptions
Type: BayesServer.Inference..::.IQueryOptions
Options governing which calculations are performed and how.
queryOutput
Type: BayesServer.Inference..::.IQueryOutput
Returns any information, in addition to the distributions, that is requested. For example the log-likelihood.

Return Value

A value indicating whether the requested distributions, or the LogLikelihood if requested, where effected by inconsistent evidence or underflow.

Remarks

Each time this method is called the distributions have their values replaced, acting like buffers.

As well as requesting distributions of the form P(A), P(B) it is also possible to request distributions over a number of variables such as P(A,B).

If CLGaussian distributions are requested that include instantiated discrete variables, an algorithm may ligitimately return mean and covariance values equal to NaN for entries corresponding to inconsistent discrete combinations. For example, if a CLGaussian is requested that includes a discrete variable 'Gender' with states 'Male' and 'Female' and evidence is set to 'Female' then any mean and covariance entries that correspond to 'Male' may be set to NaN. NaN values will always be accompanied by a corresponding zero value in the Table.

See Also