<?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_9_EN</id>
		<title>KADD 2022 Laboratorium 9 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_9_EN"/>
		<link rel="alternate" type="text/html" href="http://www.if.pw.edu.pl/~lgraczyk/wiki/index.php?title=KADD_2022_Laboratorium_9_EN&amp;action=history"/>
		<updated>2026-04-04T23:46:16Z</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_9_EN&amp;diff=2930&amp;oldid=prev</id>
		<title>Lgraczyk at 11:09, 9 May 2022</title>
		<link rel="alternate" type="text/html" href="http://www.if.pw.edu.pl/~lgraczyk/wiki/index.php?title=KADD_2022_Laboratorium_9_EN&amp;diff=2930&amp;oldid=prev"/>
				<updated>2022-05-09T11:09:47Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 11:09, 9 May 2022&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Zadanie &lt;/del&gt;==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Exercise &lt;/ins&gt;==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Część pierwsza&lt;/del&gt;'': '''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Rozkład chi&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;kwadrat&lt;/del&gt;''' (3 pkt.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Part one&lt;/ins&gt;'': '''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Chi&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;squared distribution&lt;/ins&gt;''' (3 pkt.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Napisać skrypt rysujący wykres rozkładu &lt;/del&gt;chi-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;kwadrat oraz jego dystrybuanty dla różnych wartości liczby stopni swobody&lt;/del&gt;: &amp;lt;code&amp;gt;n=1..20&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Write a script which will draw the &lt;/ins&gt;chi-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;squared probability distribution and it's cumulative distribution for number of degrees of freedom in the range&lt;/ins&gt;: &amp;lt;code&amp;gt;n=1..20&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Część druga&lt;/del&gt;'': '''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Dopasowanie funkcji Gaussa&lt;/del&gt;''' (2 pkt.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Part two&lt;/ins&gt;'': '''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Fitting of the Gaussian function&lt;/ins&gt;''' (2 pkt.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Napisać skrypt dokonujący splotu &lt;/del&gt;n &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;rozkładów jednostajnych&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Liczbę &lt;/del&gt;n &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;należy wyznaczyć jako najmniejszą liczbę dodanych rozkładów&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;dla której wartość &lt;/del&gt;chi2/ndf, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;obliczona na podstawie dopasowania funkcji Gaussa &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;wykorzystując gotowe funkcje klasy TF1 - używamy funkcji &lt;/del&gt;&amp;lt;code&amp;gt;Fit&amp;lt;/code&amp;gt;) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;jest mniejsza od 1.0&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Write a script which will perform a convolution of &lt;/ins&gt;n &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;uniform distributions&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;The value of &lt;/ins&gt;n &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;compute as a minimal number of convolutions&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;for which the value of &lt;/ins&gt;chi2/ndf, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;calculated from the fit of the Gaussian function is lower than 1.0 &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;we use the method &lt;/ins&gt;&amp;lt;code&amp;gt;Fit&amp;lt;/code&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;from the TF1 class&lt;/ins&gt;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Uwagi &lt;/del&gt;==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Attention &lt;/ins&gt;==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Przechodzimy do &lt;/del&gt;'''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;drugiej części&lt;/del&gt;''' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;naszego przedmiotu &lt;/del&gt;- &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;do tej pory zajmowaliśmy się własnościami rozkładów prawdopodobieństwa, teraz będziemy się zajmować szukaniem parametrów rozkładów prawdopodobieństwa &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;czyli '''estymacją'''&lt;/del&gt;) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;na podstawie skończonej próby losowej &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;np&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;przeprowadzonego eksperymentu)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;We move to the &lt;/ins&gt;'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;second part&lt;/ins&gt;''' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;of our class &lt;/ins&gt;- &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;until now we have considered only properties of the probability distributions. Now we will move to the methods of finding the parameters &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;estimation&lt;/ins&gt;) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;of those distributions from the random sample &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;experiment)&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Czytamy dokładnie &lt;/del&gt;'''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Wykład 8&lt;/del&gt;''' [http://www.if.pw.edu.pl/~lgraczyk/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;KADD2019&lt;/del&gt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Wyklad8&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;2019&lt;/del&gt;.pdf link] - &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;zwłaszcza slajdy dotyczące pobierania próby losowej z rozkładu normalnego &lt;/del&gt;(22-27) - &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;najlepiej jednak przeczytać cały wykład, łącznie z wyjaśnieniem czym są estymatory i dlaczego rozkład chi-kwadrat jest taki ważny&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Można również przeczytać '''Wykład 7''' [http://www.if.pw.edu.pl/~lgraczyk/KADD2019/Wyklad7-2019.pdf link] - slajdy od 27 do końca (w zasadzie to samo co Wykład 8, tylko z wyprowadzeniami)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;We read &lt;/ins&gt;'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Lecture 9&lt;/ins&gt;''' [http://www.if.pw.edu.pl/~lgraczyk/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;KADD2022&lt;/ins&gt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Wyklad9&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;2022&lt;/ins&gt;.pdf link] - &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;especially slides about the chi-squred distribution &lt;/ins&gt;(22-27) - &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the best is to read the about the estimators&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;W części pierwszej do rozkładu &lt;/del&gt;chi-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;kwadrat należy zaimplementować wzór ze slajdu 24 - współczynnik '''k''' zawiera fumkcję &lt;/del&gt;gamma (&amp;lt;code&amp;gt;TMath::Gamma&amp;lt;/code&amp;gt;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;In the first part for &lt;/ins&gt;chi-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;squared distribution we used the &lt;/ins&gt;gamma &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;function from &lt;/ins&gt;(&amp;lt;code&amp;gt;TMath::Gamma&amp;lt;/code&amp;gt;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;W części drugiej wykonujemy &lt;/del&gt;n &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;rozkładów jednorodnych i wynikowy &lt;/del&gt;histogram &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;dopasowujemy funkcją Gaussa &lt;/del&gt;- &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;powinna to być pętla &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;np&lt;/del&gt;. &amp;lt;code&amp;gt;while&amp;lt;/code&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;albo &lt;/del&gt;&amp;lt;code&amp;gt;do-while&amp;lt;/code&amp;gt;), &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;którą przerywamy w momencie, gdy wartość statystyki testowej &lt;/del&gt;chi-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;kwadrat &lt;/del&gt;(X^2) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;dzielona na liczbę stopni swobody &lt;/del&gt;(NDF) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;jest mniejsza od &lt;/del&gt;1. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Do obliczania &lt;/del&gt;X^2 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;oraz &lt;/del&gt;NDF &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;są odpowiednie funkcje w klasie &lt;/del&gt;TF1 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;(nie robimy tego ręcznie)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;In the second part we perform &lt;/ins&gt;n &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;convolutions of uniform distributions and the resulting &lt;/ins&gt;histogram &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;should be fitted with the Gaussian function &lt;/ins&gt;- &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;it should be a loop &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;i.e&lt;/ins&gt;. &amp;lt;code&amp;gt;while&amp;lt;/code&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;or &lt;/ins&gt;&amp;lt;code&amp;gt;do-while&amp;lt;/code&amp;gt;), &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;which we break when the value of the test statistics &lt;/ins&gt;chi-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;squared &lt;/ins&gt;(X^2) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;divided by the number of degrees of freedom &lt;/ins&gt;(NDF) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;is lower than &lt;/ins&gt;1. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;To calculate &lt;/ins&gt;X^2 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;and &lt;/ins&gt;NDF &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;there are appropriate methods in the &lt;/ins&gt;TF1 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;class&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Wynik &lt;/del&gt;==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Result &lt;/ins&gt;==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Rozkład chi&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;kwadrat&lt;/del&gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Chi&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;squared distribution&lt;/ins&gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[File:lab9_2.png]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[File:lab9_2.png]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Dopasowanie funkcji Gaussa&lt;/del&gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Fit of the Gaussian function&lt;/ins&gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[File:lab9_splot.png]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[File:lab9_splot.png]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Output &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;przykładowy&lt;/del&gt;):&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Result &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;example&lt;/ins&gt;):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;liczba splecionych rozkladow jednostajnych &lt;/del&gt;= 9&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;number of convoluted distributions &lt;/ins&gt;= 9&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; chi2/ndf = 55.724/59 = 0.944475&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; chi2/ndf = 55.724/59 = 0.944475&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lgraczyk</name></author>	</entry>

	<entry>
		<id>http://www.if.pw.edu.pl/~lgraczyk/wiki/index.php?title=KADD_2022_Laboratorium_9_EN&amp;diff=2929&amp;oldid=prev</id>
		<title>Lgraczyk: Created page with &quot;== Zadanie == ''Część pierwsza'': '''Rozkład chi-kwadrat''' (3 pkt.)  Napisać skrypt rysujący wykres rozkładu chi-kwadrat oraz jego dystrybuanty dla różnych wartości li...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.if.pw.edu.pl/~lgraczyk/wiki/index.php?title=KADD_2022_Laboratorium_9_EN&amp;diff=2929&amp;oldid=prev"/>
				<updated>2022-05-09T10:58:13Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Zadanie == &amp;#39;&amp;#39;Część pierwsza&amp;#39;&amp;#39;: &amp;#39;&amp;#39;&amp;#39;Rozkład chi-kwadrat&amp;#39;&amp;#39;&amp;#39; (3 pkt.)  Napisać skrypt rysujący wykres rozkładu chi-kwadrat oraz jego dystrybuanty dla różnych wartości li...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Zadanie ==&lt;br /&gt;
''Część pierwsza'': '''Rozkład chi-kwadrat''' (3 pkt.)&lt;br /&gt;
&lt;br /&gt;
Napisać skrypt rysujący wykres rozkładu chi-kwadrat oraz jego dystrybuanty dla różnych wartości liczby stopni swobody: &amp;lt;code&amp;gt;n=1..20&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''Część druga'': '''Dopasowanie funkcji Gaussa''' (2 pkt.)&lt;br /&gt;
&lt;br /&gt;
Napisać skrypt dokonujący splotu n rozkładów jednostajnych. Liczbę n należy wyznaczyć jako najmniejszą liczbę dodanych rozkładów, dla której wartość chi2/ndf, obliczona na podstawie dopasowania funkcji Gaussa (wykorzystując gotowe funkcje klasy TF1 - używamy funkcji &amp;lt;code&amp;gt;Fit&amp;lt;/code&amp;gt;) jest mniejsza od 1.0.&lt;br /&gt;
&lt;br /&gt;
== Uwagi ==&lt;br /&gt;
* Przechodzimy do '''drugiej części''' naszego przedmiotu - do tej pory zajmowaliśmy się własnościami rozkładów prawdopodobieństwa, teraz będziemy się zajmować szukaniem parametrów rozkładów prawdopodobieństwa (czyli '''estymacją''') na podstawie skończonej próby losowej (np. przeprowadzonego eksperymentu)&lt;br /&gt;
* Czytamy dokładnie '''Wykład 8''' [http://www.if.pw.edu.pl/~lgraczyk/KADD2019/Wyklad8-2019.pdf link] - zwłaszcza slajdy dotyczące pobierania próby losowej z rozkładu normalnego (22-27) - najlepiej jednak przeczytać cały wykład, łącznie z wyjaśnieniem czym są estymatory i dlaczego rozkład chi-kwadrat jest taki ważny. Można również przeczytać '''Wykład 7''' [http://www.if.pw.edu.pl/~lgraczyk/KADD2019/Wyklad7-2019.pdf link] - slajdy od 27 do końca (w zasadzie to samo co Wykład 8, tylko z wyprowadzeniami)&lt;br /&gt;
* W części pierwszej do rozkładu chi-kwadrat należy zaimplementować wzór ze slajdu 24 - współczynnik '''k''' zawiera fumkcję gamma (&amp;lt;code&amp;gt;TMath::Gamma&amp;lt;/code&amp;gt;)&lt;br /&gt;
* W części drugiej wykonujemy n rozkładów jednorodnych i wynikowy histogram dopasowujemy funkcją Gaussa - powinna to być pętla (np. &amp;lt;code&amp;gt;while&amp;lt;/code&amp;gt; albo &amp;lt;code&amp;gt;do-while&amp;lt;/code&amp;gt;), którą przerywamy w momencie, gdy wartość statystyki testowej chi-kwadrat (X^2) dzielona na liczbę stopni swobody (NDF) jest mniejsza od 1. Do obliczania X^2 oraz NDF są odpowiednie funkcje w klasie TF1 (nie robimy tego ręcznie)&lt;br /&gt;
&lt;br /&gt;
== Wynik ==&lt;br /&gt;
'''Rozkład chi-kwadrat'''&lt;br /&gt;
&lt;br /&gt;
[[File:lab9_2.png]]&lt;br /&gt;
&lt;br /&gt;
'''Dopasowanie funkcji Gaussa'''&lt;br /&gt;
&lt;br /&gt;
[[File:lab9_splot.png]]&lt;br /&gt;
&lt;br /&gt;
Output (przykładowy):&lt;br /&gt;
 liczba splecionych rozkladow jednostajnych = 9&lt;br /&gt;
 chi2/ndf = 55.724/59 = 0.944475&lt;/div&gt;</summary>
		<author><name>Lgraczyk</name></author>	</entry>

	</feed>