-
I am thinking about one problem. There are two kinds of data sets: type X and type Y with their relationships inherently. The data sets below has been gotten via experiments,
data set A(type X); data set B(type Y); gotten from one experiment
data set C(type X); gotten...
-
Hi Laura You could make the Dirichlet itself a variable. For example: Variable < Dirichlet > vPrior = Variable .Observed< Dirichlet >( Dirichlet .Uniform(1)); Variable < Vector > vocabDistr = Variable < Vector >.Random(vPrior); Then, when you're ready to infer, set the observed...
-
Tom has now written a VMP operator for logistic regression which uses the Jaakola and Jordan bound. It will be available in the next beta release (tentatively scheduled for the second week in July). Meanwhile, the code is small enough that I can paste it in here - it uses the BernoulliFromLogOdds factor...
-
I am wondering why are you using a 4x4. The web site I was looking at shows a 5x5 - I just want to make sure that we are on the same page... Going with my variable definitions for now, the first bit of the model sets the prior for whether a cell has a pit or not. There can be any number of pits as drawn...
-
Below is the C# code for the classic wet grass/sprinkler/rain Bayesian network, as found in Kevin Murphy's tutorial , amongst other places. Notice that the conditional probability tables (CPTs) are represented by if blocks or nested if blocks, rather than in tabular form. In general, this allows...
-
OK, if that is what you need, then the following C# code will do the job. // Sample data from the true discrete Vector trueProbs = new Vector (0.1, 0.2, 0.3, 0.4); Discrete trueDistrib = new Discrete (trueProbs); int [] data = new int [1000]; for ( int i = 0; i < data.Length; i++) data[ i ] = Rand...
-
Hi Vincent These should give you the same answer. However, (2) will be preferable in cases where you want to specify this constraint at run-time without the model getting recompiled - you can set the constraint to positive or negative just by setting the observed value of b. I have used this to good...