Skip to content

Commit

Permalink
Updated nyga distribution theory.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsch420 committed May 27, 2024
1 parent 1acfdb8 commit ede7fd1
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions examples/nyga_distribution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@
],
"id": "122bdb92c9030631"
},
{
"metadata": {},
"cell_type": "markdown",
"source": [
"In case of a mixture of two uniform distributions, the likelihood is given by\n",
"\n",
"$$\n",
"p(x_i) = w_{left} \\cdot U_{left} + w_{right} \\cdot U_{right}\n",
"$$\n"
],
"id": "d9b477da487ef67d"
},
{
"metadata": {},
"cell_type": "markdown",
Expand Down Expand Up @@ -150,8 +162,13 @@
"Plugging it in we get the likelihood for the split\n",
"\n",
"\\begin{align*}\n",
"log \\left( L(\\mathcal{D}| d_1, d_{split}, d_N) \\right) &= \\sum_{i=1}^k log(w_i) + log(p(x_i)) = \\\\\n",
"&= \\sum_{i=1}^k log(w_i) + log(p_{left}(x) + p_{right}(x)) \\\\ &= \\sum_{i=1}^k log(w_i) + \\underbrace{log(p_{left}(x))}_{\\text{Constant for every sample in the left split}} + \\sum_{i=k+1}^N log(w_i) + \\underbrace{log(p_{right}(x))}_{\\text{Constant for every sample in the right split}}\n",
"log \\left( L(\\mathcal{D}| d_1, d_{split}, d_N) \\right) &= \\sum_{i=1}^N log(w_i) + log(p(x_i))\\\\\n",
"&= \\sum_{i=1}^{left} log(w_i) + log(p(x_i)) + \\sum_{i=right}^{N} log(w_i) + log(p(x_i)) \\\\\n",
"&= \\sum_{i=1}^{left} log(w_i) + log(w_{left} \\cdot p_{left}(x_i)) + \\sum_{i=right}^{N} log(w_i) + log(w_{right} \\cdot p_{right}(x_i)) \\\\\n",
"&= \\underbrace{\\sum_{i=1}^{left} log(w_i) + log(w_{left}) + log(U_{left})}_{\\text{Left Hand Side (LHS)}} + \\underbrace{\\sum_{i=right}^{N} log(w_i) + log(w_{right}) + log(U_{right})}_{\\text{Right Hand Side (RHS)}} \\\\\n",
"LHS &= L \\cdot ( log(w_{left}) + log(U_{left})) + \\sum_{i=1}^{left} log(w_i)\\\\\n",
"&= L \\cdot \\left( log \\left( \\sum_{i=1}^{left} w_i \\right) - log \\left( \\sum_{i=1}^{N} w_i \\right) - log(D_{split} - D_{left}) \\right) + \\sum_{i=1}^{left} log(w_i)\\\\\n",
"RHS &= (N - R) \\cdot \\left( log \\left( \\sum_{i=right}^{N} w_i \\right) - log \\left( \\sum_{i=1}^{N} w_i \\right) - log(D_{right} - D_{split}) \\right) + \\sum_{i=right}^{N} log(w_i)\\\\\n",
"\\end{align*}\n"
],
"id": "97c049e0191e5577"
Expand Down

0 comments on commit ede7fd1

Please sign in to comment.