diff --git a/doc/pub/Regression/html/._Regression-bs000.html b/doc/pub/Regression/html/._Regression-bs000.html index f6d791827..f26327baa 100644 --- a/doc/pub/Regression/html/._Regression-bs000.html +++ b/doc/pub/Regression/html/._Regression-bs000.html @@ -72,7 +72,13 @@ Automatically generated HTML file from DocOnce source 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -87,8 +93,8 @@ MathJax.Hub.Config({ } }); - @@ -121,7 +127,13 @@ MathJax.Hub.Config({
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • -
  • The singular value decompostion
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The singular value decompostion
  • @@ -156,7 +168,7 @@ MathJax.Hub.Config({
    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

    -

    Oct 18, 2017

    +

    Oct 24, 2017


    @@ -180,7 +192,7 @@ MathJax.Hub.Config({

  • 9
  • 10
  • ...
  • -
  • 13
  • +
  • 19
  • »
  • diff --git a/doc/pub/Regression/html/._Regression-bs001.html b/doc/pub/Regression/html/._Regression-bs001.html index a643b5a5d..12e540f11 100644 --- a/doc/pub/Regression/html/._Regression-bs001.html +++ b/doc/pub/Regression/html/._Regression-bs001.html @@ -72,7 +72,13 @@ Automatically generated HTML file from DocOnce source 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -87,8 +93,8 @@ MathJax.Hub.Config({ } }); - @@ -121,7 +127,13 @@ MathJax.Hub.Config({
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • -
  • The singular value decompostion
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The singular value decompostion
  • @@ -177,7 +189,7 @@ A regression model aims at finding a likelihood function \( p(y\vert \hat{x}) \)
  • 10
  • 11
  • ...
  • -
  • 13
  • +
  • 19
  • »
  • diff --git a/doc/pub/Regression/html/._Regression-bs002.html b/doc/pub/Regression/html/._Regression-bs002.html index 4eedbb6db..1089f3fad 100644 --- a/doc/pub/Regression/html/._Regression-bs002.html +++ b/doc/pub/Regression/html/._Regression-bs002.html @@ -72,7 +72,13 @@ Automatically generated HTML file from DocOnce source 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -87,8 +93,8 @@ MathJax.Hub.Config({ } }); - @@ -121,7 +127,13 @@ MathJax.Hub.Config({
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • -
  • The singular value decompostion
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The singular value decompostion
  • @@ -174,7 +186,7 @@ where \( \epsilon_i \) is the error in our approximation.
  • 11
  • 12
  • ...
  • -
  • 13
  • +
  • 19
  • »
  • diff --git a/doc/pub/Regression/html/._Regression-bs003.html b/doc/pub/Regression/html/._Regression-bs003.html index 387b742ac..4e884bbec 100644 --- a/doc/pub/Regression/html/._Regression-bs003.html +++ b/doc/pub/Regression/html/._Regression-bs003.html @@ -72,7 +72,13 @@ Automatically generated HTML file from DocOnce source 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -87,8 +93,8 @@ MathJax.Hub.Config({ } }); - @@ -121,7 +127,13 @@ MathJax.Hub.Config({
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • -
  • The singular value decompostion
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The singular value decompostion
  • @@ -173,6 +185,8 @@ $$
  • 11
  • 12
  • 13
  • +
  • ...
  • +
  • 19
  • »
  • diff --git a/doc/pub/Regression/html/._Regression-bs004.html b/doc/pub/Regression/html/._Regression-bs004.html index 0972e1cf3..6e8d158aa 100644 --- a/doc/pub/Regression/html/._Regression-bs004.html +++ b/doc/pub/Regression/html/._Regression-bs004.html @@ -72,7 +72,13 @@ Automatically generated HTML file from DocOnce source 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -87,8 +93,8 @@ MathJax.Hub.Config({ } }); - @@ -121,7 +127,13 @@ MathJax.Hub.Config({
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • -
  • The singular value decompostion
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The singular value decompostion
  • @@ -192,6 +204,9 @@ $$
  • 11
  • 12
  • 13
  • +
  • 14
  • +
  • ...
  • +
  • 19
  • »
  • diff --git a/doc/pub/Regression/html/._Regression-bs005.html b/doc/pub/Regression/html/._Regression-bs005.html index 02320bb49..00e069e82 100644 --- a/doc/pub/Regression/html/._Regression-bs005.html +++ b/doc/pub/Regression/html/._Regression-bs005.html @@ -72,7 +72,13 @@ Automatically generated HTML file from DocOnce source 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -87,8 +93,8 @@ MathJax.Hub.Config({ } }); - @@ -121,7 +127,13 @@ MathJax.Hub.Config({
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • -
  • The singular value decompostion
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The singular value decompostion
  • @@ -176,6 +188,10 @@ $$
  • 11
  • 12
  • 13
  • +
  • 14
  • +
  • 15
  • +
  • ...
  • +
  • 19
  • »
  • diff --git a/doc/pub/Regression/html/._Regression-bs006.html b/doc/pub/Regression/html/._Regression-bs006.html index e739dd269..ac4176515 100644 --- a/doc/pub/Regression/html/._Regression-bs006.html +++ b/doc/pub/Regression/html/._Regression-bs006.html @@ -72,7 +72,13 @@ Automatically generated HTML file from DocOnce source 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -87,8 +93,8 @@ MathJax.Hub.Config({ } }); - @@ -121,7 +127,13 @@ MathJax.Hub.Config({
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • -
  • The singular value decompostion
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The singular value decompostion
  • @@ -181,6 +193,11 @@ The left-hand side of this equation forms know. Our error vector \( \hat{\epsilo
  • 11
  • 12
  • 13
  • +
  • 14
  • +
  • 15
  • +
  • 16
  • +
  • ...
  • +
  • 19
  • »
  • diff --git a/doc/pub/Regression/html/._Regression-bs007.html b/doc/pub/Regression/html/._Regression-bs007.html index 385e48a2e..6af425469 100644 --- a/doc/pub/Regression/html/._Regression-bs007.html +++ b/doc/pub/Regression/html/._Regression-bs007.html @@ -72,7 +72,13 @@ Automatically generated HTML file from DocOnce source 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -87,8 +93,8 @@ MathJax.Hub.Config({ } }); - @@ -121,7 +127,13 @@ MathJax.Hub.Config({
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • -
  • The singular value decompostion
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The singular value decompostion
  • @@ -175,6 +187,12 @@ $$
  • 11
  • 12
  • 13
  • +
  • 14
  • +
  • 15
  • +
  • 16
  • +
  • 17
  • +
  • ...
  • +
  • 19
  • »
  • diff --git a/doc/pub/Regression/html/._Regression-bs008.html b/doc/pub/Regression/html/._Regression-bs008.html index 7f5eb964c..de8ef0d4f 100644 --- a/doc/pub/Regression/html/._Regression-bs008.html +++ b/doc/pub/Regression/html/._Regression-bs008.html @@ -72,7 +72,13 @@ Automatically generated HTML file from DocOnce source 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -87,8 +93,8 @@ MathJax.Hub.Config({ } }); - @@ -121,7 +127,13 @@ MathJax.Hub.Config({
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • -
  • The singular value decompostion
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The singular value decompostion
  • @@ -177,6 +189,13 @@ $$
  • 11
  • 12
  • 13
  • +
  • 14
  • +
  • 15
  • +
  • 16
  • +
  • 17
  • +
  • 18
  • +
  • ...
  • +
  • 19
  • »
  • diff --git a/doc/pub/Regression/html/._Regression-bs009.html b/doc/pub/Regression/html/._Regression-bs009.html index 8ef81bf1f..ba39d1674 100644 --- a/doc/pub/Regression/html/._Regression-bs009.html +++ b/doc/pub/Regression/html/._Regression-bs009.html @@ -72,7 +72,13 @@ Automatically generated HTML file from DocOnce source 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -87,8 +93,8 @@ MathJax.Hub.Config({ } }); - @@ -121,7 +127,13 @@ MathJax.Hub.Config({
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • -
  • The singular value decompostion
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The singular value decompostion
  • @@ -156,12 +168,12 @@ where \( \langle y_i \rangle \) is the mean value. Keep in mind also that till n

    In order to find the parameters \( \beta_i \) we will then minimize the spread of \( Q(\hat{\beta}) \) by requiring $$ -\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(y_i-\beta_0x_{i,0}+\beta_1x_{i,1}+\beta_2x_{i,2}+\dots+\beta_{n-1}x_{i,n-1}\right)^2\right]=0, +\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}\right)^2\right]=0, $$ which results in $$ -\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}x_{ij}\left(y_i-\beta_0x_{i,0}+\beta_1x_{i,1}+\beta_2x_{i,2}+\dots+\beta_{n-1}x_{i,n-1}\right)\right]=0, +\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}x_{ij}\left(y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}\right)\right]=0, $$ or in a matrix-vector form as @@ -192,6 +204,12 @@ $$

  • 11
  • 12
  • 13
  • +
  • 14
  • +
  • 15
  • +
  • 16
  • +
  • 17
  • +
  • 18
  • +
  • 19
  • »
  • diff --git a/doc/pub/Regression/html/._Regression-bs010.html b/doc/pub/Regression/html/._Regression-bs010.html index 69a8a9421..0358670d0 100644 --- a/doc/pub/Regression/html/._Regression-bs010.html +++ b/doc/pub/Regression/html/._Regression-bs010.html @@ -72,7 +72,13 @@ Automatically generated HTML file from DocOnce source 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -87,8 +93,8 @@ MathJax.Hub.Config({ } }); - @@ -121,7 +127,13 @@ MathJax.Hub.Config({
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • -
  • The singular value decompostion
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The singular value decompostion
  • @@ -179,6 +191,12 @@ $$
  • 11
  • 12
  • 13
  • +
  • 14
  • +
  • 15
  • +
  • 16
  • +
  • 17
  • +
  • 18
  • +
  • 19
  • »
  • diff --git a/doc/pub/Regression/html/._Regression-bs011.html b/doc/pub/Regression/html/._Regression-bs011.html index aea195600..2071ec61d 100644 --- a/doc/pub/Regression/html/._Regression-bs011.html +++ b/doc/pub/Regression/html/._Regression-bs011.html @@ -72,7 +72,13 @@ Automatically generated HTML file from DocOnce source 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -87,8 +93,8 @@ MathJax.Hub.Config({ } }); - @@ -121,7 +127,13 @@ MathJax.Hub.Config({
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • -
  • The singular value decompostion
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The singular value decompostion
  • @@ -180,6 +192,12 @@ meaning that the solution for \( \hat{\beta} \) is the one which minimizes the r
  • 11
  • 12
  • 13
  • +
  • 14
  • +
  • 15
  • +
  • 16
  • +
  • 17
  • +
  • 18
  • +
  • 19
  • »
  • diff --git a/doc/pub/Regression/html/._Regression-bs012.html b/doc/pub/Regression/html/._Regression-bs012.html index 86235fbd5..8309bbc13 100644 --- a/doc/pub/Regression/html/._Regression-bs012.html +++ b/doc/pub/Regression/html/._Regression-bs012.html @@ -72,7 +72,13 @@ Automatically generated HTML file from DocOnce source 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -87,8 +93,8 @@ MathJax.Hub.Config({ } }); - @@ -121,7 +127,13 @@ MathJax.Hub.Config({
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • -
  • The singular value decompostion
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The singular value decompostion
  • @@ -137,20 +149,28 @@ MathJax.Hub.Config({ -

    The singular value decompostion

    +

    The \( \chi^2 \) function

    -How can we use the singular value decomposition to find the parameters \( \beta_j \)? More details will come. We first note that a general \( m\times n \) matrix \( \hat{A} \) can be written in terms of a diagonal matrix \( \hat{\Sigma} \) of dimensionality \( n\times n \) and two orthognal matrices \( \hat{U} \) and \( \hat{V} \), where the first has dimensionality \( m \times n \) and the last dimensionality \( n\times n \). We have then + +

    +Normally, the response (dependent or outcome) variable \( y_i \) the outcome of a numerical experiment or another type of experiment and is thus only an approximation to the true value. It is then always accompanied by an error estimate, often limited to a statistical error estimate given by the standard deviation discussed earlier. In the discussion here we will treat \( y_i \) as our exact value for the response variable. + +

    +Introducing the standard deviation \( \sigma_i \) for each measurement \( y_i \), we define now the \( \chi^2 \) function as $$ -\hat{A} = \hat{U}\hat{\Sigma}\hat{V} +\chi^2(\hat{\beta})=\sum_{i=0}^{n-1}\frac{\left(y_i-\tilde{y}_i\right)^2}{\sigma_i^2}=\left(\hat{y}-\hat{\tilde{y}}\right)^T\frac{1}{\hat{\Sigma^2}}\left(\hat{y}-\hat{\tilde{y}}\right), $$ + +where the matrix \( \hat{\Sigma} \) is a diagonal matrix with \( \sigma_i \) as matrix elements. + +

    -

    diff --git a/doc/pub/Regression/html/._Regression-bs013.html b/doc/pub/Regression/html/._Regression-bs013.html new file mode 100644 index 000000000..7d35cf836 --- /dev/null +++ b/doc/pub/Regression/html/._Regression-bs013.html @@ -0,0 +1,223 @@ + + + + + + + +Data Analysis and Machine Learning: Linear Regression and more Advanced Regression Analysis + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The \( \chi^2 \) function

    +
    +
    +

    + +

    +In order to find the parameters \( \beta_i \) we will then minimize the spread of \( \chi^2(\hat{\beta}) \) by requiring +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(\frac{y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}}{\sigma_i}\right)^2\right]=0, +$$ + +which results in +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}\frac{x_{ij}}{\sigma_i}\left(\frac{y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}}{\sigma_i}\right)\right]=0, +$$ + +or in a matrix-vector form as +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \hat{\beta}} = 0 = \hat{A}^T\left( \hat{b}-\hat{A}\hat{\beta}\right). +$$ + +where we have defined the matrix \( \hat{A} =\hat{X}/\hat{\Sigma} \) with matrix elements \( a_{ij} = x_{ij}/\sigma_i \) and the vector \( \hat{b} \) with elements \( b_i = y_i/\sigma_i \). +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/pub/Regression/html/._Regression-bs014.html b/doc/pub/Regression/html/._Regression-bs014.html new file mode 100644 index 000000000..8398bdffa --- /dev/null +++ b/doc/pub/Regression/html/._Regression-bs014.html @@ -0,0 +1,220 @@ + + + + + + + +Data Analysis and Machine Learning: Linear Regression and more Advanced Regression Analysis + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The \( \chi^2 \) function

    +
    +
    +

    + +

    +We can rewrite +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \hat{\beta}} = 0 = \hat{A}^T\left( \hat{b}-\hat{A}\hat{\beta}\right), +$$ + +as +$$ +\hat{A}^T\hat{b} = \hat{A}^T\hat{A}\hat{\beta}, +$$ + +and if the matrix \( \hat{A}^T\hat{A} \) is invertible we have the solution +$$ +\hat{\beta} =\left(\hat{A}^T\hat{A}\right)^{-1}\hat{A}^T\hat{b}. +$$ +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/pub/Regression/html/._Regression-bs015.html b/doc/pub/Regression/html/._Regression-bs015.html new file mode 100644 index 000000000..9a9b947e1 --- /dev/null +++ b/doc/pub/Regression/html/._Regression-bs015.html @@ -0,0 +1,224 @@ + + + + + + + +Data Analysis and Machine Learning: Linear Regression and more Advanced Regression Analysis + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The \( \chi^2 \) function

    +
    +
    +

    + +

    +If we then introduce the matrix +$$ +\hat{H} = \hat{A}^T\hat{A}, +$$ + +we have then the following expression for the parameters \( \beta_j \) (the matrix elements of \( \hat{H} \) are \( h_{ij} \)) +$$ +\beta_j = \sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}\frac{y_i}{\sigma_i}\frac{x_{ik}}{\sigma_i} = \sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}b_ia_{ik} +$$ + +We state without proof the expression for the uncertainty in the parameters \( \beta_j \) as +$$ +\sigma^2(\beta_j) = \sum_{i=0}^{n-1}\sigma_i^2\left( \frac{\partial \beta_j}{\partial y_i}\right)^2, +$$ + +resulting in +$$ +\sigma^2(\beta_j) = \left(\sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}a_{ik}\right)\left(\sum_{l=0}^{p-1}h_{jl}\sum_{m=0}^{n-1}a_{ml}\right) = h_{jj}! +$$ +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/pub/Regression/html/._Regression-bs016.html b/doc/pub/Regression/html/._Regression-bs016.html new file mode 100644 index 000000000..741ec340c --- /dev/null +++ b/doc/pub/Regression/html/._Regression-bs016.html @@ -0,0 +1,216 @@ + + + + + + + +Data Analysis and Machine Learning: Linear Regression and more Advanced Regression Analysis + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The \( \chi^2 \) function

    +
    +
    +

    +The first step here is to approximate the function \( y \) with a first-order polynomial, that is we write +$$ +y=y(x) \rightarrow y(x_i) \approx \beta_0+\beta_1 x_i. +$$ + +By computing the derivatives of \( \chi^2 \) with respect to \( \beta_0 \) and \( \beta_1 \) show that these are given by +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_0} = -2\left[ \sum_{i=0}^{1}\left(\frac{y_i-\beta_0-\beta_1x_{i}}{\sigma_i^2}\right)\right]=0, +$$ + +and +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_0} = -2\left[ \sum_{i=0}^{1}x_i\left(\frac{y_i-\beta_0-\beta_1x_{i}}{\sigma_i^2}\right)\right]=0. +$$ +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/pub/Regression/html/._Regression-bs017.html b/doc/pub/Regression/html/._Regression-bs017.html new file mode 100644 index 000000000..f66f408e2 --- /dev/null +++ b/doc/pub/Regression/html/._Regression-bs017.html @@ -0,0 +1,236 @@ + + + + + + + +Data Analysis and Machine Learning: Linear Regression and more Advanced Regression Analysis + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The \( \chi^2 \) function

    +
    +
    +

    + +

    +We define then +$$ +\gamma = \sum_{i=0}^{1}\frac{1}{\sigma_i^2}, +$$ + + +$$ +\gamma_x = \sum_{i=0}^{1}\frac{x_{i}}{\sigma_i^2}, +$$ + +$$ +\gamma_y = \sum_{i=0}^{1}\left(\frac{y_i}{\sigma_i^2}\right), +$$ + +$$ +\gamma_{xx} = \sum_{i=0}^{1}\frac{x_ix_{i}}{\sigma_i^2}, +$$ + +$$ +\gamma_{xy} = \sum_{i=0}^{1}\frac{y_ix_{i}}{\sigma_i^2}, +$$ + +and show that +$$ +\beta_0 = \frac{\gamma_{xx}\gamma_y-\gamma_x\gamma_y}{\gamma\gamma_{xx}-\gamma_x^2}, +$$ + +$$ +\beta_1 = \frac{\gamma_{xy}\gamma-\gamma_x\gamma_y}{\gamma\gamma_{xx}-\gamma_x^2}. +$$ + +

    +The LSM suffers often from both being underdetermined and overdetermined in the unknown coefficients \( \beta_i \). A better approach is to use the Singular Value Decomposition (SVD) method discussed below. +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/pub/Regression/html/._Regression-bs018.html b/doc/pub/Regression/html/._Regression-bs018.html new file mode 100644 index 000000000..51bbfd9b7 --- /dev/null +++ b/doc/pub/Regression/html/._Regression-bs018.html @@ -0,0 +1,204 @@ + + + + + + + +Data Analysis and Machine Learning: Linear Regression and more Advanced Regression Analysis + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The singular value decompostion

    +
    +
    +

    +How can we use the singular value decomposition to find the parameters \( \beta_j \)? More details will come. We first note that a general \( m\times n \) matrix \( \hat{A} \) can be written in terms of a diagonal matrix \( \hat{\Sigma} \) of dimensionality \( n\times n \) and two orthognal matrices \( \hat{U} \) and \( \hat{V} \), where the first has dimensionality \( m \times n \) and the last dimensionality \( n\times n \). We have then +$$ +\hat{A} = \hat{U}\hat{\Sigma}\hat{V} +$$ +

    +
    + + +

    + +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/pub/Regression/html/Regression-bs.html b/doc/pub/Regression/html/Regression-bs.html index f6d791827..f26327baa 100644 --- a/doc/pub/Regression/html/Regression-bs.html +++ b/doc/pub/Regression/html/Regression-bs.html @@ -72,7 +72,13 @@ Automatically generated HTML file from DocOnce source 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -87,8 +93,8 @@ MathJax.Hub.Config({ } }); - @@ -121,7 +127,13 @@ MathJax.Hub.Config({
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • Interpretations and optimizing our parameters
  • -
  • The singular value decompostion
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The \( \chi^2 \) function
  • +
  • The singular value decompostion
  • @@ -156,7 +168,7 @@ MathJax.Hub.Config({
    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

    -

    Oct 18, 2017

    +

    Oct 24, 2017


    @@ -180,7 +192,7 @@ MathJax.Hub.Config({

  • 9
  • 10
  • ...
  • -
  • 13
  • +
  • 19
  • »
  • diff --git a/doc/pub/Regression/html/Regression-reveal.html b/doc/pub/Regression/html/Regression-reveal.html index cc823ffb0..ac7dfe2ac 100644 --- a/doc/pub/Regression/html/Regression-reveal.html +++ b/doc/pub/Regression/html/Regression-reveal.html @@ -1,4 +1,3 @@ -\ @@ -117,8 +116,8 @@ MathJax.Hub.Config({ } }); - @@ -148,7 +147,7 @@ MathJax.Hub.Config({
    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

     
    -

    Oct 18, 2017

    +

    Oct 24, 2017


    @@ -404,14 +403,14 @@ where \( \langle y_i \rangle \) is the mean value. Keep in mind also that till n In order to find the parameters \( \beta_i \) we will then minimize the spread of \( Q(\hat{\beta}) \) by requiring

     
    $$ -\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(y_i-\beta_0x_{i,0}+\beta_1x_{i,1}+\beta_2x_{i,2}+\dots+\beta_{n-1}x_{i,n-1}\right)^2\right]=0, +\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}\right)^2\right]=0, $$

     
    which results in

     
    $$ -\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}x_{ij}\left(y_i-\beta_0x_{i,0}+\beta_1x_{i,1}+\beta_2x_{i,2}+\dots+\beta_{n-1}x_{i,n-1}\right)\right]=0, +\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}x_{ij}\left(y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}\right)\right]=0, $$

     
    @@ -492,7 +491,210 @@ meaning that the solution for \( \hat{\beta} \) is the one which minimizes the r

    -

    The singular value decompostion

    +

    The \( \chi^2 \) function

    +
    + +

    +Normally, the response (dependent or outcome) variable \( y_i \) the outcome of a numerical experiment or another type of experiment and is thus only an approximation to the true value. It is then always accompanied by an error estimate, often limited to a statistical error estimate given by the standard deviation discussed earlier. In the discussion here we will treat \( y_i \) as our exact value for the response variable. + +

    +Introducing the standard deviation \( \sigma_i \) for each measurement \( y_i \), we define now the \( \chi^2 \) function as + +

     
    +$$ +\chi^2(\hat{\beta})=\sum_{i=0}^{n-1}\frac{\left(y_i-\tilde{y}_i\right)^2}{\sigma_i^2}=\left(\hat{y}-\hat{\tilde{y}}\right)^T\frac{1}{\hat{\Sigma^2}}\left(\hat{y}-\hat{\tilde{y}}\right), +$$ +

     
    + +where the matrix \( \hat{\Sigma} \) is a diagonal matrix with \( \sigma_i \) as matrix elements. + + +

    +
    + + +
    +

    The \( \chi^2 \) function

    +
    + +

    +In order to find the parameters \( \beta_i \) we will then minimize the spread of \( \chi^2(\hat{\beta}) \) by requiring +

     
    +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(\frac{y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}}{\sigma_i}\right)^2\right]=0, +$$ +

     
    + +which results in +

     
    +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}\frac{x_{ij}}{\sigma_i}\left(\frac{y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}}{\sigma_i}\right)\right]=0, +$$ +

     
    + +or in a matrix-vector form as +

     
    +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \hat{\beta}} = 0 = \hat{A}^T\left( \hat{b}-\hat{A}\hat{\beta}\right). +$$ +

     
    + +where we have defined the matrix \( \hat{A} =\hat{X}/\hat{\Sigma} \) with matrix elements \( a_{ij} = x_{ij}/\sigma_i \) and the vector \( \hat{b} \) with elements \( b_i = y_i/\sigma_i \). +

    +
    + + +
    +

    The \( \chi^2 \) function

    +
    + +

    +We can rewrite +

     
    +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \hat{\beta}} = 0 = \hat{A}^T\left( \hat{b}-\hat{A}\hat{\beta}\right), +$$ +

     
    + +as +

     
    +$$ +\hat{A}^T\hat{b} = \hat{A}^T\hat{A}\hat{\beta}, +$$ +

     
    + +and if the matrix \( \hat{A}^T\hat{A} \) is invertible we have the solution +

     
    +$$ +\hat{\beta} =\left(\hat{A}^T\hat{A}\right)^{-1}\hat{A}^T\hat{b}. +$$ +

     
    +

    +
    + + +
    +

    The \( \chi^2 \) function

    +
    + +

    +If we then introduce the matrix +

     
    +$$ +\hat{H} = \hat{A}^T\hat{A}, +$$ +

     
    + +we have then the following expression for the parameters \( \beta_j \) (the matrix elements of \( \hat{H} \) are \( h_{ij} \)) +

     
    +$$ +\beta_j = \sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}\frac{y_i}{\sigma_i}\frac{x_{ik}}{\sigma_i} = \sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}b_ia_{ik} +$$ +

     
    + +We state without proof the expression for the uncertainty in the parameters \( \beta_j \) as +

     
    +$$ +\sigma^2(\beta_j) = \sum_{i=0}^{n-1}\sigma_i^2\left( \frac{\partial \beta_j}{\partial y_i}\right)^2, +$$ +

     
    + +resulting in +

     
    +$$ +\sigma^2(\beta_j) = \left(\sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}a_{ik}\right)\left(\sum_{l=0}^{p-1}h_{jl}\sum_{m=0}^{n-1}a_{ml}\right) = h_{jj}! +$$ +

     
    +

    +
    + + +
    +

    The \( \chi^2 \) function

    +
    + +

    +The first step here is to approximate the function \( y \) with a first-order polynomial, that is we write +

     
    +$$ +y=y(x) \rightarrow y(x_i) \approx \beta_0+\beta_1 x_i. +$$ +

     
    + +By computing the derivatives of \( \chi^2 \) with respect to \( \beta_0 \) and \( \beta_1 \) show that these are given by +

     
    +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_0} = -2\left[ \sum_{i=0}^{1}\left(\frac{y_i-\beta_0-\beta_1x_{i}}{\sigma_i^2}\right)\right]=0, +$$ +

     
    + +and +

     
    +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_0} = -2\left[ \sum_{i=0}^{1}x_i\left(\frac{y_i-\beta_0-\beta_1x_{i}}{\sigma_i^2}\right)\right]=0. +$$ +

     
    +

    +
    + + +
    +

    The \( \chi^2 \) function

    +
    + +

    +We define then +

     
    +$$ +\gamma = \sum_{i=0}^{1}\frac{1}{\sigma_i^2}, +$$ +

     
    + +

     
    +$$ +\gamma_x = \sum_{i=0}^{1}\frac{x_{i}}{\sigma_i^2}, +$$ +

     
    + +

     
    +$$ +\gamma_y = \sum_{i=0}^{1}\left(\frac{y_i}{\sigma_i^2}\right), +$$ +

     
    + +

     
    +$$ +\gamma_{xx} = \sum_{i=0}^{1}\frac{x_ix_{i}}{\sigma_i^2}, +$$ +

     
    + +

     
    +$$ +\gamma_{xy} = \sum_{i=0}^{1}\frac{y_ix_{i}}{\sigma_i^2}, +$$ +

     
    + +and show that +

     
    +$$ +\beta_0 = \frac{\gamma_{xx}\gamma_y-\gamma_x\gamma_y}{\gamma\gamma_{xx}-\gamma_x^2}, +$$ +

     
    + +

     
    +$$ +\beta_1 = \frac{\gamma_{xy}\gamma-\gamma_x\gamma_y}{\gamma\gamma_{xx}-\gamma_x^2}. +$$ +

     
    + +

    +The LSM suffers often from both being underdetermined and overdetermined in the unknown coefficients \( \beta_i \). A better approach is to use the Singular Value Decomposition (SVD) method discussed below. +

    +
    + + +
    +

    The singular value decompostion

    diff --git a/doc/pub/Regression/html/Regression-solarized.html b/doc/pub/Regression/html/Regression-solarized.html index f72b8d2f1..1c426581d 100644 --- a/doc/pub/Regression/html/Regression-solarized.html +++ b/doc/pub/Regression/html/Regression-solarized.html @@ -92,7 +92,13 @@ div { text-align: justify; text-justify: inter-word; } 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -107,8 +113,8 @@ MathJax.Hub.Config({ } }); - @@ -134,7 +140,7 @@ MathJax.Hub.Config({

    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

    -

    Oct 18, 2017

    +

    Oct 24, 2017












    @@ -360,12 +366,12 @@ where \( \langle y_i \rangle \) is the mean value. Keep in mind also that till n

    In order to find the parameters \( \beta_i \) we will then minimize the spread of \( Q(\hat{\beta}) \) by requiring $$ -\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(y_i-\beta_0x_{i,0}+\beta_1x_{i,1}+\beta_2x_{i,2}+\dots+\beta_{n-1}x_{i,n-1}\right)^2\right]=0, +\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}\right)^2\right]=0, $$ which results in $$ -\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}x_{ij}\left(y_i-\beta_0x_{i,0}+\beta_1x_{i,1}+\beta_2x_{i,2}+\dots+\beta_{n-1}x_{i,n-1}\right)\right]=0, +\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}x_{ij}\left(y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}\right)\right]=0, $$ or in a matrix-vector form as @@ -434,7 +440,184 @@ meaning that the solution for \( \hat{\beta} \) is the one which minimizes the r











    -

    The singular value decompostion

    +

    The \( \chi^2 \) function

    +
    + +

    + +

    +Normally, the response (dependent or outcome) variable \( y_i \) the outcome of a numerical experiment or another type of experiment and is thus only an approximation to the true value. It is then always accompanied by an error estimate, often limited to a statistical error estimate given by the standard deviation discussed earlier. In the discussion here we will treat \( y_i \) as our exact value for the response variable. + +

    +Introducing the standard deviation \( \sigma_i \) for each measurement \( y_i \), we define now the \( \chi^2 \) function as +$$ +\chi^2(\hat{\beta})=\sum_{i=0}^{n-1}\frac{\left(y_i-\tilde{y}_i\right)^2}{\sigma_i^2}=\left(\hat{y}-\hat{\tilde{y}}\right)^T\frac{1}{\hat{\Sigma^2}}\left(\hat{y}-\hat{\tilde{y}}\right), +$$ + +where the matrix \( \hat{\Sigma} \) is a diagonal matrix with \( \sigma_i \) as matrix elements. + + +

    + + +

    +









    + +

    The \( \chi^2 \) function

    +
    + +

    + +

    +In order to find the parameters \( \beta_i \) we will then minimize the spread of \( \chi^2(\hat{\beta}) \) by requiring +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(\frac{y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}}{\sigma_i}\right)^2\right]=0, +$$ + +which results in +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}\frac{x_{ij}}{\sigma_i}\left(\frac{y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}}{\sigma_i}\right)\right]=0, +$$ + +or in a matrix-vector form as +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \hat{\beta}} = 0 = \hat{A}^T\left( \hat{b}-\hat{A}\hat{\beta}\right). +$$ + +where we have defined the matrix \( \hat{A} =\hat{X}/\hat{\Sigma} \) with matrix elements \( a_{ij} = x_{ij}/\sigma_i \) and the vector \( \hat{b} \) with elements \( b_i = y_i/\sigma_i \). +

    + + +

    +









    + +

    The \( \chi^2 \) function

    +
    + +

    + +

    +We can rewrite +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \hat{\beta}} = 0 = \hat{A}^T\left( \hat{b}-\hat{A}\hat{\beta}\right), +$$ + +as +$$ +\hat{A}^T\hat{b} = \hat{A}^T\hat{A}\hat{\beta}, +$$ + +and if the matrix \( \hat{A}^T\hat{A} \) is invertible we have the solution +$$ +\hat{\beta} =\left(\hat{A}^T\hat{A}\right)^{-1}\hat{A}^T\hat{b}. +$$ +

    + + +

    +









    + +

    The \( \chi^2 \) function

    +
    + +

    + +

    +If we then introduce the matrix +$$ +\hat{H} = \hat{A}^T\hat{A}, +$$ + +we have then the following expression for the parameters \( \beta_j \) (the matrix elements of \( \hat{H} \) are \( h_{ij} \)) +$$ +\beta_j = \sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}\frac{y_i}{\sigma_i}\frac{x_{ik}}{\sigma_i} = \sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}b_ia_{ik} +$$ + +We state without proof the expression for the uncertainty in the parameters \( \beta_j \) as +$$ +\sigma^2(\beta_j) = \sum_{i=0}^{n-1}\sigma_i^2\left( \frac{\partial \beta_j}{\partial y_i}\right)^2, +$$ + +resulting in +$$ +\sigma^2(\beta_j) = \left(\sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}a_{ik}\right)\left(\sum_{l=0}^{p-1}h_{jl}\sum_{m=0}^{n-1}a_{ml}\right) = h_{jj}! +$$ +

    + + +

    +









    + +

    The \( \chi^2 \) function

    +
    + +

    +The first step here is to approximate the function \( y \) with a first-order polynomial, that is we write +$$ +y=y(x) \rightarrow y(x_i) \approx \beta_0+\beta_1 x_i. +$$ + +By computing the derivatives of \( \chi^2 \) with respect to \( \beta_0 \) and \( \beta_1 \) show that these are given by +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_0} = -2\left[ \sum_{i=0}^{1}\left(\frac{y_i-\beta_0-\beta_1x_{i}}{\sigma_i^2}\right)\right]=0, +$$ + +and +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_0} = -2\left[ \sum_{i=0}^{1}x_i\left(\frac{y_i-\beta_0-\beta_1x_{i}}{\sigma_i^2}\right)\right]=0. +$$ +

    + + +

    +









    + +

    The \( \chi^2 \) function

    +
    + +

    + +

    +We define then +$$ +\gamma = \sum_{i=0}^{1}\frac{1}{\sigma_i^2}, +$$ + + +$$ +\gamma_x = \sum_{i=0}^{1}\frac{x_{i}}{\sigma_i^2}, +$$ + +$$ +\gamma_y = \sum_{i=0}^{1}\left(\frac{y_i}{\sigma_i^2}\right), +$$ + +$$ +\gamma_{xx} = \sum_{i=0}^{1}\frac{x_ix_{i}}{\sigma_i^2}, +$$ + +$$ +\gamma_{xy} = \sum_{i=0}^{1}\frac{y_ix_{i}}{\sigma_i^2}, +$$ + +and show that +$$ +\beta_0 = \frac{\gamma_{xx}\gamma_y-\gamma_x\gamma_y}{\gamma\gamma_{xx}-\gamma_x^2}, +$$ + +$$ +\beta_1 = \frac{\gamma_{xy}\gamma-\gamma_x\gamma_y}{\gamma\gamma_{xx}-\gamma_x^2}. +$$ + +

    +The LSM suffers often from both being underdetermined and overdetermined in the unknown coefficients \( \beta_i \). A better approach is to use the Singular Value Decomposition (SVD) method discussed below. +

    + + +

    +









    + +

    The singular value decompostion

    diff --git a/doc/pub/Regression/html/Regression.html b/doc/pub/Regression/html/Regression.html index 80a3c96fb..1dac246a3 100644 --- a/doc/pub/Regression/html/Regression.html +++ b/doc/pub/Regression/html/Regression.html @@ -97,7 +97,13 @@ div { text-align: justify; text-justify: inter-word; } 2, None, '___sec10'), - ('The singular value decompostion', 2, None, '___sec11')]} + ('The $\\chi^2$ function', 2, None, '___sec11'), + ('The $\\chi^2$ function', 2, None, '___sec12'), + ('The $\\chi^2$ function', 2, None, '___sec13'), + ('The $\\chi^2$ function', 2, None, '___sec14'), + ('The $\\chi^2$ function', 2, None, '___sec15'), + ('The $\\chi^2$ function', 2, None, '___sec16'), + ('The singular value decompostion', 2, None, '___sec17')]} end of tocinfo --> @@ -112,8 +118,8 @@ MathJax.Hub.Config({ } }); - @@ -139,7 +145,7 @@ MathJax.Hub.Config({

    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

    -

    Oct 18, 2017

    +

    Oct 24, 2017












    @@ -365,12 +371,12 @@ where \( \langle y_i \rangle \) is the mean value. Keep in mind also that till n

    In order to find the parameters \( \beta_i \) we will then minimize the spread of \( Q(\hat{\beta}) \) by requiring $$ -\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(y_i-\beta_0x_{i,0}+\beta_1x_{i,1}+\beta_2x_{i,2}+\dots+\beta_{n-1}x_{i,n-1}\right)^2\right]=0, +\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}\right)^2\right]=0, $$ which results in $$ -\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}x_{ij}\left(y_i-\beta_0x_{i,0}+\beta_1x_{i,1}+\beta_2x_{i,2}+\dots+\beta_{n-1}x_{i,n-1}\right)\right]=0, +\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}x_{ij}\left(y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}\right)\right]=0, $$ or in a matrix-vector form as @@ -439,7 +445,184 @@ meaning that the solution for \( \hat{\beta} \) is the one which minimizes the r











    -

    The singular value decompostion

    +

    The \( \chi^2 \) function

    +
    + +

    + +

    +Normally, the response (dependent or outcome) variable \( y_i \) the outcome of a numerical experiment or another type of experiment and is thus only an approximation to the true value. It is then always accompanied by an error estimate, often limited to a statistical error estimate given by the standard deviation discussed earlier. In the discussion here we will treat \( y_i \) as our exact value for the response variable. + +

    +Introducing the standard deviation \( \sigma_i \) for each measurement \( y_i \), we define now the \( \chi^2 \) function as +$$ +\chi^2(\hat{\beta})=\sum_{i=0}^{n-1}\frac{\left(y_i-\tilde{y}_i\right)^2}{\sigma_i^2}=\left(\hat{y}-\hat{\tilde{y}}\right)^T\frac{1}{\hat{\Sigma^2}}\left(\hat{y}-\hat{\tilde{y}}\right), +$$ + +where the matrix \( \hat{\Sigma} \) is a diagonal matrix with \( \sigma_i \) as matrix elements. + + +

    + + +

    +









    + +

    The \( \chi^2 \) function

    +
    + +

    + +

    +In order to find the parameters \( \beta_i \) we will then minimize the spread of \( \chi^2(\hat{\beta}) \) by requiring +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(\frac{y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}}{\sigma_i}\right)^2\right]=0, +$$ + +which results in +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}\frac{x_{ij}}{\sigma_i}\left(\frac{y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}}{\sigma_i}\right)\right]=0, +$$ + +or in a matrix-vector form as +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \hat{\beta}} = 0 = \hat{A}^T\left( \hat{b}-\hat{A}\hat{\beta}\right). +$$ + +where we have defined the matrix \( \hat{A} =\hat{X}/\hat{\Sigma} \) with matrix elements \( a_{ij} = x_{ij}/\sigma_i \) and the vector \( \hat{b} \) with elements \( b_i = y_i/\sigma_i \). +

    + + +

    +









    + +

    The \( \chi^2 \) function

    +
    + +

    + +

    +We can rewrite +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \hat{\beta}} = 0 = \hat{A}^T\left( \hat{b}-\hat{A}\hat{\beta}\right), +$$ + +as +$$ +\hat{A}^T\hat{b} = \hat{A}^T\hat{A}\hat{\beta}, +$$ + +and if the matrix \( \hat{A}^T\hat{A} \) is invertible we have the solution +$$ +\hat{\beta} =\left(\hat{A}^T\hat{A}\right)^{-1}\hat{A}^T\hat{b}. +$$ +

    + + +

    +









    + +

    The \( \chi^2 \) function

    +
    + +

    + +

    +If we then introduce the matrix +$$ +\hat{H} = \hat{A}^T\hat{A}, +$$ + +we have then the following expression for the parameters \( \beta_j \) (the matrix elements of \( \hat{H} \) are \( h_{ij} \)) +$$ +\beta_j = \sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}\frac{y_i}{\sigma_i}\frac{x_{ik}}{\sigma_i} = \sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}b_ia_{ik} +$$ + +We state without proof the expression for the uncertainty in the parameters \( \beta_j \) as +$$ +\sigma^2(\beta_j) = \sum_{i=0}^{n-1}\sigma_i^2\left( \frac{\partial \beta_j}{\partial y_i}\right)^2, +$$ + +resulting in +$$ +\sigma^2(\beta_j) = \left(\sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}a_{ik}\right)\left(\sum_{l=0}^{p-1}h_{jl}\sum_{m=0}^{n-1}a_{ml}\right) = h_{jj}! +$$ +

    + + +

    +









    + +

    The \( \chi^2 \) function

    +
    + +

    +The first step here is to approximate the function \( y \) with a first-order polynomial, that is we write +$$ +y=y(x) \rightarrow y(x_i) \approx \beta_0+\beta_1 x_i. +$$ + +By computing the derivatives of \( \chi^2 \) with respect to \( \beta_0 \) and \( \beta_1 \) show that these are given by +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_0} = -2\left[ \sum_{i=0}^{1}\left(\frac{y_i-\beta_0-\beta_1x_{i}}{\sigma_i^2}\right)\right]=0, +$$ + +and +$$ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_0} = -2\left[ \sum_{i=0}^{1}x_i\left(\frac{y_i-\beta_0-\beta_1x_{i}}{\sigma_i^2}\right)\right]=0. +$$ +

    + + +

    +









    + +

    The \( \chi^2 \) function

    +
    + +

    + +

    +We define then +$$ +\gamma = \sum_{i=0}^{1}\frac{1}{\sigma_i^2}, +$$ + + +$$ +\gamma_x = \sum_{i=0}^{1}\frac{x_{i}}{\sigma_i^2}, +$$ + +$$ +\gamma_y = \sum_{i=0}^{1}\left(\frac{y_i}{\sigma_i^2}\right), +$$ + +$$ +\gamma_{xx} = \sum_{i=0}^{1}\frac{x_ix_{i}}{\sigma_i^2}, +$$ + +$$ +\gamma_{xy} = \sum_{i=0}^{1}\frac{y_ix_{i}}{\sigma_i^2}, +$$ + +and show that +$$ +\beta_0 = \frac{\gamma_{xx}\gamma_y-\gamma_x\gamma_y}{\gamma\gamma_{xx}-\gamma_x^2}, +$$ + +$$ +\beta_1 = \frac{\gamma_{xy}\gamma-\gamma_x\gamma_y}{\gamma\gamma_{xx}-\gamma_x^2}. +$$ + +

    +The LSM suffers often from both being underdetermined and overdetermined in the unknown coefficients \( \beta_i \). A better approach is to use the Singular Value Decomposition (SVD) method discussed below. +

    + + +

    +









    + +

    The singular value decompostion

    diff --git a/doc/pub/Regression/ipynb/ipynb-Regression-src.tar.gz b/doc/pub/Regression/ipynb/ipynb-Regression-src.tar.gz index 633f50773..bae73d029 100644 Binary files a/doc/pub/Regression/ipynb/ipynb-Regression-src.tar.gz and b/doc/pub/Regression/ipynb/ipynb-Regression-src.tar.gz differ diff --git a/doc/pub/Regression/pdf/Regression-beamer-handouts2x3.pdf b/doc/pub/Regression/pdf/Regression-beamer-handouts2x3.pdf index d166a4556..aff0899eb 100644 Binary files a/doc/pub/Regression/pdf/Regression-beamer-handouts2x3.pdf and b/doc/pub/Regression/pdf/Regression-beamer-handouts2x3.pdf differ diff --git a/doc/pub/Regression/pdf/Regression-beamer.pdf b/doc/pub/Regression/pdf/Regression-beamer.pdf index 012624e18..ca6edc2f4 100644 Binary files a/doc/pub/Regression/pdf/Regression-beamer.pdf and b/doc/pub/Regression/pdf/Regression-beamer.pdf differ diff --git a/doc/pub/Regression/pdf/Regression-minted.pdf b/doc/pub/Regression/pdf/Regression-minted.pdf index 867b17236..e2b7d2b40 100644 Binary files a/doc/pub/Regression/pdf/Regression-minted.pdf and b/doc/pub/Regression/pdf/Regression-minted.pdf differ diff --git a/doc/src/Regression/Regression.do.txt b/doc/src/Regression/Regression.do.txt index 9c408a463..4d456bf1b 100644 --- a/doc/src/Regression/Regression.do.txt +++ b/doc/src/Regression/Regression.do.txt @@ -198,13 +198,13 @@ where $\langle y_i \rangle$ is the mean value. Keep in mind also that till now In order to find the parameters $\beta_i$ we will then minimize the spread of $Q(\hat{\beta})$ by requiring !bt \[ -\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(y_i-\beta_0x_{i,0}+\beta_1x_{i,1}+\beta_2x_{i,2}+\dots+\beta_{n-1}x_{i,n-1}\right)^2\right]=0, +\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}\right)^2\right]=0, \] !et which results in !bt \[ -\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}x_{ij}\left(y_i-\beta_0x_{i,0}+\beta_1x_{i,1}+\beta_2x_{i,2}+\dots+\beta_{n-1}x_{i,n-1}\right)\right]=0, +\frac{\partial Q(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}x_{ij}\left(y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}\right)\right]=0, \] !et or in a matrix-vector form as @@ -267,8 +267,169 @@ meaning that the solution for $\hat{\beta}$ is the one which minimizes the resid !eblock +!split +===== The $\chi^2$ function ===== +!bblock +Normally, the response (dependent or outcome) variable $y_i$ the outcome of a numerical experiment or another type of experiment and is thus only an approximation to the true value. It is then always accompanied by an error estimate, often limited to a statistical error estimate given by the standard deviation discussed earlier. In the discussion here we will treat $y_i$ as our exact value for the response variable. +Introducing the standard deviation $\sigma_i$ for each measurement $y_i$, we define now the $\chi^2$ function as +!bt +\[ +\chi^2(\hat{\beta})=\sum_{i=0}^{n-1}\frac{\left(y_i-\tilde{y}_i\right)^2}{\sigma_i^2}=\left(\hat{y}-\hat{\tilde{y}}\right)^T\frac{1}{\hat{\Sigma^2}}\left(\hat{y}-\hat{\tilde{y}}\right), +\] +!et +where the matrix $\hat{\Sigma}$ is a diagonal matrix with $\sigma_i$ as matrix elements. + +!eblock + +!split +===== The $\chi^2$ function ===== +!bblock + +In order to find the parameters $\beta_i$ we will then minimize the spread of $\chi^2(\hat{\beta})$ by requiring +!bt +\[ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_j} = \frac{\partial }{\partial \beta_j}\left[ \sum_{i=0}^{n-1}\left(\frac{y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}}{\sigma_i}\right)^2\right]=0, +\] +!et +which results in +!bt +\[ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_j} = -2\left[ \sum_{i=0}^{n-1}\frac{x_{ij}}{\sigma_i}\left(\frac{y_i-\beta_0x_{i,0}-\beta_1x_{i,1}-\beta_2x_{i,2}-\dots-\beta_{n-1}x_{i,n-1}}{\sigma_i}\right)\right]=0, +\] +!et +or in a matrix-vector form as +!bt +\[ +\frac{\partial \chi^2(\hat{\beta})}{\partial \hat{\beta}} = 0 = \hat{A}^T\left( \hat{b}-\hat{A}\hat{\beta}\right). +\] +!et +where we have defined the matrix $\hat{A} =\hat{X}/\hat{\Sigma}$ with matrix elements $a_{ij} = x_{ij}/\sigma_i$ and the vector $\hat{b}$ with elements $b_i = y_i/\sigma_i$. +!eblock + +!split +===== The $\chi^2$ function ===== +!bblock + +We can rewrite +!bt +\[ +\frac{\partial \chi^2(\hat{\beta})}{\partial \hat{\beta}} = 0 = \hat{A}^T\left( \hat{b}-\hat{A}\hat{\beta}\right), +\] +!et +as +!bt +\[ +\hat{A}^T\hat{b} = \hat{A}^T\hat{A}\hat{\beta}, +\] +!et +and if the matrix $\hat{A}^T\hat{A}$ is invertible we have the solution +!bt +\[ +\hat{\beta} =\left(\hat{A}^T\hat{A}\right)^{-1}\hat{A}^T\hat{b}. +\] +!et +!eblock + +!split +===== The $\chi^2$ function ===== +!bblock + +If we then introduce the matrix +!bt +\[ +\hat{H} = \hat{A}^T\hat{A}, +\] +!et +we have then the following expression for the parameters $\beta_j$ (the matrix elements of $\hat{H}$ are $h_{ij}$) +!bt +\[ +\beta_j = \sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}\frac{y_i}{\sigma_i}\frac{x_{ik}}{\sigma_i} = \sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}b_ia_{ik} +\] +!et +We state without proof the expression for the uncertainty in the parameters $\beta_j$ as +!bt +\[ +\sigma^2(\beta_j) = \sum_{i=0}^{n-1}\sigma_i^2\left( \frac{\partial \beta_j}{\partial y_i}\right)^2, +\] +!et +resulting in +!bt +\[ +\sigma^2(\beta_j) = \left(\sum_{k=0}^{p-1}h_{jk}\sum_{i=0}^{n-1}a_{ik}\right)\left(\sum_{l=0}^{p-1}h_{jl}\sum_{m=0}^{n-1}a_{ml}\right) = h_{jj}! +\] +!et +!eblock + +!split +===== The $\chi^2$ function ===== +!bblock +The first step here is to approximate the function $y$ with a first-order polynomial, that is we write +!bt +\[ +y=y(x) \rightarrow y(x_i) \approx \beta_0+\beta_1 x_i. +\] +!et +By computing the derivatives of $\chi^2$ with respect to $\beta_0$ and $\beta_1$ show that these are given by +!bt +\[ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_0} = -2\left[ \sum_{i=0}^{1}\left(\frac{y_i-\beta_0-\beta_1x_{i}}{\sigma_i^2}\right)\right]=0, +\] +!et +and +!bt +\[ +\frac{\partial \chi^2(\hat{\beta})}{\partial \beta_0} = -2\left[ \sum_{i=0}^{1}x_i\left(\frac{y_i-\beta_0-\beta_1x_{i}}{\sigma_i^2}\right)\right]=0. +\] +!et +!eblock + +!split +===== The $\chi^2$ function ===== +!bblock + +We define then +!bt +\[ +\gamma = \sum_{i=0}^{1}\frac{1}{\sigma_i^2}, +\] +!et + +!bt +\[ +\gamma_x = \sum_{i=0}^{1}\frac{x_{i}}{\sigma_i^2}, +\] +!et +!bt +\[ +\gamma_y = \sum_{i=0}^{1}\left(\frac{y_i}{\sigma_i^2}\right), +\] +!et +!bt +\[ +\gamma_{xx} = \sum_{i=0}^{1}\frac{x_ix_{i}}{\sigma_i^2}, +\] +!et +!bt +\[ +\gamma_{xy} = \sum_{i=0}^{1}\frac{y_ix_{i}}{\sigma_i^2}, +\] +!et +and show that +!bt +\[ +\beta_0 = \frac{\gamma_{xx}\gamma_y-\gamma_x\gamma_y}{\gamma\gamma_{xx}-\gamma_x^2}, +\] +!et +!bt +\[ +\beta_1 = \frac{\gamma_{xy}\gamma-\gamma_x\gamma_y}{\gamma\gamma_{xx}-\gamma_x^2}. +\] +!et + +The LSM suffers often from both being underdetermined and overdetermined in the unknown coefficients $\beta_i$. A better approach is to use the Singular Value Decomposition (SVD) method discussed below. +!eblock @@ -287,13 +448,7 @@ How can we use the singular value decomposition to find the parameters $\beta_j$ -Suppose M is a m × n matrix whose entries come from the field K, which is either the field of real numbers or the field of complex numbers. Then there exists a factorization, called a singular value decomposition of M, of the form -{\displaystyle \mathbf {M} =\mathbf {U} {\boldsymbol {\Sigma }}\mathbf {V} ^{*}} \mathbf {M} =\mathbf {U} {\boldsymbol {\Sigma }}\mathbf {V} ^{*} -where -U is an m × m unitary matrix (if K = {\displaystyle \mathbb {R} } \mathbb {R} , unitary matrices are orthogonal matrices), -Σ is a diagonal m × n matrix with non-negative real numbers on the diagonal, -V is an n × n unitary matrix over K, and -V∗ is the conjugate transpose of V. -The diagonal entries σi of Σ are known as the singular values of M. A common convention is to list the singular values in descending order. In this case, the diagonal matrix, Σ, is uniquely determined by M (though not the matrices U and V, see below). + +