-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
poisson factorial issue #6
Comments
So I think PPP should have the pdf according to Chalmers people. The only difference is division by factorial. I believe the pdf is multiplied by the factorial because the order doesn't matter (around 8:30min mark). |
isnt this what we have already in the src? GenRFS/src/elements/poisson.jl Lines 12 to 14 in 7d67949
where the pdf is function logpdf(::Poisson, x::Int, lambda::Real)
x < 0 ? -Inf : x * log(lambda) - lambda - loggamma(x+1)
end or is the |
i didnt have a chance to re-watch the video but i'm not sure why the current implementation is overcounting order |
yeah i just watched the video. we are not operating over random matrices. To calculate the partial probability of a poission element with a particular schema, we do not need to multiply by the factorial since we are not treating the internal partition as a vector but as a set |
i think this is difference is due primarily in the difference in the construction of their correspondence table and the partition table in our code. |
It could very well be that I'm missing something. But if you're operating within random matrices/vectors, then you need to divide by the factorial to get the pdf for a particular permutation, and to get the pdf of the set, you need to multiply the pdf of one permutation by the factorial. |
the difference between the two pdfs is important because if the Swedish one sums to 1, then the other will sum to something <1. |
but what is the domain that needs to sum to one? r1 = 3
p1 = PoissonElement{Float64}(r1, normal, (0., 1.0))
r2 = 0.4
b1 = BernoulliElement{Float64}(r2, uniform, (-1.0, 1.0))
pmbrfs = RFSElements{Float64}(undef, 2)
pmbrfs[1] = p1
pmbrfs[2] = b1
julia> s = rfs(pmbrfs)
3-element Array{Float64,1}:
0.7104383645798223
-0.9575397317240311
0.8250133413056314
julia> logpdf(rfs, s, pmbrfs, record)
-4.294921071221889
julia> display(collect(zip(record.table, record.logscores)))
4-element Array{Tuple{Array{Array{Int64,1},1},Float64},1}:
([[1, 3], [2]], -1.24100135244485)
([[1, 2], [3]], -1.359119014693774)
([[2, 3], [1]], -1.4470811864264883)
([[1, 2, 3], []], -1.5197687658964778) for the first partition the logpdf goes something like ls = 0
ls += logpdf(poisson, 2, 3) + logpdf(normal, 0.710, 0.0, 1.0) + logpdf(normal, 0.825, 0.0, 1.0)
ls += logpdf(r2) + logpdf(uniform, -0.957, -1, 1.0) i'm having a hard time seeing how anything here is ordered other than the random finite elements themselves |
What needs to sum to one are the pdfs of all possible sets. I think that's important in the context of normalizing the amount that the PPP component adds to the explanation in relation to the MBRFS component. Like if you do not normalize PPP pdf (say multiply it by 1e200), then you will end up with a likelihood where MBRFS does not matter at all. |
if what I'm saying is correct (not completely sure), then I think you need to add:
|
is that true for the example we have here of one brf + one poisson ? |
i'm really not sure about this. wouldnt adding |
true, I guess it's the other way now -- underrepresenting the poisson |
thanks for the post! we should talk more about this after the cogsci daedline.. i don't agree with the second green box labelled distribution component. fundamentally, i believe that thinking of a wordly generative process (hence the k ways to make the set) is a crutch. These are sets. it is not necessary to describe them as being generated from permutations. i think there is a misunderstanding in what i was trying to do here with still happy to discuss more soon but for now, i would appreciate no major changes to the math. namely that the support over cardinality is independent over the support over observation elements |
(whoops accidently posted the following comment to the wrong issue) hey @eivinasbutkus , just wanted to let you know that there was an update on this front. In MOT, we noticed that the pdf of an RFS was changing as a function of cardinality alone, even when the rfs was a good explanation of the observation. That finally made this thread click for me. A RFS that is a good explanation of a large observation should have a similar log score to an RFS that is a good explanation of a small observation. You were spot on that the discrepancy in logscore would be due to using the standard poisson pdf. |
will put equation down later
The text was updated successfully, but these errors were encountered: