/** * Creates a new gaussian dynamic Variable from a given Attribute. * @param att a given {@link Attribute}. * @return a new gaussian {@link Variable} object. */ public Variable newGaussianDynamicVariable(Attribute att) { return this.newDynamicVariable(att, DistributionTypeEnum.NORMAL); }
/** * Creates a new multinomial dynamic Variable from a given Attribute. * @param att a given {@link Attribute}. * @return a new multinomial {@link Variable} object. */ public Variable newMultinomialDynamicVariable(Attribute att) { return this.newDynamicVariable(att, DistributionTypeEnum.MULTINOMIAL); }
/** * Creates a new multionomial dynamic Variable from a given name and a list of states. * @param name a {@code String} that represents the name of the dynamic variable. * @param states a {@code List} of {@code String} that represents the different states of the dynamic variable. * @return a {@link Variable} object. */ public Variable newMultinomialDynamicVariable(String name, List<String> states) { return this.newDynamicVariable(name, DistributionTypeEnum.MULTINOMIAL, new FiniteStateSpace(states)); }
/** * Creates a new multionomial logistic dynamic Variable from a given name and number of states. * @param name a {@code String} that represents the name of the dynamic variable. * @param nOfStates an {@code int} that represents the number of states of the dynamic variable. * @return a {@link Variable} object. */ public Variable newMultinomialLogisticDynamicVariable(String name, int nOfStates) { return this.newDynamicVariable(name, DistributionTypeEnum.MULTINOMIAL_LOGISTIC, new FiniteStateSpace(nOfStates)); }
/** * Creates a new multionomial dynamic Variable from a given name and number of states. * @param name a {@code String} that represents the name of the dynamic variable. * @param nOfStates an {@code int} that represents the number of states of the dynamic variable. * @return a {@link Variable} object. */ public Variable newMultinomialDynamicVariable(String name, int nOfStates) { return this.newDynamicVariable(name, DistributionTypeEnum.MULTINOMIAL, new FiniteStateSpace(nOfStates)); }
/** * Creates a new multionomial logistic dynamic Variable from a given name and a list of states. * @param name a {@code String} that represents the name of the dynamic variable. * @param states a {@code List} of {@code String} that represents the different states of the dynamic variable. * @return a {@link Variable} object. */ public Variable newMultinomialLogisticDynamicVariable(String name, List<String> states) { return this.newDynamicVariable(name, DistributionTypeEnum.MULTINOMIAL_LOGISTIC, new FiniteStateSpace(states)); }
/** * Creates a new gaussian dynamic Variable from a given Attribute. * @param name a given {@code String} that represents the name of the dynamic variable. * @return a new gaussian {@link Variable} object. */ public Variable newGaussianDynamicVariable(String name) { return this.newDynamicVariable(name, DistributionTypeEnum.NORMAL, new RealStateSpace()); }
/** * In this example we show how to create an input-outputString KF with Gaussian mixtures (as in Figure 4.29 of Deliverable 2.1). */ public static void VerdandeInputOutputHMM() throws IOException { DataStream<DynamicDataInstance> data = DynamicDataStreamLoader.loadFromFile("datasets/simulated/syntheticDataVerdandeScenario3.arff"); Attribute attDepth = data.getAttributes().getAttributeByName("depth"); Attribute attGammaDiff = data.getAttributes().getAttributeByName("gammaDiff"); DynamicVariables dynamicVariables = new DynamicVariables(); Variable observedDepth = dynamicVariables.newDynamicVariable(attDepth); Variable observedGammaDiff = dynamicVariables.newDynamicVariable(attGammaDiff); Variable formationNo = dynamicVariables.newMultinomialLogisticDynamicVariable("FormationNo", 2); Variable shift = dynamicVariables.newMultinomialDynamicVariable("Shift",2); DynamicDAG dynamicDAG = new DynamicDAG(dynamicVariables); dynamicDAG.getParentSetTimeT(formationNo).addParent(observedDepth); dynamicDAG.getParentSetTimeT(formationNo).addParent(dynamicVariables.getInterfaceVariable(formationNo)); //TODO Error trying to add a duplicate parent. A -> B <- Aclone. We are considering A and AClone the same variables? Is that right? dynamicDAG.getParentSetTimeT(shift).addParent(formationNo); //dynamicDAG.getParentSetTimeT(shift).addParent(dynamicVariables.getInterfaceVariable(formationNo)); dynamicDAG.getParentSetTimeT(shift).addParent(dynamicVariables.getInterfaceVariable(shift)); dynamicDAG.getParentSetTimeT(observedGammaDiff).addParent(shift); System.out.println("-------------------------------------\n"); System.out.println("Input-outputString HMM (Figure 4.31 of D2.1)\n"); System.out.println(dynamicDAG.toString()); DynamicBayesianNetwork dbn = new DynamicBayesianNetwork(dynamicDAG); System.out.println(dbn.toString()); DynamicBayesianNetworkWriter.save(dbn, "networks/simulated/HuginVerdandeIOHMM.dbn"); }
Variable vlatSIGMA = dynamicVariables.newDynamicVariable(attVLATSIGMA); Variable vlatMEAS = dynamicVariables.newDynamicVariable(attVLATMEAS); Variable olatSIGMA = dynamicVariables.newDynamicVariable(attOLATSIGMA); Variable olatMEAS = dynamicVariables.newDynamicVariable(attOLATMEAS);
Variable observedROP = dynamicVariables.newDynamicVariable(attROP); Variable observedTRQ = dynamicVariables.newDynamicVariable(attTRQ);
Variable observedWOB = dynamicVariables.newDynamicVariable(attWOB); Variable observedRPMB = dynamicVariables.newDynamicVariable(attRPM); Variable observedMFI = dynamicVariables.newDynamicVariable(attMFI); Variable observedTRQ = dynamicVariables.newDynamicVariable(attTRQ); Variable observedROP = dynamicVariables.newDynamicVariable(attROP); Variable observedPRESSURE = dynamicVariables.newDynamicVariable(attPRESSURE);