<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.if.pw.edu.pl/~lgraczyk/wiki/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.if.pw.edu.pl/~lgraczyk/wiki/index.php?action=history&amp;feed=atom&amp;title=KADD_2022_Laboratorium_4_EN</id>
		<title>KADD 2022 Laboratorium 4 EN - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.if.pw.edu.pl/~lgraczyk/wiki/index.php?action=history&amp;feed=atom&amp;title=KADD_2022_Laboratorium_4_EN"/>
		<link rel="alternate" type="text/html" href="http://www.if.pw.edu.pl/~lgraczyk/wiki/index.php?title=KADD_2022_Laboratorium_4_EN&amp;action=history"/>
		<updated>2026-04-05T18:43:58Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.16.5</generator>

	<entry>
		<id>http://www.if.pw.edu.pl/~lgraczyk/wiki/index.php?title=KADD_2022_Laboratorium_4_EN&amp;diff=2880&amp;oldid=prev</id>
		<title>Lgraczyk: Created page with &quot;{| align=&quot;right&quot; | __TOC__ |}  == Exercise == The following probability density function is given: File:Lab04b_funkcja.png  Please do: * calculate constant c in the way the p...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.if.pw.edu.pl/~lgraczyk/wiki/index.php?title=KADD_2022_Laboratorium_4_EN&amp;diff=2880&amp;oldid=prev"/>
				<updated>2022-03-21T12:23:39Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{| align=&amp;quot;right&amp;quot; | __TOC__ |}  == Exercise == The following probability density function is given: &lt;a href=&quot;/~lgraczyk/wiki/index.php/File:Lab04b_funkcja.png&quot; title=&quot;File:Lab04b funkcja.png&quot;&gt;File:Lab04b_funkcja.png&lt;/a&gt;  Please do: * calculate constant c in the way the p...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Exercise ==&lt;br /&gt;
The following probability density function is given:&lt;br /&gt;
[[File:Lab04b_funkcja.png]]&lt;br /&gt;
&lt;br /&gt;
Please do:&lt;br /&gt;
* calculate constant c in the way the probability distribution is normalized&lt;br /&gt;
* randomly select from the probability distribution a pair of numbers (x,y) and then fill with the a histogram of the probability distribution f(x,y) (0.5pkt)&lt;br /&gt;
* normalize the histogram of the probability distribution (0.5pkt)&lt;br /&gt;
* calculate and draw the histogram of the cumulative distribution F(x,y) (1pkt)&lt;br /&gt;
* calculate and draw the histograms of the marginal distributions g(x) i h(y) (1pkt)&lt;br /&gt;
* calculate: &lt;br /&gt;
** expected values: E(X), E(Y) (0.5pkt)&lt;br /&gt;
** standard deviations sigma(X), sigma(Y) (0.5pkt)&lt;br /&gt;
** covariance cov(X,Y) (0.5pkt)&lt;br /&gt;
** correlation coefficient rho(X,Y) (0.5pkt)&lt;br /&gt;
&lt;br /&gt;
== Attention ==&lt;br /&gt;
* As minimum and maximum on x and y axed in all objects we set 0 and PI/2&lt;br /&gt;
* For work with histograms we used objects &amp;lt;code&amp;gt;TH1D&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TH2D&amp;lt;/code&amp;gt;. Some examples can be found in: [ftp://root.cern.ch/root/doc/3Histograms.pdf Histograms]&lt;br /&gt;
* The histogram of the probability density we create by random selection of pseudorandom numbers from the probability density functions (we create a TF2 object like previous lab and we implement a loop until a certain number, for each iteration we use '''GetRandom2''' to select those 2 numbers and then we use a function called  '''Fill'' to fill the density histogram)&lt;br /&gt;
* Cumulative distribution is calculated '''numerically''' (two '''for''' loops, and we integrate the density iterating over x and y, by '''SetBinContent''' we set the specific valued of the histogram)&lt;br /&gt;
* Marginal distributions have their own methods for histograms ('''hint:''' they are called projections)&lt;br /&gt;
* For parameters (means, standard deviations, covariances, correlation factors) - there are specific methods&lt;br /&gt;
&lt;br /&gt;
== Result  ==&lt;br /&gt;
&lt;br /&gt;
Plots:&lt;br /&gt;
[[File:lab04_KADD2016.png]]&lt;br /&gt;
&lt;br /&gt;
Rotated distribution:&lt;br /&gt;
[[File:lab04b_KADD2016.png]]&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
 E(X)=0.990827&lt;br /&gt;
 E(Y)=0.990535&lt;br /&gt;
 sigma(X)=0.377467&lt;br /&gt;
 sigma(Y)=0.377583&lt;br /&gt;
 cov(X,Y)=-0.0137694&lt;br /&gt;
 rho(X,Y)=-0.09661&lt;/div&gt;</summary>
		<author><name>Lgraczyk</name></author>	</entry>

	</feed>