<?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_2020_Laboratorium_10</id>
		<title>KADD 2020 Laboratorium 10 - 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_2020_Laboratorium_10"/>
		<link rel="alternate" type="text/html" href="http://www.if.pw.edu.pl/~lgraczyk/wiki/index.php?title=KADD_2020_Laboratorium_10&amp;action=history"/>
		<updated>2026-07-19T01:26:26Z</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_2020_Laboratorium_10&amp;diff=2941&amp;oldid=prev</id>
		<title>Lgraczyk at 11:24, 16 May 2022</title>
		<link rel="alternate" type="text/html" href="http://www.if.pw.edu.pl/~lgraczyk/wiki/index.php?title=KADD_2020_Laboratorium_10&amp;diff=2941&amp;oldid=prev"/>
				<updated>2022-05-16T11:24:25Z</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:24, 16 May 2022&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&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;'''Weryfikacja hipotez statystycznych''' (5 pkt.)&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;'''Weryfikacja hipotez statystycznych''' (5 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;* The experiment of irradiating a hydrogen bubble chamber with a beam of photons was carried out in order to study the interaction of photons with protons. Photons create electron-positron pairs that can be used to monitor the photon beam. The frequency of images with 0,1,2, ... electron-positron pairs should follow the Poisson distribution. Data should be read from the [http://www.if.pw.edu.pl/~lgraczyk/KADD2016/lab10/dane10.txt file] (the first column shows the number of electron pairs in the image &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt;, and the second column shows the number of photos containing &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; electron pairs). We can see that this distribution resembles the Poisson distribution - therefore we are trying to calculate the maximum likelihood estimator for the parameters of the Poisson distribution (see[http://www.if.pw.edu.pl/~lgraczyk/KADD2022/Wyklad10-2019.pdf Lecture 10]) (1 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pkt&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;* The experiment of irradiating a hydrogen bubble chamber with a beam of photons was carried out in order to study the interaction of photons with protons. Photons create electron-positron pairs that can be used to monitor the photon beam. The frequency of images with 0,1,2, ... electron-positron pairs should follow the Poisson distribution. Data should be read from the [http://www.if.pw.edu.pl/~lgraczyk/KADD2016/lab10/dane10.txt file] (the first column shows the number of electron pairs in the image &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt;, and the second column shows the number of photos containing &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; electron pairs). We can see that this distribution resembles the Poisson distribution - therefore we are trying to calculate the maximum likelihood estimator for the parameters of the Poisson distribution (see[http://www.if.pw.edu.pl/~lgraczyk/KADD2022/Wyklad10-2019.pdf Lecture 10]) (1 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;pt&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;Narysować na jednym wykresie punkty pomiarowe i dopasowanie &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;metodą estymatora największej wiarygodności i funkcją &lt;/del&gt;Fit &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;z &lt;/del&gt;ROOT&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'a użytą z parametrami &lt;/del&gt;&amp;quot;LR&amp;quot; - &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;dopasowanie metodą największej wiarygodności&lt;/del&gt;). &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Funkcja &lt;/del&gt;TF1 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;do rysowania &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;i dopasowania &lt;/del&gt;ROOT&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'em&lt;/del&gt;) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;to &lt;/del&gt;TMath::PoissonI (1 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pkt&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;Draw the measurement points and fit on a single graph &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;with the maximum likelihood estimator method and the &lt;/ins&gt;Fit &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;from &lt;/ins&gt;ROOT &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;function used with the &lt;/ins&gt;&amp;quot;LR&amp;quot; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;parameters &lt;/ins&gt;- &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;maximum likelihood fit method&lt;/ins&gt;). TF1 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;function for drawing &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;and &lt;/ins&gt;ROOT &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;matching&lt;/ins&gt;) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;is &lt;/ins&gt;TMath :: PoissonI (1 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;pt&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;* Sprawdzić jakość dopasowania za pomocą testu χ2. W tym celu należy zaimplementować funkcję obliczającą statystykę testową χ2 zgodnie z wzorem [[File:wzor.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;* Sprawdzić jakość dopasowania za pomocą testu χ2. W tym celu należy zaimplementować funkcję obliczającą statystykę testową χ2 zgodnie z wzorem [[File:wzor.png]]&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_2020_Laboratorium_10&amp;diff=2936&amp;oldid=prev</id>
		<title>Lgraczyk at 11:16, 16 May 2022</title>
		<link rel="alternate" type="text/html" href="http://www.if.pw.edu.pl/~lgraczyk/wiki/index.php?title=KADD_2020_Laboratorium_10&amp;diff=2936&amp;oldid=prev"/>
				<updated>2022-05-16T11:16:46Z</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:16, 16 May 2022&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&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;'''Weryfikacja hipotez statystycznych''' (5 pkt.)&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;'''Weryfikacja hipotez statystycznych''' (5 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;Przeprowadzono eksperyment naświetlania wodorowej komory pęcherzykowej wiązką fotonów w celu&amp;nbsp; badania oddziaływań fotonów z protonami&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Fotony powodują powstawanie par elektron&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pozyton, które mogą być wykorzystane do monitorowania wiązki fotonów&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Częstość występowania zdjęć z &lt;/del&gt;0,1,2,... &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;parami elektron&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pozyton powinna podlegać rozkładowi Poissona&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Należy wczytać dane z &lt;/del&gt;[http://www.if.pw.edu.pl/~lgraczyk/KADD2016/lab10/dane10.txt &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pliku&lt;/del&gt;] (&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;w pierwszej kolumnie znajduje się liczba par elektronowych na zdjęciu &lt;/del&gt;&amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;a w drugiej liczba zdjęć zawierających &lt;/del&gt;&amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;par elektronowych&lt;/del&gt;). &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Widzimy, że rozkład ten przypomina rozkład Poissona &lt;/del&gt;- &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;próbujemy zatem obliczyć estymator największej wiarygodności dla parametry rozkładu Poissona &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;patrz &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;Wyklad11&lt;/del&gt;-2019.pdf &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Wykład 11&lt;/del&gt;] &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;slajd 14&lt;/del&gt;) (1 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;The experiment of irradiating a hydrogen bubble chamber with a beam of photons was carried out in order to study the interaction of photons with protons&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Photons create electron&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;positron pairs that can be used to monitor the photon beam&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;The frequency of images with &lt;/ins&gt;0,1,2, ... &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;electron&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;positron pairs should follow the Poisson distribution&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Data should be read from the &lt;/ins&gt;[http://www.if.pw.edu.pl/~lgraczyk/KADD2016/lab10/dane10.txt &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;file&lt;/ins&gt;] (&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the first column shows the number of electron pairs in the image &lt;/ins&gt;&amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;and the second column shows the number of photos containing &lt;/ins&gt;&amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;electron pairs&lt;/ins&gt;). &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;We can see that this distribution resembles the Poisson distribution &lt;/ins&gt;- &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;therefore we are trying to calculate the maximum likelihood estimator for the parameters of the Poisson distribution &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;see&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;Wyklad10&lt;/ins&gt;-2019.pdf &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Lecture 10&lt;/ins&gt;]) (1 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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* Narysować na jednym wykresie punkty pomiarowe i dopasowanie (metodą estymatora największej wiarygodności i funkcją Fit z ROOT'a użytą z parametrami &amp;quot;LR&amp;quot; - dopasowanie metodą największej wiarygodności). Funkcja TF1 do rysowania (i dopasowania ROOT'em) to TMath::PoissonI (1 pkt.)&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;* Narysować na jednym wykresie punkty pomiarowe i dopasowanie (metodą estymatora największej wiarygodności i funkcją Fit z ROOT'a użytą z parametrami &amp;quot;LR&amp;quot; - dopasowanie metodą największej wiarygodności). Funkcja TF1 do rysowania (i dopasowania ROOT'em) to TMath::PoissonI (1 pkt.)&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_2020_Laboratorium_10&amp;diff=2467&amp;oldid=prev</id>
		<title>Lgraczyk: /* Uwagi */</title>
		<link rel="alternate" type="text/html" href="http://www.if.pw.edu.pl/~lgraczyk/wiki/index.php?title=KADD_2020_Laboratorium_10&amp;diff=2467&amp;oldid=prev"/>
				<updated>2020-05-04T14:23:13Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Uwagi&lt;/span&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 14:23, 4 May 2020&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 32:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 32:&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;* Szukanie parametrów metodą największej wiarygodności polega na rozwiązaniu równań wiarygodności, które są niczym innym tylko warunkami koniecznymi na istnienie maksimum funkcji L (zgodnie z analizą matematyczna - liczymy odpowiednie pochodne)&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;* Szukanie parametrów metodą największej wiarygodności polega na rozwiązaniu równań wiarygodności, które są niczym innym tylko warunkami koniecznymi na istnienie maksimum funkcji L (zgodnie z analizą matematyczna - liczymy odpowiednie pochodne)&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;* Dla rozkładu Poissona estymator o najniższej wariancji otrzymany metodą największej wiarygodności wynika z rozwiązania równania wiarygodności (jedno równanie, bo jeden parametr Lambda) - slajd 14 na Wykładzie 11 [http://www.if.pw.edu.pl/~lgraczyk/KADD2019/Wyklad11-2019.pdf link]&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;* Dla rozkładu Poissona estymator o najniższej wariancji otrzymany metodą największej wiarygodności wynika z rozwiązania równania wiarygodności (jedno równanie, bo jeden parametr Lambda) - slajd 14 na Wykładzie 11 [http://www.if.pw.edu.pl/~lgraczyk/KADD2019/Wyklad11-2019.pdf link]&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;* Druga część, po znalezieniu estymatora o &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;najniższej &lt;/del&gt;wiarygodności, polega na przeprowadzeniu testu chi-kwadrat. W tym celu czytamy dokładnie Wykład 11 (zwłaszcza slajdy 7-16) [http://www.if.pw.edu.pl/~lgraczyk/KADD2019/Wyklad11-2019.pdf link].&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;* Druga część, po znalezieniu estymatora o &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;najwyższej &lt;/ins&gt;wiarygodności, polega na przeprowadzeniu testu chi-kwadrat. W tym celu czytamy dokładnie Wykład 11 (zwłaszcza slajdy 7-16) [http://www.if.pw.edu.pl/~lgraczyk/KADD2019/Wyklad11-2019.pdf link].&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;* Na wykresie poniżej (histogram) są dwie linie - niebieska i czerwona. Jedna z nich to dopasowanie dokonane automatycznie funkcją &amp;lt;code&amp;gt;Fit&amp;lt;/code&amp;gt;, druga to ręczne dopasowanie sposeb powyżej.&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;* Na wykresie poniżej (histogram) są dwie linie - niebieska i czerwona. Jedna z nich to dopasowanie dokonane automatycznie funkcją &amp;lt;code&amp;gt;Fit&amp;lt;/code&amp;gt;, druga to ręczne dopasowanie sposeb powyżej.&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;* Do rozkładu Poissona w postaci takich &amp;quot;schodków&amp;quot; stosujemy funkcję &amp;lt;code&amp;gt;TMath::PoissonI&amp;lt;/code&amp;gt; ([https://root.cern.ch/root/html534/TMath.html#TMath:PoissonI link])&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;* Do rozkładu Poissona w postaci takich &amp;quot;schodków&amp;quot; stosujemy funkcję &amp;lt;code&amp;gt;TMath::PoissonI&amp;lt;/code&amp;gt; ([https://root.cern.ch/root/html534/TMath.html#TMath:PoissonI link])&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_2020_Laboratorium_10&amp;diff=2465&amp;oldid=prev</id>
		<title>Lgraczyk: Created page with &quot;== Zadanie == '''Weryfikacja hipotez statystycznych''' (5 pkt.)  * Przeprowadzono eksperyment naświetlania wodorowej komory pęcherzykowej wiązką fotonów w celu  badania oddz...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.if.pw.edu.pl/~lgraczyk/wiki/index.php?title=KADD_2020_Laboratorium_10&amp;diff=2465&amp;oldid=prev"/>
				<updated>2020-05-04T09:24:40Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Zadanie == &amp;#39;&amp;#39;&amp;#39;Weryfikacja hipotez statystycznych&amp;#39;&amp;#39;&amp;#39; (5 pkt.)  * Przeprowadzono eksperyment naświetlania wodorowej komory pęcherzykowej wiązką fotonów w celu  badania oddz...&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;
'''Weryfikacja hipotez statystycznych''' (5 pkt.)&lt;br /&gt;
&lt;br /&gt;
* Przeprowadzono eksperyment naświetlania wodorowej komory pęcherzykowej wiązką fotonów w celu  badania oddziaływań fotonów z protonami. Fotony powodują powstawanie par elektron-pozyton, które mogą być wykorzystane do monitorowania wiązki fotonów. Częstość występowania zdjęć z 0,1,2,... parami elektron-pozyton powinna podlegać rozkładowi Poissona. Należy wczytać dane z [http://www.if.pw.edu.pl/~lgraczyk/KADD2016/lab10/dane10.txt pliku] (w pierwszej kolumnie znajduje się liczba par elektronowych na zdjęciu &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt;, a w drugiej liczba zdjęć zawierających &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; par elektronowych). Widzimy, że rozkład ten przypomina rozkład Poissona - próbujemy zatem obliczyć estymator największej wiarygodności dla parametry rozkładu Poissona (patrz [http://www.if.pw.edu.pl/~lgraczyk/KADD2019/Wyklad11-2019.pdf Wykład 11] slajd 14) (1 pkt.)&lt;br /&gt;
&lt;br /&gt;
* Narysować na jednym wykresie punkty pomiarowe i dopasowanie (metodą estymatora największej wiarygodności i funkcją Fit z ROOT'a użytą z parametrami &amp;quot;LR&amp;quot; - dopasowanie metodą największej wiarygodności). Funkcja TF1 do rysowania (i dopasowania ROOT'em) to TMath::PoissonI (1 pkt.)&lt;br /&gt;
&lt;br /&gt;
* Sprawdzić jakość dopasowania za pomocą testu χ2. W tym celu należy zaimplementować funkcję obliczającą statystykę testową χ2 zgodnie z wzorem [[File:wzor.png]]&lt;br /&gt;
gdzie: nk - liczba obserwacji w k-tym binie, npk - przewidywana przez teorię liczba przypadków w k-tym binie tj.:&lt;br /&gt;
&lt;br /&gt;
 // h - histogram danych&lt;br /&gt;
 // g - przewidywanie &amp;quot;teoretyczne&amp;quot;&lt;br /&gt;
 double chi2(TH1D *h, TF1 *f);&lt;br /&gt;
&lt;br /&gt;
* Okreslić liczbę stopni swobody i obliczyć wartość statystyki testowej. (1 pkt.)&lt;br /&gt;
&lt;br /&gt;
* Zaimplementować funkcję zwracającą wynik testu χ2 na zadanym poziomie istotności α tj.:&lt;br /&gt;
 // true - brak podstaw do odrzucenia hipotezy&lt;br /&gt;
 // false - sa podstawy do odrzucenia hipotezy&lt;br /&gt;
 // Parametry:&lt;br /&gt;
 // T - wartosc statystyki testowej chi2&lt;br /&gt;
 // alpha - poziom istotnosci&lt;br /&gt;
 // ndf - liczba stopni swobody rozkladu chi2&lt;br /&gt;
 bool testChi2(double T, double alpha, int ndf);&lt;br /&gt;
&lt;br /&gt;
Wykorzystując zaimplementowaną funkcję zweryfikować hipotezę mówiacą, że dane pomiarowe podlegają rozkładowi Poissona. Dobrać odpowiednią wartość poziomu istotności. Uwaga! Kwanyl możemy odczytać z policzonej na ostatnich zajęciach dystrybuanty. (2 pkt.)&lt;br /&gt;
&lt;br /&gt;
== Uwagi ==&lt;br /&gt;
* Nasze zadanie to '''ręczne''' przeprowadzenie czynności wykonywanych automatycznie przez funkcję &amp;lt;code&amp;gt;Fit&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Zadanie zawiera w sobie dwie części: wyznaczenie parametru rozkładu Poissona '''metodą największej wiarygodności''' (maximum likelihood), szukając '''estymatora o najniższej wariancji'''. Czytamy zatem: Wykład 9 [http://www.if.pw.edu.pl/~lgraczyk/KADD2019/Wyklad9-2019.pdf link] - o metodzie największej wiarygodności, od początku do slajdu 24 (to są części teoretyczne z wyprowadzeniami), dalej Wykład 10 [http://www.if.pw.edu.pl/~lgraczyk/KADD2019/Wyklad10-2019.pdf link]&lt;br /&gt;
* Funkcja wiarygodności to ogólnie rzecz biorąc funkcja rozkładu prawdopodobieństwa dla '''parametrów''' badanego rozkładu, okreslana na podstawie próby losowej (jeżeli badamy np. rozkład wzrostu Polaków f(x), gdzie X to zmienna losowa okreslająca wzrost Polaków, np. rozkład Gaussa o dwóch parametrach (średnia, odchylenie), to L będzie funkcją wiarygodności, rozkładem prawdopodobieństwa parametrów średniej i odchylenia -&amp;gt; szukamy maksimum funkcji L, które da nam najbardziej wiarygodne wartości parametrów średnia i odchylenie funkcji f(x))&lt;br /&gt;
* Szukanie parametrów metodą największej wiarygodności polega na rozwiązaniu równań wiarygodności, które są niczym innym tylko warunkami koniecznymi na istnienie maksimum funkcji L (zgodnie z analizą matematyczna - liczymy odpowiednie pochodne)&lt;br /&gt;
* Dla rozkładu Poissona estymator o najniższej wariancji otrzymany metodą największej wiarygodności wynika z rozwiązania równania wiarygodności (jedno równanie, bo jeden parametr Lambda) - slajd 14 na Wykładzie 11 [http://www.if.pw.edu.pl/~lgraczyk/KADD2019/Wyklad11-2019.pdf link]&lt;br /&gt;
* Druga część, po znalezieniu estymatora o najniższej wiarygodności, polega na przeprowadzeniu testu chi-kwadrat. W tym celu czytamy dokładnie Wykład 11 (zwłaszcza slajdy 7-16) [http://www.if.pw.edu.pl/~lgraczyk/KADD2019/Wyklad11-2019.pdf link].&lt;br /&gt;
* Na wykresie poniżej (histogram) są dwie linie - niebieska i czerwona. Jedna z nich to dopasowanie dokonane automatycznie funkcją &amp;lt;code&amp;gt;Fit&amp;lt;/code&amp;gt;, druga to ręczne dopasowanie sposeb powyżej.&lt;br /&gt;
* Do rozkładu Poissona w postaci takich &amp;quot;schodków&amp;quot; stosujemy funkcję &amp;lt;code&amp;gt;TMath::PoissonI&amp;lt;/code&amp;gt; ([https://root.cern.ch/root/html534/TMath.html#TMath:PoissonI link])&lt;br /&gt;
* Kwantyl rozkładu chi-kwadrat o odpowiedniej liczbie stopni swobody do wykonania testu możemy odczytać z '''Zadania 9''' (poprzednie zajęcia) - po to żeśmy te rozkłady chi-kwadrat rysowali.&lt;br /&gt;
&lt;br /&gt;
== Wynik ==&lt;br /&gt;
&lt;br /&gt;
[[File:Lab10_2.png]]&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
 FCN=5.75356 FROM MIGRAD    STATUS=CONVERGED      29 CALLS          30 TOTAL&lt;br /&gt;
                     EDM=5.17016e-07    STRATEGY= 1      ERROR MATRIX ACCURATE &lt;br /&gt;
  EXT PARAMETER                                   STEP         FIRST   &lt;br /&gt;
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE &lt;br /&gt;
   1  p0           3.55268e+02   1.88558e+01   3.25727e-02   3.68816e-05&lt;br /&gt;
   2  p1           2.33737e+00   8.17264e-02   1.40382e-04  -2.26405e-03&lt;br /&gt;
                               ERR DEF= 0.5&lt;br /&gt;
 &lt;br /&gt;
 Lambda najwiekszej wiarygodnosci: 2.33239&lt;br /&gt;
 Lambda (ROOT Fit): 2.33737&lt;br /&gt;
 chi2 (wartosc statystyki testowej T): 10.5336&lt;br /&gt;
 chi2/NDF: 1.7556&lt;br /&gt;
 chi2 (ROOT Fit): 9.85507&lt;br /&gt;
 chi2 (ROOT Fit)/NDF: 1.40787&lt;br /&gt;
 Poziom istotnosci alpha: 0.01&lt;br /&gt;
 Wynik testu: nie ma podstaw do odrzucenia hipotezy&lt;/div&gt;</summary>
		<author><name>Lgraczyk</name></author>	</entry>

	</feed>