Class CausalQueryOptionsBase
- java.lang.Object
-
- com.bayesserver.causal.CausalQueryOptionsBase
-
- All Implemented Interfaces:
QueryOptions
- Direct Known Subclasses:
BackdoorQueryOptions,DisjunctiveCauseQueryOptions,FrontDoorQueryOptions
public class CausalQueryOptionsBase extends Object implements QueryOptions
Base class for causal query options.
-
-
Constructor Summary
Constructors Constructor Description CausalQueryOptionsBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CancellationgetCancellation()Allows cancellation of a query.CausalEffectKindgetCausalEffectKind()Gets the kind of effect to calculate.InferenceFactorygetCausalInferenceFactory()Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.booleangetConflict()Gets a value indicating whether the conflict measure should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput).DecisionAlgorithmgetDecisionAlgorithm()Gets the algorithm to use when a network contains Decision nodes.InconsistentEvidenceModegetInconsistentEvidenceMode()Determines when anInconsistentEvidenceExceptionis raised.booleangetLogLikelihood()Gets a value indicating whether the log-likelihood of a case should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput).PropagationMethodgetPropagation()Gets the propagation method to be used during inference.QueryEvidenceModegetQueryEvidenceMode()Determines whether evidence is retracted for each query.IntegergetTerminalTime()Gets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.protected voidraisePropertyChanged(String name)voidsetCancellation(Cancellation value)Allows cancellation of a query.voidsetCausalEffectKind(CausalEffectKind value)Sets the kind of effect to calculate.voidsetCausalInferenceFactory(InferenceFactory value)Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.voidsetConflict(boolean value)Sets a value indicating whether the conflict measure should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput).voidsetDecisionAlgorithm(DecisionAlgorithm value)Sets the algorithm to use when a network contains Decision nodes.voidsetInconsistentEvidenceMode(InconsistentEvidenceMode value)Determines when anInconsistentEvidenceExceptionis raised.voidsetLogLikelihood(boolean value)Sets a value indicating whether the log-likelihood of a case should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput).voidsetPropagation(PropagationMethod value)Sets the propagation method to be used during inference.voidsetQueryEvidenceMode(QueryEvidenceMode value)Determines whether evidence is retracted for each query.voidsetTerminalTime(Integer value)Sets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.
-
-
-
Method Detail
-
getCausalInferenceFactory
public InferenceFactory getCausalInferenceFactory()
Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.- Specified by:
getCausalInferenceFactoryin interfaceQueryOptions
-
setCausalInferenceFactory
public void setCausalInferenceFactory(InferenceFactory value)
Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.- Specified by:
setCausalInferenceFactoryin interfaceQueryOptions
-
getCausalEffectKind
public CausalEffectKind getCausalEffectKind()
Gets the kind of effect to calculate. e.g. Total/Direct. Not all algorithms support direct effect calculations.- Specified by:
getCausalEffectKindin interfaceQueryOptions
-
setCausalEffectKind
public void setCausalEffectKind(CausalEffectKind value)
Sets the kind of effect to calculate. e.g. Total/Direct. Not all algorithms support direct effect calculations.- Specified by:
setCausalEffectKindin interfaceQueryOptions
-
getTerminalTime
public Integer getTerminalTime()
Gets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.- Specified by:
getTerminalTimein interfaceQueryOptions
-
setTerminalTime
public void setTerminalTime(Integer value)
Sets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.- Specified by:
setTerminalTimein interfaceQueryOptions
-
getPropagation
public PropagationMethod getPropagation()
Gets the propagation method to be used during inference. Default isPropagationMethod.SUM.- Specified by:
getPropagationin interfaceQueryOptions
-
setPropagation
public void setPropagation(PropagationMethod value)
Sets the propagation method to be used during inference. Default isPropagationMethod.SUM.- Specified by:
setPropagationin interfaceQueryOptions
-
getDecisionAlgorithm
public DecisionAlgorithm getDecisionAlgorithm()
Gets the algorithm to use when a network contains Decision nodes.- Specified by:
getDecisionAlgorithmin interfaceQueryOptions
-
setDecisionAlgorithm
public void setDecisionAlgorithm(DecisionAlgorithm value)
Sets the algorithm to use when a network contains Decision nodes.- Specified by:
setDecisionAlgorithmin interfaceQueryOptions
-
getCancellation
public Cancellation getCancellation()
Allows cancellation of a query. When cancelled, aCancellationExceptionwill be raised.If
Cancellation.getCancel()has been set to true, it should be reset to false, before a subsequent query.- Specified by:
getCancellationin interfaceQueryOptions
-
setCancellation
public void setCancellation(Cancellation value)
Allows cancellation of a query. When cancelled, aCancellationExceptionwill be raised.If
Cancellation.getCancel()has been set to true, it should be reset to false, before a subsequent query.- Specified by:
setCancellationin interfaceQueryOptions
-
getLogLikelihood
public boolean getLogLikelihood()
Gets a value indicating whether the log-likelihood of a case should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput). If calculated the result can be obtained fromQueryOutput.getLogLikelihood().This should only be requested if required.
The natural log (base e) is calculated.
- Specified by:
getLogLikelihoodin interfaceQueryOptions- Returns:
trueif the log-likelihood should be calculated; otherwise,false. Defaults to false.
-
setLogLikelihood
public void setLogLikelihood(boolean value)
Sets a value indicating whether the log-likelihood of a case should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput). If calculated the result can be obtained fromQueryOutput.getLogLikelihood().This should only be requested if required.
The natural log (base e) is calculated.
- Specified by:
setLogLikelihoodin interfaceQueryOptions- Parameters:
value-trueif the log-likelihood should be calculated; otherwise,false. Defaults to false.
-
getConflict
public boolean getConflict()
Gets a value indicating whether the conflict measure should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput). If calculated the result can be obtained fromQueryOutput.getConflict().Conflict is a measure that detects evidence that is conflicting or rare. The greater the conflict value above zero, the more likely the evidence is in conflict, or rare.
Conflict = log((P(e1)P(e2)...P(ei)) / P(e)), where P(e1), P(e2) etc... are the likelihoods of each variable considered in isolation, and P(e) is the likelihood of the all the evidence together.
- Specified by:
getConflictin interfaceQueryOptions
-
setConflict
public void setConflict(boolean value)
Sets a value indicating whether the conflict measure should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput). If calculated the result can be obtained fromQueryOutput.getConflict().Conflict is a measure that detects evidence that is conflicting or rare. The greater the conflict value above zero, the more likely the evidence is in conflict, or rare.
Conflict = log((P(e1)P(e2)...P(ei)) / P(e)), where P(e1), P(e2) etc... are the likelihoods of each variable considered in isolation, and P(e) is the likelihood of the all the evidence together.
- Specified by:
setConflictin interfaceQueryOptions
-
getQueryEvidenceMode
public QueryEvidenceMode getQueryEvidenceMode()
Determines whether evidence is retracted for each query. SeeQueryEvidenceModefor more information.- Specified by:
getQueryEvidenceModein interfaceQueryOptions
-
setQueryEvidenceMode
public void setQueryEvidenceMode(QueryEvidenceMode value)
Determines whether evidence is retracted for each query. SeeQueryEvidenceModefor more information.- Specified by:
setQueryEvidenceModein interfaceQueryOptions
-
getInconsistentEvidenceMode
public InconsistentEvidenceMode getInconsistentEvidenceMode()
Determines when anInconsistentEvidenceExceptionis raised.- Specified by:
getInconsistentEvidenceModein interfaceQueryOptions
-
setInconsistentEvidenceMode
public void setInconsistentEvidenceMode(InconsistentEvidenceMode value)
Determines when anInconsistentEvidenceExceptionis raised.- Specified by:
setInconsistentEvidenceModein interfaceQueryOptions
-
raisePropertyChanged
protected void raisePropertyChanged(String name)
-
-