Monday, March 12, 2012 1:59 PMHi,
I'm not sure whether to open a new thread or not for this topic. Anyway, ...
For a multivariate Guassian distribution, I would like to have diagonal or spherical covariance matrix (constrained Positive Definite Matrix). How can I specify this in Infer.NET? For full covariance, I'm aware that I have to specify:
But what about for diagonal or spherical case? For spherical case, since there is only one parameter for covariance matrix (identity matrix times constant: independent of the dimension) I'd like to do something like:
But I think that there is no such built-in conditional distribution.
Any help would be appreciated.
Tuesday, March 13, 2012 2:04 PM
The model you are talking about is equivalent to generating each element of a data vector separately, i.e.
data[n][k] = Variable.GaussianFromMeanAndPrecision(mean[z[n]][k], prec[z[n]][k])
To do this, define (data, mean, prec) as jagged arrays instead of arrays of vectors.
- Marked As Answer by Kyaw Kyaw Htike Thursday, March 15, 2012 9:36 AM
Wednesday, March 14, 2012 11:06 PM
Thanks! I've just tried your suggestion and it works well. I was just wondering which is better (in terms of being more efficient, faster, etc for large datasets) when defining data, mean and prec (my dataset has fixed dimension for each data point):
rectangular array, i.e. VariableArray2D ()
jagged array, i.e. VariableArray<VariableArray<double>, double>
Thursday, March 15, 2012 9:21 AMJagged arrays will be the most efficient since we've put the most effort into optimizing them. 2D arrays are less common so we haven't optimized them as much.