Click or drag to resize
Variable Class
Microsoft Research
A variable in a model
Inheritance Hierarchy

Namespace: MicrosoftResearch.Infer.Models
Assembly: Infer.Compiler (in Infer.Compiler.dll) Version: 2.6.41128.1 (2.6.41128.1)
Syntax
public abstract class Variable : IVariable, 
	IModelExpression, CanGetContainers, HasObservedValue

The Variable type exposes the following members.

Methods
  NameDescription
Public methodAddAttribute(ICompilerAttribute)
Adds an attribute to this variable. Attributes can be used to modify how inference is performed on this variable.
Public methodAddAttribute(QueryType)
Helper to add a query type attribute to this variable.
Public methodAddAttributes(ICompilerAttribute)
Adds multiple attributes to this variable.
Public methodAddAttributes(IEnumerableICompilerAttribute)
Adds multiple attributes to this variable.
Public methodAddDefinitionAttribute
Add an attribute to the factor defining this variable.
Public methodStatic memberAllTrue(VariableBoolean)
Returns a boolean variable which is true if all array elements are true. For AND of two variables, use the & operator.
Public methodStatic memberAllTrue(VariableIListBoolean)
Returns a boolean variable which is true if all array elements are true. For AND of two variables, use the & operator.
Public methodStatic memberArrayT(Range)
Creates a 1D random variable array with a specified size.
Public methodStatic memberArrayT(IListRange)
Creates a 1D or 2D random variable array whose dimensions are specified by a list of Range objects.
Public methodStatic memberArrayT(Range, Range)
Creates a 2D random variable array with specified dimensions.
Public methodStatic memberArrayT(VariableArrayT, Range)
Creates a 1D random variable array that contains a jagged array of 1D random variables.
Public methodStatic memberArrayT(VariableArray2DT, Range)
Creates a 1D random variable array that contains a jagged array of 2D random variables.
Public methodStatic memberArrayT(Range, Range, Range)
Creates a 3D random variable array with specified dimensions.
Public methodStatic memberArrayT(VariableArrayT, Range, Range)
Creates a 2-D random variable array that contains a jagged array of 1D random variables.
Public methodStatic memberArrayT(VariableArrayT, Range, Range, Range)
Creates a 3-D VariableArray object that contains a jagged array of 1D random variables.
Public methodStatic memberArrayTItem, TArray(TItem, Range)
Create a 1D array of random variables
Public methodStatic memberArrayTItem, TArray(VariableArrayTItem, TArray, Range)
Create a 1D array of 1D random variable arrays
Public methodStatic memberArrayFromVector
Create a random array from values in a Vector.
Public methodAttrib
Inline method for adding an attribute to a variable. This method returns the variable object, so that is can be used in an inline expression. e.g. Variable.GaussianFromMeanAndVariance(0,1).Attrib(new MyAttribute());
Public methodStatic memberBernoulli(Double)
Creates a Boolean random variable with a specified probability of being true.
Public methodStatic memberBernoulli(VariableDouble)
Creates a Boolean random variable with the probability of being true specified by a random variable.
Public methodStatic memberBernoulliFromLogOdds(Double)
Creates a Boolean random variable with the probability of being true specified by the input's logistic function.
Public methodStatic memberBernoulliFromLogOdds(VariableDouble)
Creates a Boolean random variable with the probability of being true specified by the input's logistic function, which is represented by a random variable.
Public methodStatic memberBernoulliIntegerSubset(ISparseListDouble)
Creates a random variable whose domain is a list of type integer.
Public methodStatic memberBernoulliIntegerSubset(VariableISparseListDouble)
Creates a random variable whose domain is a list of type integer.
Public methodStatic memberBernoulliList(ISparseListDouble)
Creates a random variable whose domain is a sparse list of bools.
Public methodStatic memberBernoulliList(VariableISparseListDouble)
Creates a random variable whose domain is a sparse list of bools.
Public methodStatic memberBeta(Double, Double)
Creates a Beta-distributed random variable from initial success/failure counts.
Public methodStatic memberBeta(VariableDouble, VariableDouble)
Creates a Beta-distributed random variable from initial success/failure counts that are represented by random variables.
Public methodStatic memberBetaFromMeanAndVariance(Double, Double)
Creates a Beta-distributed random variable with specified mean and variance
Public methodStatic memberBetaFromMeanAndVariance(VariableDouble, VariableDouble)
Creates a Beta-distributed random variable with the mean and variance specified by random variables.
Public methodStatic memberBinomial(Int32, VariableDouble)
Creates a Binomially-distributed random variable with the specified probability of success per trial and number of trials.
Public methodStatic memberBinomial(VariableInt32, VariableDouble)
Creates a Binomially-distributed random variable with the specified probability of success per trial and number of trials.
Public methodStatic memberCase
Opens a stochastic case statement, active when the integer argument has the specified value.
Public methodStatic memberChar
Creates a character random variable defined by a discrete distribution induced by a given probability vector.
Public methodStatic memberCharDigit
Creates a character random variable from a uniform distribution over digits '0'..'9'.
Public methodStatic memberCharLetter
Creates a character random variable from a uniform distribution over letters in 'a'..'z' and 'A'..'Z'.
Public methodStatic memberCharLetterOrDigit
Creates a character random variable from a uniform distribution over 'a'..'z', 'A'..'Z' and '0'..'9'.
Public methodStatic memberCharLower
Creates a character random variable from a uniform distribution over lowercase letters 'a'..'z'.
Public methodStatic memberCharNonWord
Creates a character random variable from a uniform distribution over all characters except ('a'..'z', 'A'..'Z', '0'..'9', '_' and '\'').
Public methodStatic memberCharUniform
Creates a character random variable from a uniform distribution over all possible characters.
Public methodStatic memberCharUpper
Creates a character random variable from a uniform distribution over uppercase letters 'A'..'Z'.
Public methodStatic memberCharWhitespace
Creates a character random variable from a uniform distribution over whitespace characters ('\t'..'\r', ' ').
Public methodStatic memberCharWord
Creates a character random variable from a uniform distribution over word characters ('a'..'z', 'A'..'Z', '0'..'9', '_' and '\'').
Public methodStatic memberCloseAllBlocks
Close blocks in order to recover from exceptions
Public methodStatic memberConcat
Creates a random Vector by concatenating two random Vectors.
Public methodStatic memberConstantT(IListT)
Defines a constant which is a 1D array.
Public methodStatic memberConstantT(T)
Defines a constant
Public methodStatic memberConstantT(T)
Defines a constant which is a 2D array.
Public methodStatic memberConstantT(T)
Defines a constant which is a 1D array.
Public methodStatic memberConstantT(IListT, Range)
Defines a constant which is a 1D array.
Public methodStatic memberConstantT(T, Range)
Defines a constant which is a 1D array.
Public methodStatic memberConstantT(IListIListT, Range, Range)
Defines a constant which is a 2-D jagged array.
Public methodStatic memberConstantT(T, Range, Range)
Defines a constant which is a 2D array.
Public methodStatic memberConstantT(T, Range, Range)
Defines a constant which is a 2-D jagged array
Public methodStatic memberConstantT(T, Range, Range, Range)
Defines a constant array of 2-D arrays
Public methodStatic memberConstantT(T, Range, Range, Range)
Defines a constant 3-D jagged array
Public methodStatic memberConstrainT(ConstrainMethodT, VariableT)
Applies a constraint using a constraint method with one argument.
Public methodStatic memberConstrainT1, T2(ConstrainMethodT1, T2, VariableT1, VariableT2)
Applies a constraint using a constraint method with two arguments.
Public methodStatic memberConstrainT1, T2, T3(ConstrainMethodT1, T2, T3, VariableT1, VariableT2, VariableT3)
Applies a constraint using a constraint method with three arguments.
Public methodStatic memberConstrainT1, T2, T3, T4(ConstrainMethodT1, T2, T3, T4, VariableT1, VariableT2, VariableT3, VariableT4)
Applies a constraint using a constraint method with four arguments.
Public methodStatic memberConstrainBetween
Constrains a double variable to be between two limits.
Public methodStatic memberConstrainEqualT(T, VariableT)
Constrains a variable to equal a constant value.
Public methodStatic memberConstrainEqualT(VariableT, VariableT)
Constrains two variables to be equal.
Public methodStatic memberConstrainEqualT(VariableT, T)
Constrains a variable to equal a constant value.
Public methodStatic memberConstrainEqualRandomT, TDist(T, VariableTDist)
Constrains a value to be equal to a random sample from a distribution.
Public methodStatic memberConstrainEqualRandomT, TDist(VariableT, VariableTDist)
Constrains a variable to be equal to a random sample from a distribution.
Public methodStatic memberConstrainEqualRandomT, TDist(VariableT, TDist)
Constrains a variable to be equal to a random sample from a known distribution.
Public methodStatic memberConstrainFalse
Constrains a boolean variable to be false.
Public methodStatic memberConstrainPositive
Constrains a double variable to be positive.
Public methodStatic memberConstrainTrue
Constrains a boolean variable to be true.
Public methodStatic memberCopyT(VariableT)
Returns a copy of the argument
Public methodStatic memberCopyT(VariableArrayT)
Copy an array
Public methodStatic memberCopyT(VariableArrayVariableArrayT, T)
Copy an array
Public methodStatic memberCopyTItem, T(VariableArrayVariableArrayTItem, T, T)
Copy an array
Public methodStatic memberCountTrue
Returns an integer variable equal to the number of array elements that are true.
Public methodStatic memberCutT
Returns a cut of the argument. Cut is equivalent to random(infer()).
Public methodStatic memberDirichlet(Double)
Creates a Dirichlet-distributed random variable with a specified set of pseudo-counts.
Public methodStatic memberDirichlet(Vector)
Creates a Dirichlet-distributed random variable with a set of pseudo-counts specified by a Vector object.
Public methodStatic memberDirichlet(VariableVector)
Creates a Dirichlet-distributed random variable with pseudo-counts specified by a random variable.
Public methodStatic memberDirichlet(Range, Vector)
Creates a Dirichlet-distributed random variable with the dimensionality specified by a Range object and the pseudo-counts specified by a Vector object.
Public methodStatic memberDirichlet(Range, VariableVector)
Creates a Dirichlet-distributed random variable with the dimensionality specified by a Range object and the pseudo-counts represented by a random variable.
Public methodStatic memberDirichlet(Range, Double)
Creates a Dirichlet-distributed random variable with the dimensionality specified by a Range object and a specified set of pseudo-counts.
Public methodStatic memberDirichletSymmetric(Int32, VariableDouble)
Creates a symmetric Dirichlet-distributed random variable with a specified dimension and a common pseudo-count, which is represented by a random variable.
Public methodStatic memberDirichletSymmetric(Int32, Double)
Creates a symmetric Dirichlet-distributed random variable with a specified dimension and a common pseudo-count.
Public methodStatic memberDirichletSymmetric(Range, VariableDouble)
Creates a symmetric Dirichlet-distributed random variable with the dimension specified by a Range object and a common pseudo-count, which is represented by a random variable.
Public methodStatic memberDirichletUniform(Int32)
Create a uniform Dirichlet-distributed random variable with a specified dimension.
Public methodStatic memberDirichletUniform(Range)
Creates a uniform Dirichlet-distributed random variable with dimension specified by a Range object.
Public methodStatic memberDirichletUniform(VariableInt32)
Create a uniform Dirichlet-distributed random variable with a specified dimension.
Public methodStatic memberDiscrete(Double)
Creates a random variable that is statistically defined by a Discrete distribution with a specified set of probabilities.
Public methodStatic memberDiscrete(Vector)
Creates a random variable that is statistically defined by a Discrete distribution with the set of possible values specified by a Vector object.
Public methodStatic memberDiscrete(VariableVector)
Creates a random variable that is statistically defined by a Discrete distribution with the probabilities of the possible values specified by an Vector random variable.
Public methodStatic memberDiscrete(Range, Vector)
Creates a random variable that is statistically defined by a Discrete distribution with the number of possible values specified by a Range object and the probabilities by a Vector object.
Public methodStatic memberDiscrete(Range, VariableVector)
Creates a random variable that is statistically defined by a Discrete distribution with the number of possible values specified by a Range object and the probabilities of the possible values specified by an Vector random variable.
Public methodStatic memberDiscrete(Range, Double)
Creates a random variable that is statistically defined by a Discrete distribution with a specified number of possible values, and a corresponding set of probabilities.
Public methodStatic memberDiscreteFromLogProbs
Creates a random int variable x where p(x=k) is proportional to exp(logProbs[k]), i.e. the softmax function of the logProbs.
Public methodStatic memberDiscreteUniform(Int32)
Create a random integer by drawing uniformly from the range 0..(size-1)
Public methodStatic memberDiscreteUniform(Range)
Create a random integer by drawing uniformly from a range.
Public methodStatic memberDiscreteUniform(VariableInt32)
Creates a random variable that is statistically defined by a Discrete distribution with the number of possible values specified by an int random variable.
Public methodStatic memberDiscreteUniform(Range, VariableInt32)
Creates a random variable that is statistically defined by a uniform Discrete distribution with the number of possible values specified by Range object, and the upper bound specified by a random variable.
Public methodStatic memberDouble(IModelExpressionInt32)
Create a double-precision random variable that is constrained to equal the given integer expression.
Public methodStatic memberDouble(VariableInt32)
Create a double-precision random variable that is constrained to equal the given integer variable.
Public methodStatic memberEnumDiscreteTEnum(Double)
Creates a random variable with a Discrete distribution with specified probabilities for each of the values of the specified enum type.
Public methodStatic memberEnumDiscreteTEnum(Vector)
Creates a random variable with a Discrete distribution with the probabilities for each of the values of the enum type specified by a Vector object.
Public methodStatic memberEnumDiscreteTEnum(VariableVector)
Creates a random variable with a Discrete distribution using probabilities specified by a Vector object for each of the values of the specified enum type.
Public methodStatic memberEnumDiscreteTEnum(Range, Vector)
Creates a random variable with a Discrete distribution with the number of possible values specified by a Range object and the probabilities for each of the values of the enum type specified by a Vector object.
Public methodStatic memberEnumDiscreteTEnum(Range, Double)
Creates a random variable with a Discrete distribution with the dimension specified by a Range object and specified probabilities for each of the values of the enum type.
Public methodStatic memberEnumToIntTEnum
Creates a random int variable corresponding to a random enum variable. The returned variable can be used as the condition for a Switch or Case block.
Public methodStatic memberEnumUniformTEnum
Creates a random variable with a Discrete distribution with a uniform distribution.
Public methodStatic memberEnumUniformTEnum(Range)
Creates a random variable with a Discrete distribution with the dimension specified by a Range object and a uniform distribution.
Public methodStatic memberExp
Returns a variable which takes e to the power of another random variable
Public methodStatic memberForEach
Creates a new 'for each' block
Public methodStatic memberFunctionEvaluate
Evaluate a random function at a point
Public methodStatic memberGammaFromMeanAndVariance(Double, Double)
Creates a Gamma-distributed random variable with specified mean and variance parameters.
Public methodStatic memberGammaFromMeanAndVariance(VariableDouble, VariableDouble)
Creates a Gamma-distributed random variable with its mean and variance parameters represented by random variables.
Public methodStatic memberGammaFromShapeAndRate(Double, Double)
Creates a Gamma-distributed random variable with specified shape and rate parameters.
Public methodStatic memberGammaFromShapeAndRate(VariableDouble, VariableDouble)
Creates a Gamma-distributed random variable with its shape and rate parameters represented by random variables.
Public methodStatic memberGammaFromShapeAndScale(Double, Double)
Creates a Gamma-distributed random variable with specified shape and scale parameters.
Public methodStatic memberGammaFromShapeAndScale(VariableDouble, VariableDouble)
Creates a Gamma-distributed random variable with its shape and scale parameters represented by random variables.
Public methodStatic memberGaussianFromMeanAndPrecision(Double, Double)
Creates a Gaussian-distributed random variable with specified mean and precision.
Public methodStatic memberGaussianFromMeanAndPrecision(VariableDouble, VariableDouble)
Creates a Gaussian-distributed random variable with mean and precision represented by random variables.
Public methodStatic memberGaussianFromMeanAndVariance(Double, Double)
Creates a Gaussian-distributed random variable with specified mean and variance.
Public methodStatic memberGaussianFromMeanAndVariance(VariableDouble, VariableDouble)
Creates a Gaussian-distributed random variable with the mean and variance represented by random variables.
Public methodStatic memberGaussianFromMeanAndVariance(VariableDouble, Double)
Creates a Gaussian-distributed random variable with a specified variance, and the mean represented by a random variable.
Public methodStatic memberGaussianListFromMeanAndPrecision(ISparseListDouble, ISparseListDouble)
Returns a random variable over a sparse vector domain where each element is statistically defined in terms of the corresponding mean and precision elements in sparse vectors of means and precisions
Public methodStatic memberGaussianListFromMeanAndPrecision(ISparseListDouble, VariableISparseListDouble)
Returns a random variable over a sparse list domain where each element is statistically defined in terms of the corresponding mean and precision elements in sparse vectors of means and precisions
Public methodStatic memberGaussianListFromMeanAndPrecision(VariableISparseListDouble, ISparseListDouble)
Returns a random variable over a sparse vector domain where each element is statistically defined in terms of the corresponding mean and precision elements in sparse vectors of means and precisions
Public methodStatic memberGaussianListFromMeanAndPrecision(VariableISparseListDouble, VariableISparseListDouble)
Returns a random variable over a sparse list domain where each element is statistically defined in terms of the corresponding mean and precision elements in sparse vectors of means and precisions
Public methodGetAttributesAttributeType
Get all attributes of this variable having type AttributeType.
Public methodGetContainersT
List of containers for this variable (ForEachBlock, IfBlock, etc.)
Public methodGetDomainType
Gets the domain type of a Variable<T>
Public methodGetExpression
Gets a syntax tree which refers to this variable in MSL.
Public methodGetFirstAttributeAttributeType
Gets the first attribute of the specified type
Public methodStatic memberGetItem(VariableString, VariableInt32)
Creates a character random variable representing the character on a given position inside a given string.
Public methodStatic memberGetItem(VariableVector, VariableInt32)
Copy an element of a vector.
Public methodStatic memberGetItemsT(VariableIListT, VariableArrayInt32)
Gets a variable array containing (possibly duplicated) items of a source array
Public methodStatic memberGetItemsT(VariableT, VariableArrayInt32)
Gets a variable array containing (possibly duplicated) items of a source array
Public methodStatic memberGetItemsT(VariableArrayT, VariableArrayInt32)
Gets a variable array containing (possibly duplicated) items of a source array
Public methodStatic memberGetItemsTItem, T(VariableArrayTItem, T, VariableArrayInt32)
Gets a variable array containing (possibly duplicated) items of a source array
Public methodGetValueRange
Get the ValueRange attribute of this variable, if any has been set, otherwise throws an exception.
Public methodGetValueRange(Boolean)
Get the ValueRange attribute of this variable, if any has been set.
Public methodHasAttributeAttributeType
Determines if this variable has at least one attribute of type AttributeType.
Public methodStatic memberIArrayT(Range)
Creates a 1D random variable IArray with a specified size.
Public methodStatic memberIArrayT(Range, Range)
Creates a 2D random variable array with specified dimensions.
Public methodStatic memberIArrayT(VariableArrayT, Range)
Creates a 1D random variable IArray that contains a jagged array of 1D random variables.
Public methodStatic memberIArrayT(VariableArray2DT, Range)
Creates a 1D random variable IArray that contains a jagged array of 2D random variables.
Public methodStatic memberIArrayT(VariableArrayT, Range, Range)
Create a 2-D random variable IArray2D that contains a jagged array of 1D random variables.
Public methodStatic memberIArrayTItem, TArray(VariableArrayTItem, TArray, Range)
Create a 1D IArray of 1D random variable arrays
Public methodStatic memberIf
Opens a stochastic if statement, active when the argument is true.
Public methodStatic memberIfNot
Opens a stochastic if statement, active when the argument is false.
Public methodStatic memberIListT(Range)
Creates a 1D random variable IList with a specified size.
Public methodStatic memberIListT(VariableArrayT, Range)
Creates a 1D random variable IList that contains a jagged array of 1D random variables.
Public methodStatic memberIListTItem, TArray(VariableArrayTItem, TArray, Range)
Create a 1D IList of 1D random variable arrays
Public methodStatic memberInnerProduct(VariableArrayDouble, VariableVector)
Returns a double random variable which is the inner product of two vector variables.
Public methodStatic memberInnerProduct(VariableVector, VariableVector)
Returns a double random variable which is the inner product of two vector variables.
Public methodStatic memberIsBetween
Returns a boolean random variable indicating if the supplied double random variable is between the specified limits.
Public methodIsDefinedInContext
True if the variable is defined in the given condition context.
Public methodStatic memberIsPositive
Returns a boolean random variable indicating if the supplied double random variable is positive.
Public methodStatic memberJaggedSubarrayT
Public methodStatic memberLinear
Adds a linear factor between two int variables (max product only!).
Public methodStatic memberLinearTrunc
Adds a truncated linear factor between two int variables (max product only!).
Public methodStatic memberLog
Returns a variable equal to the natural logarithm of d
Public methodStatic memberLogistic
Creates a variable equal to 1/(1+exp(-x))
Public methodStatic memberLookupOperatorFactor
Retrieves the factor method for a given operator and parameter types.
Public methodStatic memberMatrixMultiply
Returns a 2-D array of variables which is the matrix product of two other 2-D arrays of variables
Public methodStatic memberMatrixTimesScalar
Create a matrix variable whose [i,j] entry equals a[i,j]*b
Public methodStatic memberMatrixTimesVector
Returns a Vector variable which is the product of a Matrix variable with a Vector variable
Public methodStatic memberMax
Returns a double variable which is the max of two double variables
Public methodStatic memberMultinomial(Range, VariableVector)
Creates an array x of random integers where x[i] is the number of times that value i is drawn in the given number of trials.
Public methodStatic memberMultinomial(VariableInt32, Vector)
Creates an array x of random integers where x[i] is the number of times that value i is drawn in the given number of trials.
Public methodStatic memberMultinomial(VariableInt32, VariableVector)
Creates an array x of random integers where x[i] is the number of times that value i is drawn in the given number of trials.
Public methodStatic memberMultinomialList
Creates a list x of random integers where x[i] is the number of times that value i is drawn in the given number of trials.
Public methodStatic memberNewT
Creates a variable with no statistical definition.
Public methodStatic memberObservedT(IListT)
Creates a variable array and observes it.
Public methodStatic memberObservedT(T)
Creates a variable and observes it.
Public methodStatic memberObservedT(T)
Creates a 2D variable array and observes it.
Public methodStatic memberObservedT(T)
Creates a variable array and observes it.
Public methodStatic memberObservedT(IListT, Range)
Creates a variable array and observes it.
Public methodStatic memberObservedT(T, Range)
Creates a variable array and observes it.
Public methodStatic memberObservedT(IListIListT, Range, Range)
Creates a jagged variable array and observes it.
Public methodStatic memberObservedT(T, Range, Range)
Creates a 2D variable array and observes it.
Public methodStatic memberObservedT(T, Range, Range)
Creates a jagged variable array and observes it.
Public methodStatic memberObservedT(T, Range, Range, Range)
Creates a jagged variable array and observes it.
Public methodStatic memberPoisson(Double)
Creates a Poisson-distributed random variable with a specified mean.
Public methodStatic memberPoisson(VariableDouble)
Creates a Poisson-distributed random variable with the mean represented by a random variable.
Public methodStatic memberPotts(VariableBoolean, VariableBoolean, VariableDouble)
Adds a Potts factor between two boolean variables (max product only!).
Public methodStatic memberPotts(VariableInt32, VariableInt32, VariableDouble)
Adds a Potts factor between two int variables (max product only!).
Public methodStatic memberProductExp
Returns a Gaussian variable which is the product of A times the exponential of B.
Public methodStatic memberRandomT(IDistributionT)
Creates a random variable with a specified prior distribution.
Public methodStatic memberRandomT, TDist(VariableTDist)
Creates a random variable with a specified prior distribution.
Public methodStatic memberRegisterOperatorFactor
Registers a factor method against a particular operator.
Public methodRemoveAllAttributesAttributeType
Remove all attributes of the specified type
Public methodStatic memberRepeat
Creates a new 'repeat' block
Public methodStatic memberReplicateT(VariableT, Range)
Replicates a value multiple times.
Public methodStatic memberReplicateT(VariableArrayT, Range)
Replicates an array multiple times.
Public methodStatic memberReplicateT(VariableArrayVariableArrayT, T, Range)
Replicates an array multiple times.
Public methodStatic memberReplicateTItem, T(VariableArrayVariableArrayTItem, T, T, Range)
Replicates an array multiple times.
Public methodStatic memberRotate
A random vector equal to the vector (x,y) rotated by an angle about the origin.
Public methodSetSparsity
Sets the Sparsity attribute of this variable, replacing any previously set.
Public methodSetValueRange
Sets the ValueRange attribute of this variable, replacing any previously set.
Public methodStatic memberSoftmax(VariableISparseListDouble)
Creates a vector variable y where y[i] = exp(x[i])/(sum_j exp(x[j])). y has the same length as x.
Public methodStatic memberSoftmax(VariableIListDouble)
Creates a vector variable y where y[i] = exp(x[i])/(sum_j exp(x[j])). y has the same length as x.
Public methodStatic memberSoftmax(VariableArrayDouble)
Creates a vector variable y where y[i] = exp(x[i])/(sum_j exp(x[j])). y has the same length as x.
Public methodStatic memberSoftmax(VariableVector)
Creates a vector variable y where y[i] = exp(x[i])/(sum_j exp(x[j])). y has the same length as x.
Public methodStatic memberString(VariableInt32, VariableInt32)
Creates a string random variable from a uniform distribution over all strings with length in given bounds.
Public methodStatic memberString(VariableInt32, VariableInt32, VariableDiscreteChar)
Creates a string random variable from a uniform distribution over all strings with length in given bounds. String characters are restricted to be non zero probability characters under the given character distribution.
Public methodStatic memberStringCapitalized
Creates a string random variable from a uniform distribution over all strings consisting of an uppercase letter followed by one or more lowercase letters.
Public methodStatic memberStringCapitalized(VariableInt32, VariableInt32)
Creates a string random variable from a uniform distribution over all strings consisting of an uppercase letter followed by one or more lowercase letters, with length in specified bounds.
Public methodStatic memberStringDigits
Creates a string random variable from a uniform distribution over all non-empty strings of digits (see CharDigit).
Public methodStatic memberStringDigits(VariableInt32, VariableInt32)
Creates a string random variable from a uniform distribution over all strings of digits (see CharDigit) with length in given bounds.
Public methodStatic memberStringFormat(VariableString, VariableString)
Replaces argument placeholders such as {0}, {1} etc with arguments having the corresponding index, similar to what Format(String, Object) does.
Public methodStatic memberStringFormat(VariableString, VariableArrayString)
Replaces argument placeholders such as {0}, {1} etc with arguments having the corresponding index, similar to what Format(String, Object) does.
Public methodStatic memberStringFromArray
Creates a string random variable from an array of characters.
Public methodStatic memberStringLetters
Creates a string random variable from a uniform distribution over all non-empty strings of letters (see CharLetter).
Public methodStatic memberStringLetters(VariableInt32, VariableInt32)
Creates a string random variable from a uniform distribution over all strings of letters (see CharLetter) with length in given bounds.
Public methodStatic memberStringLettersOrDigits
Creates a string random variable from a uniform distribution over all non-empty strings of letters or digits (see CharLetterOrDigit).
Public methodStatic memberStringLettersOrDigits(VariableInt32, VariableInt32)
Creates a string random variable from a uniform distribution over all strings of letters or digits (see CharLetterOrDigit) with length in given bounds.
Public methodStatic memberStringLower
Creates a string random variable from a uniform distribution over all non-empty strings of lowercase letters (see CharLower).
Public methodStatic memberStringLower(VariableInt32, VariableInt32)
Creates a string random variable from a uniform distribution over all strings of lowercase letters (see CharLower) with length in given bounds.
Public methodStatic memberStringNonWord
Creates a string random variable from a uniform distribution over all non-empty strings of non-word characters (see CharNonWord).
Public methodStatic memberStringNonWord(VariableInt32, VariableInt32)
Creates a string random variable from a uniform distribution over all strings of non-word characters (see CharNonWord) with length in given bounds.
Public methodStatic memberStringOfLength(VariableInt32)
Creates a string random variable from a uniform distribution over all strings of given length.
Public methodStatic memberStringOfLength(VariableInt32, VariableDiscreteChar)
Creates a string random variable from a uniform distribution over all strings of given length. String characters are restricted to be non zero probability characters under the given character distribution.
Public methodStatic memberStringUniform
Creates a string random variable from a uniform distribution over all possible strings.
Public methodStatic memberStringUpper
Creates a string random variable from a uniform distribution over all non-empty strings of uppercase letters (see CharUpper).
Public methodStatic memberStringUpper(VariableInt32, VariableInt32)
Creates a string random variable from a uniform distribution over all strings of uppercase letters (see CharUpper) with length in given bounds.
Public methodStatic memberStringWhitespace
Creates a string random variable from a uniform distribution over all non-empty strings of whitespace characters (see CharWhitespace).
Public methodStatic memberStringWhitespace(VariableInt32, VariableInt32)
Creates a string random variable from a uniform distribution over all strings of whitespace characters (see CharWhitespace) with length in given bounds.
Public methodStatic memberStringWord
Creates a string random variable from a uniform distribution over all non-empty strings of word characters (see CharWord).
Public methodStatic memberStringWord(VariableInt32, VariableInt32)
Creates a string random variable from a uniform distribution over all strings of word characters (see CharWord) with length in given bounds.
Public methodStatic memberSubarrayT(VariableIListT, VariableArrayInt32)
Gets a variable array containing different items of a source list
Public methodStatic memberSubarrayT(VariableT, VariableArrayInt32)
Gets a variable array containing different items of a source array.
Public methodStatic memberSubarrayT(VariableArrayT, VariableArrayInt32)
Gets a variable array containing different items of a source list
Public methodStatic memberSubarrayT(VariableArrayT, VariableArrayVariableInt32, IListInt32)
Gets a variable array containing different items of a source list.
Public methodStatic memberSubarrayTItem, T(VariableArrayTItem, T, VariableArrayInt32)
Gets a variable array containing different items of a source list
Public methodStatic memberSubstring
Creates a string random variable which is a substring of a given string.
Public methodStatic memberSubvector
Copy a contiguous subvector of a random vector.
Public methodStatic memberSum(VariableIListDouble)
Returns a double variable which is the sum of the elements of an array variable. For sum of two variables, use the + operator.
Public methodStatic memberSum(VariableDouble)
Returns a double variable which is the sum of the elements of an array variable. For sum of two variables, use the + operator.
Public methodStatic memberSum(VariableVector)
Public methodStatic memberSum(VariableIListVector)
Public methodStatic memberSum_Expanded
Returns a double variable which is the sum of the elements of an array variable. For sum of two variables, use the + operator.
Public methodStatic memberSumWhere
Returns a double random variable which is the inner product of a array of binary variables and a vector variable.
Public methodStatic memberSwitch
Opens a stochastic switch statement using the specified condition variable. This is equivalent to creating a set of identical Variable.Case() statements for each value of i. Within a switch block, you can use the variable i as an array index.
Public methodStatic memberTruncatedGaussian
Returns a random variable that is statistically defined by a truncated Gaussian distribution with specified mean, variance and bounds.
Public methodStatic memberVector
Create a random Vector from values in an array.
Public methodStatic memberVectorGaussianFromMeanAndPrecision(Vector, PositiveDefiniteMatrix)
Creates a Gaussian-distributed random vector with a specified mean and precision matrix.
Public methodStatic memberVectorGaussianFromMeanAndPrecision(VariableVector, VariablePositiveDefiniteMatrix)
Creates a vector Gaussian-distributed random vector with the mean and precision matrix represented by random variables.
Public methodStatic memberVectorGaussianFromMeanAndVariance(Vector, PositiveDefiniteMatrix)
Creates a Gaussian-distributed random vector from a mean vector and variance positive definite matrix.
Public methodStatic memberVectorGaussianFromMeanAndVariance(VariableVector, PositiveDefiniteMatrix)
Creates a Gaussian-distributed random vector from a mean vector and variance positive definite matrix.
Public methodStatic memberVectorGaussianFromMeanAndVariance(VariableVector, VariablePositiveDefiniteMatrix)
Creates a Gaussian-distributed random vector from a mean vector and variance positive definite matrix.
Public methodStatic memberWishartFromShapeAndRate
Creates a Wishart-distributed random matrix with the shape and rate represented by random variables.
Public methodStatic memberWishartFromShapeAndScale(Double, PositiveDefiniteMatrix)
Creates a Wishart-distributed random variable with specified shape and scale.
Public methodStatic memberWishartFromShapeAndScale(VariableDouble, VariablePositiveDefiniteMatrix)
Creates a Wishart-distributed random matrix with the shape and scale represented by random variables.
Top
Fields
  NameDescription
Public fieldloopRange
Top
Properties
  NameDescription
Public propertyArrayVariable
The array that this variable is an element of (otherwise null).
Public propertyDefinition
Gets the definition of this variable in the current context. Will return null if the variable is undefined or if it is only defined in a subcontext (such as an If or Switch).
Public propertyIsArrayElement
Whether this variable is an element of an array
Public propertyIsDefined
True if the variable is defined in the current condition context.
Public propertyIsLoopIndex
Public propertyIsObserved
Is Observed property
Public propertyIsReadOnly
Read only property
Public propertyName
Name
Public propertyNameInGeneratedCode
Name used in generated code
Top
Explicit Interface Implementations
Remarks
Variables can be base or derived. A base Variable is explicitly declared as a variable in MSL. A derived Variable is simply an expression built from variables. For example, the expression a[i] is a derived Variable called an item variable. Every method that manipulates Variable objects must be aware of this distinction.
See Also