comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Is there function about how to compute joint probability distribution?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Is there function about how to compute joint probability distribution? [message #27876] Sun, 11 November 2001 15:14 Go to next message
Xiuying Wang is currently offline  Xiuying Wang
Messages: 1
Registered: November 2001
Junior Member
Hi,
I am doing research work now and I need to use joint probability
distribution and marginal probability distribution. I wonder whether you
can tell me how to do that in the shortest time, please?
Many thanks!

Best wishes,
Xiu Ying
Re: Is there function about how to compute joint probability distribution? [message #27953 is a reply to message #27876] Tue, 13 November 2001 01:44 Go to previous messageGo to next message
bente is currently offline  bente
Messages: 13
Registered: October 2001
Junior Member
Xiuying Wang <xiuying@cs.usyd.edu.au> wrote in message news:<3BEF063B.46048EA1@cs.usyd.edu.au>...
> Hi,
> I am doing research work now and I need to use joint probability
> distribution and marginal probability distribution. I wonder whether you
> can tell me how to do that in the shortest time, please?
> Many thanks!
>
> Best wishes,
> Xiu Ying

Hi,
I�m using Mutual Information on 3D-Arrays, so there I need the
JointProbability between the Intensities of both arrays.
I�ve done this with the Hist_2D Function.

Hist_2D gives the two dimensional density function ob both arrays. In
words, it gives the number of corresponding Pixels which have certain
intensities in eihter array (e.g. low intensity in A and high
intensity in B,...)

To get the joint probability I simply divided by the Total of the
histogram.

Here the part of my program for the mutual information
; mi, mutual information

if imeasure eq 4 then begin

hist = hist_2d( a, b )
hist = rotate(hist,7)
hist = float(hist)

pxy = hist / total(hist)
px = fltarr(256)
py = fltarr(256)

for j = 0, 255 do begin
px(j) = total(pxy(j,*))
py(j) = total(pxy(*,j))
endfor
col = replicate(1.0,256)
px_mat = px # col
py_mat = py # col
py_mat = rotate(py_mat,1)
pxxyy = px_mat * py_mat
pxyn = pxy * 0.0
index = where( pxxyy gt 0.0 and pxy gt 0.0, icount2)
;if (icount2 gt 0) then $
pxyn[index] = pxy[index] * alog( pxy[index] / pxxyy[index]) /
alog(2.0)
mi = total(pxyn)

endif

I don�t know exactly how your problem looks like, but maybe this can
help.

Kay
Re: Is there function about how to compute joint probability distribution? [message #82720 is a reply to message #27953] Sun, 13 January 2013 10:00 Go to previous message
msam04 is currently offline  msam04
Messages: 1
Registered: January 2013
Junior Member
On Tuesday, November 13, 2001 4:44:41 AM UTC-5, Kay wrote:
> Xiuying Wang <xiuying@cs.usyd.edu.au> wrote in message news:<3BEF063B.46048EA1@cs.usyd.edu.au>...
>> Hi,
>> I am doing research work now and I need to use joint probability
>> distribution and marginal probability distribution. I wonder whether you
>> can tell me how to do that in the shortest time, please?
>> Many thanks!
>>
>> Best wishes,
>> Xiu Ying
>
> Hi,
> I´m using Mutual Information on 3D-Arrays, so there I need the
> JointProbability between the Intensities of both arrays.
> I´ve done this with the Hist_2D Function.
>
> Hist_2D gives the two dimensional density function ob both arrays. In
> words, it gives the number of corresponding Pixels which have certain
> intensities in eihter array (e.g. low intensity in A and high
> intensity in B,...)
>
> To get the joint probability I simply divided by the Total of the
> histogram.
>
> Here the part of my program for the mutual information
> ; mi, mutual information
>
> if imeasure eq 4 then begin
>
> hist = hist_2d( a, b )
> hist = rotate(hist,7)
> hist = float(hist)
>
> pxy = hist / total(hist)
> px = fltarr(256)
> py = fltarr(256)
>
> for j = 0, 255 do begin
> px(j) = total(pxy(j,*))
> py(j) = total(pxy(*,j))
> endfor
> col = replicate(1.0,256)
> px_mat = px # col
> py_mat = py # col
> py_mat = rotate(py_mat,1)
> pxxyy = px_mat * py_mat
> pxyn = pxy * 0.0
> index = where( pxxyy gt 0.0 and pxy gt 0.0, icount2)
> ;if (icount2 gt 0) then $
> pxyn[index] = pxy[index] * alog( pxy[index] / pxxyy[index]) /
> alog(2.0)
> mi = total(pxyn)
>
> endif
>
> I don´t know exactly how your problem looks like, but maybe this can
> help.
>
> Kay

Hi Kay,

Is there a reason for you to do the rotations? Wouldn't you get the mutual information without doing, first the rotation of hist and later the rotation of py_mat?

Thanks,
msam
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: convert_coord & overplotting across multiple widget draw windows
Next Topic: Re: Is IDL 8.2 Workbench Slow, Too?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:07:12 PDT 2025

Total time taken to generate the page: 0.00667 seconds