public class GeometricVertex extends IntegerVertex implements ProbabilisticInteger, SamplableWithManyScalars<IntegerTensor>, LogProbGraphSupplier
| Constructor and Description |
|---|
GeometricVertex(double p) |
GeometricVertex(DoubleVertex p) |
GeometricVertex(long[] tensorShape,
double p) |
GeometricVertex(long[] tensorShape,
DoubleVertex p)
A Vertex representing a Geometrically distributed random variable.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<Vertex,DoubleTensor> |
dLogProb(IntegerTensor atValue,
java.util.Set<? extends Vertex> withRespectTo)
The partial derivatives of the natural log prob.
|
DoubleVertex |
getP() |
double |
logProb(IntegerTensor value)
This is the natural log of the probability at the supplied value.
|
LogProbGraph |
logProbGraph() |
IntegerTensor |
sampleWithShape(long[] shape,
KeanuRandom random) |
abs, concat, div, div, divideBy, divideBy, divideBy, equalTo, getValue, greaterThan, greaterThanOrEqualTo, lambda, lambda, lessThan, lessThanOrEqualTo, loadValue, max, min, minus, minus, minus, multiply, multiply, multiply, notEqualTo, observe, observe, plus, plus, plus, pow, pow, reshape, reverseDiv, reverseMinus, saveValue, setAndCascade, setAndCascade, setValue, setValue, slice, sum, sum, take, times, times, toDouble, unaryMinusaddChild, addParent, addParents, equals, eval, getChildren, getConnectedGraph, getDegree, getId, getIndentation, getLabel, getObservedValue, getParents, getRank, getReference, getShape, getState, getValue, hashCode, hasValue, isDifferentiable, isObserved, isProbabilistic, lazyEval, observe, observeOwnValue, print, print, removeLabel, save, setAndCascade, setLabel, setLabel, setParents, setParents, setState, setValue, toString, unobserveclone, finalize, getClass, notify, notifyAll, wait, wait, waitdLogPmf, dLogPmf, dLogPmf, logPmf, logPmf, logPmfdLogProb, dLogProbAtValue, dLogProbAtValue, getValue, keepOnlyProbabilisticVertices, logProbAtValuegetObservedValue, isObserved, observe, unobservesample, sampleManyScalars, sampleManyScalarssampleWithShapepublic GeometricVertex(long[] tensorShape,
DoubleVertex p)
The Keanu Implementation has a support of {1, 2, 3, ...} ie it produces the number of tests until success (not the number of failures until success which has a support {0, 1, 2, ...}
If all provided parameters are scalar then the proposed shape determines the shape
tensorShape - the desired shape of the tensor in this vertexp - the probability that an individual test is a successpublic GeometricVertex(long[] tensorShape,
double p)
public GeometricVertex(DoubleVertex p)
public GeometricVertex(double p)
public IntegerTensor sampleWithShape(long[] shape, KeanuRandom random)
sampleWithShape in interface SamplableWithShape<IntegerTensor>public double logProb(IntegerTensor value)
ProbabilisticlogProb in interface Probabilistic<IntegerTensor>value - The supplied value.public LogProbGraph logProbGraph()
logProbGraph in interface LogProbGraphSupplierpublic java.util.Map<Vertex,DoubleTensor> dLogProb(IntegerTensor atValue, java.util.Set<? extends Vertex> withRespectTo)
ProbabilisticdLogProb in interface Probabilistic<IntegerTensor>atValue - at a given valuewithRespectTo - list of parents to differentiate with respect topublic DoubleVertex getP()