Answered by:
New distributions? (Migrated from community.research.microsoft.com)
Question

fuhaoda posted on 03262011 12:41 PM
Many thanks for developing the Infer.NET! Great tool to extend our compuation capacity.
I am a statistician and dealing with lots of different distributions. Such as Weibull in survival analysis.
Are you going to incorporate more distribution in the Infer.Net? It seems so limited right now.
Maybe there is another way to do that. Please let me know if I missed something.
Best,
Haoda Fu
Friday, June 3, 2011 6:41 PM
Answers

minka replied on 03302011 4:15 AM
In Infer.NET you are not specifying a pdf, you are always manipulating random variables directly. So if you create a Gaussian random variable and then apply exp, you are getting a new random variable whose prior distribution is lognormal:
Variable<double> y = Variable.Exp(Variable.GaussianFromMeanAndVariance(0,1)); // y's prior is lognormal
I don't understand your second question. It will be clearer if you explain what model you are trying to implement.
 Marked as answer by Microsoft Research Friday, June 3, 2011 6:41 PM
Friday, June 3, 2011 6:41 PM
All replies

John Guiver replied on 03282011 6:07 AM
Hi Haoda
The primary focus of Infer.NET is to allowing building of complex distributions as represented by graphical models, and performing inference in these complex models. These distributions are built by composing simple building blocks. For example, we don't provide a Student T distribution, but we do allow a Gammadistributed random variable to be the precision of a Gaussian Distribution.
As we progress Infer.NET we may consider other building blocks and we are always interested to hear user needs.
John
Friday, June 3, 2011 6:41 PM 
fuhaoda replied on 03282011 10:14 PM
Thanks John 
It will be extremely helpful if they are more distributions in this library.e.g. we have lots of data of time to event (survival data) where some extreme distribution like Weibull will be very helpful.
I am thinking that if they have more complete distribution, lots of statistician will be thrilled.
Best,
Haoda
Friday, June 3, 2011 6:41 PM 
minka replied on 03292011 5:36 AM
As John pointed out, many of these distributions are already available implicitly by combining the primitives in our modelling language. In particular, the negative Binomial, Cauchy, t, F, lognormal, Gumbel, logistic, and Weibull distributions can all be created in our modelling language, with fixed parameters. Parameter learning is possible for some of these too (though not all, e.g. the shape of a tdistribution cannot be learned yet). If you can describe the specific model that you'd like to implement, it would help us to know what should be added.
Friday, June 3, 2011 6:41 PM 
minka replied on 03292011 5:57 AM
Some examples:
negative Binomial = Poisson with Gamma rate
Cauchy,t = Gaussian with Gamma precision
lognormal = exp(Gaussian)
Gumbel = log(Gamma(1))
F = Gamma with Gamma rate
logistic = log(F(1,1)) = log(Gamma(1) with Gamma(1) rate)
Weibull = Gamma(1) raised to power = exp(c*log(Gamma(1)))
Friday, June 3, 2011 6:41 PM 
fuhaoda replied on 03292011 6:27 PM
I agree that it can be derived.
We can generate lognormal by the following formula
lognormal = exp(Gaussian)
But how do they handle the likelihood function through pdf?
In terms of the likelihood, it is not exp(Gaussian pdf). Then I need to do the derivative and calculate the Jacobian matrix etc.. to calculate the lognormal pdf to make inference.
Also in terms of the prior specification, I can set a noninformative prior for one parameter but it may not be noninformative prior of the function of the random variable. such as changing from gamma to Weibull.
Let me know if I am missing something.
Best,
Haoda
Friday, June 3, 2011 6:41 PM 
minka replied on 03302011 4:15 AM
In Infer.NET you are not specifying a pdf, you are always manipulating random variables directly. So if you create a Gaussian random variable and then apply exp, you are getting a new random variable whose prior distribution is lognormal:
Variable<double> y = Variable.Exp(Variable.GaussianFromMeanAndVariance(0,1)); // y's prior is lognormal
I don't understand your second question. It will be clearer if you explain what model you are trying to implement.
 Marked as answer by Microsoft Research Friday, June 3, 2011 6:41 PM
Friday, June 3, 2011 6:41 PM