dotnet / dotnet/infer

Baeysian PCA on Poisson data

Open
#159 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.6k
Forks
240
PR merge metrics
No merged PRs in 30d

Description

Hi,

I'm trying to build a PCA model to fit poisson data. My use case is nearly the same as the PCA tutorial, except that my observed data is Poisson distributed.

For example instead of `Variable.GaussianFromMeanAndPrecision` in
https://github.com/dotnet/infer/blob/master/src/Tutorials/BayesianPCA.cs#L102
my case would contain something like
`data[observation, feature] = Variable.Poisson(events * T[observation, feature])`.

My problem is that Variable.Poisson expects mean rates in Log space, so the above does not compile.
The error code is saying `Gaussian is not assignable from Gamma for result of method PoissonOp.MeanAverageLogarithm` (interesting thing regarding this error is that my code doesn't contain any gamma distribution - they are all gaussian - yet error report complains about gamma).

On the other hand, if I transform my principal components into log space and do a
`data[observation, feature] = Variable.Poisson(events * Variable.Exp( T[observation, feature] ))` then the code compiles, but I can't get correct results because MatrixMultiply doesn't do the right thing -- in log-space, weights and factors should be added rather than multiplied.

I'd be very thankful for any hints on how to approach this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.