
{"id":15,"date":"2022-04-26T08:00:44","date_gmt":"2022-04-26T00:00:44","guid":{"rendered":"https:\/\/blog.shirui.me\/?p=15"},"modified":"2022-04-26T19:00:22","modified_gmt":"2022-04-26T11:00:22","slug":"maximize-entropy","status":"publish","type":"post","link":"https:\/\/www.shirui.me\/blog\/2022\/04\/26\/maximize-entropy\/","title":{"rendered":"Maximize Entropy"},"content":{"rendered":"\n<p>The entropy is defined as<\/p>\n\n\n\n<p>$$S:=-\\int_{\\Omega} p(x)\\log p(x) $$<\/p>\n\n\n\n<p>where $p(x)$ is a probability measure. It is naturally that $p(x)$ is constrained by $\\int_\\Omega p(x)=1$. If this is the sole constraint, $p(x)$ should be uniform distribution, optimize $S$ with Lagrange multiplier:<\/p>\n\n\n\n<p>$$J[p]:=-S-\\lambda \\left(\\int_\\Omega p(x) -1\\right)$$<\/p>\n\n\n\n<p>$$\\frac{\\delta J}{\\delta p}=\\log p(x) + 1 -\\lambda=0$$<\/p>\n\n\n\n<p>yields<\/p>\n\n\n\n<p>$$p(x)=\\exp(\\lambda-1)$$<\/p>\n\n\n\n<p>which is a constant. If $p(x)$ is defined in a box $\\Omega=[a,b]$, then $p(x)=1\/(b-a)$.<\/p>\n\n\n\n<p>For distributions with 1st and 2nd central moments, e.g., $(\\mu, \\sigma^2)$, $J$ becomes<\/p>\n\n\n\n<p>$$\\begin{align} J[p]=&amp;-S-\\lambda_0 \\left(\\int_\\Omega p(x) -1\\right)\\\\-&amp;\\lambda_1 \\left(\\int_\\Omega(x-\\mu)^2 p(x)-\\sigma^2\\right) \\end{align}$$<\/p>\n\n\n\n<p>$$\\frac{\\delta J}{\\delta p}=\\log p(x) + 1 &#8211; \\lambda_0 &#8211; 2\\lambda_1 (x-\\mu)^2=0$$<\/p>\n\n\n\n<p>yields<\/p>\n\n\n\n<p>$$p(x) = \\exp(\\lambda_0-1 +2\\lambda_1(x-\\mu)^2)$$<\/p>\n\n\n\n<p>which is a Gaussian distribution, one can easily evaluate $\\lambda_i$ from the constraints: $\\lambda_0=\\log \\sqrt{2\\sigma^2\\pi} +1$ and $\\lambda_1=1\/(2\\sigma^2)$. Notably, $\\delta^2 J\/\\delta p^2 = 1\/p$ is always positive so that $J$ is minimized, i.e., $S$ is maximized.<\/p>\n\n\n\n<p>For a series of constraints, e.g., $\\langle f_i(x)\\rangle,i=1,2,&#8230;,n$ are given, there are $n$  conjugated Lagrange multipliers, which leads to<\/p>\n\n\n\n<p>$$J = -S &#8211; \\lambda_0 \\left(\\int_\\Omega p(x)-1\\right)-\\sum_i\\lambda_i \\left(\\int_\\Omega f_i(x) p(x)\\right)$$<\/p>\n\n\n\n<p>$$\\frac{\\delta J}{\\delta p}=\\log p + 1-\\lambda_0 &#8211; \\sum_i f_i \\lambda_i=0$$<\/p>\n\n\n\n<p>yields<\/p>\n\n\n\n<p>$$p(x)=\\exp(\\lambda_0-1)\\exp(\\sum_i f_i\\lambda_i)$$<\/p>\n\n\n\n<p>Then we have $S_{max}=\\lambda_0-1 +\\sum_i \\langle f_i\\rangle \\lambda_i$, and $\\lambda_i = \\partial S_{max}\/\\partial \\langle f_i\\rangle$, especially,<\/p>\n\n\n\n<p>$$ \\lambda = \\frac{\\partial S}{\\partial \\langle E\\rangle }:=\\frac{1}{T}$$<\/p>\n\n\n\n<p>is the definition of temperature from Boltzmann distribution.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The entropy is defined as $$S:=-\\int_{\\Omega} p(x)\\log p(x) $$ where $p(x)$ is a probability measure. It is naturally that $p(x)$ is constrained by $\\int_\\Omega p(x)=1$. If this is the sole constraint, $p(x)$ should be uniform distribution, optimize $S$ with Lagrange multiplier: $$J[p]:=-S-\\lambda \\left(\\int_\\Omega p(x) -1\\right)$$ $$\\frac{\\delta J}{\\delta p}=\\log p(x) + 1 -\\lambda=0$$ yields $$p(x)=\\exp(\\lambda-1)$$ which [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[12,10,11],"class_list":["post-15","post","type-post","status-publish","format-standard","hentry","category-notes","tag-calculus-of-varaitions","tag-math","tag-physics"],"_links":{"self":[{"href":"https:\/\/www.shirui.me\/blog\/wp-json\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shirui.me\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shirui.me\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shirui.me\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shirui.me\/blog\/wp-json\/wp\/v2\/comments?post=15"}],"version-history":[{"count":10,"href":"https:\/\/www.shirui.me\/blog\/wp-json\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":28,"href":"https:\/\/www.shirui.me\/blog\/wp-json\/wp\/v2\/posts\/15\/revisions\/28"}],"wp:attachment":[{"href":"https:\/\/www.shirui.me\/blog\/wp-json\/wp\/v2\/media?parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shirui.me\/blog\/wp-json\/wp\/v2\/categories?post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shirui.me\/blog\/wp-json\/wp\/v2\/tags?post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}