diff --git a/package-lock.json b/package-lock.json index 4aa478d..994c820 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "hexo-generator-tag": "^2.0.0", "hexo-helper-live2d": "^3.1.1", "hexo-neat": "^1.0.9", + "hexo-related-posts": "^1.5.2", "hexo-renderer-ejs": "^2.0.0", "hexo-renderer-pandoc": "^0.4.0", "hexo-renderer-stylus": "^3.0.1", @@ -974,6 +975,15 @@ "node": ">=0.4.0" } }, + "node_modules/afinn-165": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/afinn-165/-/afinn-165-1.0.4.tgz", + "integrity": "sha512-7+Wlx3BImrK0HiG6y3lU4xX7SpBPSSu8T9iguPMlaueRFxjbYwAQrp9lqZUuFikqKbd/en8lVREILvP2J80uJA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-6.0.2.tgz", @@ -1133,6 +1143,17 @@ "node": ">= 8" } }, + "node_modules/apparatus": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/apparatus/-/apparatus-0.0.10.tgz", + "integrity": "sha512-KLy/ugo33KZA7nugtQ7O0E1c8kQ52N3IvD/XgIh4w/Nr28ypfkwDfA67F1ev4N1m5D+BOk1+b2dEJDfpj/VvZg==", + "dependencies": { + "sylvester": ">= 0.0.8" + }, + "engines": { + "node": ">=0.2.6" + } + }, "node_modules/aproba": { "version": "1.2.0", "resolved": "https://registry.npmmirror.com/aproba/-/aproba-1.2.0.tgz", @@ -5260,6 +5281,18 @@ "node": ">=14" } }, + "node_modules/hexo-related-posts": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/hexo-related-posts/-/hexo-related-posts-1.5.2.tgz", + "integrity": "sha512-IXGTMp6r1AT6rBS4vsWwcnVQ6tPmMA4cju5ldcske6zs7ff9SdqQ6t05UHBJWjyK45NtNu5V5IsqG4o+lzjJ1w==", + "dependencies": { + "natural": "^2.1.5" + }, + "peerDependencies": { + "chalk": "^4.1.0", + "hexo": "^4.2.0 || ^5.2.0 || ^6.3.0 || ^7.1.1" + } + }, "node_modules/hexo-renderer-ejs": { "version": "2.0.0", "resolved": "https://registry.npmmirror.com/hexo-renderer-ejs/-/hexo-renderer-ejs-2.0.0.tgz", @@ -7055,6 +7088,28 @@ "jju": "^1.1.0" } }, + "node_modules/json-stable-stringify": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.1.1.tgz", + "integrity": "sha512-SU/971Kt5qVQfJpyDveVhQ/vya+5hvrjClFOcr8c0Fq5aODJjMwutrOfCU+eCnVD5gpx1Q3fEqkyom77zH1iIg==", + "dependencies": { + "call-bind": "^1.0.5", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/json-stable-stringify/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz", @@ -7085,6 +7140,14 @@ "node": ">= 10.0.0" } }, + "node_modules/jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmmirror.com/jsonparse/-/jsonparse-1.3.1.tgz", @@ -8384,6 +8447,22 @@ "node": ">=0.10.0" } }, + "node_modules/natural": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/natural/-/natural-2.4.5.tgz", + "integrity": "sha512-fxQou4ubo6Rzf7XL0jjwtC2vHm6Sdicu7ztcE0k1ODZs+d1UzcKF1Hu2IwE2y7OgzU3Sa9o8obw7rnyNrjsd1A==", + "dependencies": { + "afinn-165": "^1.0.2", + "apparatus": "^0.0.10", + "json-stable-stringify": "^1.0.1", + "sylvester": "^0.0.12", + "underscore": "^1.9.1", + "wordnet-db": "^3.1.11" + }, + "engines": { + "node": ">=0.4.10" + } + }, "node_modules/ncp": { "version": "2.0.0", "resolved": "https://registry.npmmirror.com/ncp/-/ncp-2.0.0.tgz", @@ -10993,6 +11072,14 @@ "node": ">= 0.4" } }, + "node_modules/sylvester": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/sylvester/-/sylvester-0.0.12.tgz", + "integrity": "sha512-SzRP5LQ6Ts2G5NyAa/jg16s8e3R7rfdFjizy1zeoecYWw+nGL+YA1xZvW/+iJmidBGSdLkuvdwTYEyJEb+EiUw==", + "engines": { + "node": ">=0.2.6" + } + }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmmirror.com/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -11360,6 +11447,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/underscore": { + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", + "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==" + }, "node_modules/undici": { "version": "5.28.4", "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", @@ -11902,6 +11994,14 @@ "node": ">=0.10.0" } }, + "node_modules/wordnet-db": { + "version": "3.1.14", + "resolved": "https://registry.npmjs.org/wordnet-db/-/wordnet-db-3.1.14.tgz", + "integrity": "sha512-zVyFsvE+mq9MCmwXUWHIcpfbrHHClZWZiVOzKSxNJruIcFn2RbY55zkhiAMMxM8zCVSmtNiViq8FsAZSFpMYag==", + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", diff --git a/source/_posts/2024-06-08-josh-cvx-1-3.md b/source/_posts/2024-06-08-josh-cvx-1-3.md index c4c423c..330cbca 100644 --- a/source/_posts/2024-06-08-josh-cvx-1-3.md +++ b/source/_posts/2024-06-08-josh-cvx-1-3.md @@ -28,7 +28,9 @@ $ \newcommand{\TT}{\mathrm{T}} \newcommand{\H}{\mathcal{H}} \newcommand{\E}{\mathcal{E}} +\newcommand{\P}{\mathcal{P}} \def\dom{\mathop{\bf dom}} +\def\prob{\mathop{\bf prob}} $  本文将描述一些保凸运算,利用保凸运算可以使用凸集构造出其他凸集。这些运算与[*Part 1.2 凸集—一些重要的凸集*](https://josh-gao.top/posts/9293b739.html)中描述的凸集的简单例子一起构成了凸集的演算,可以用来确定或构建集合的凸性。 # 1. 交集 @@ -207,10 +209,96 @@ $$ \mu = \frac{\theta x_{n+1}}{\theta x_{n+1} + (1-\theta) y_{n+1}}\in[0,1] $$ -$\theta$ 和 $\mu$ 之间的关系是单调的:当 $\theta$ 在 $0$、$1$ 间变化时(形成线段 $[x,y]$),$μ$ 也在 $0$、$1$ 间变化(形成线段 $[P(x),P(y)]$。这说明 $P([x,y]) = [P(x),P(y)]$。 +$\theta$ 和 $\mu$ 之间的关系是单调的:当 $\theta$ 在 $0$、$1$ 间变化时(形成线段 $[x,y]$),$\mu$ 也在 $0$、$1$ 间变化(形成线段 $[P(x),P(y)]$。这说明 $P([x,y]) = [P(x),P(y)]$。   现在假设 $C$ 是凸的,并且有 $C \subseteq \dom P$(即对于所有 $x\in C$,$x_{n+1} > 0$) 及 $x,y\in C$。为显示 $P(C)$ 的凸性,需要说明线段 $[P(x), P(y)]$ 在 $P(C)$ 中。这条线段是线段 $[x,y]$ 在 $P$ 的象,因而属于 $P(C)$。 +  一个凸集在透视函数下的原象也是凸的:如果 $C\subseteq \bfR^n$ 为凸集,那么 + +$$ +P^{-1}(C) = \{ (x,t)\in\bfR^{n+1}\ |\ x/t\in C, t > 0 \} +$$ + +是凸集。为证明这点,假设 $(x,t)\in P^{-1}(C), (y,s)\in P^{-1}(C), 0 \leqslant \theta \leqslant 1$。我们需要说明 + +$$ +\theta(x,t) + (1-\theta)(y,s) \in P^{-1} (C) +$$ + +即 + +$$ +\frac{\theta x + (1-\theta)y}{\theta t + (1-\theta)s} = \mu (x/t) + (1-\mu)(y/s) +$$ + +其中 + +$$ +\mu = \frac{\theta t}{\theta t + (1-\theta)s} \in [0,1] +$$ + +## 3.2 线性分式函数 + +  **线性分式函数**(*linear-fractional function*)由透视函数和仿射函数复合而成。设 $g:\bfR^n \to \bfR^{m+1}$ 是仿射的,即 + +$$\begin{equation}\label{AffineFunction} + g(x) = \left[\begin{array}{c} + A \\ c^\TT + \end{array}\right]x + \left[\begin{array}{c} + b \\ d + \end{array}\right] +\end{equation}$$ + +其中 $A \in \bfR ^{m\times n}, b \in \bfR^m, c \in \bfR^n$ 并且 $d\in\bfR^n$。则由 $f =P\circ g$ 给出的函数 $f:\bfR^n \to \bfR^m$ + +$$\begin{equation}\label{LinearFractionalFunction} + f(x) = (Ax+b)/(c^\TT x + d),\qquad \dom f = \{x\ |\ c^\TT x + d > 0\} +\end{equation}$$ + +称为**线性分式**(*linear-fractional*)(或**投射**(*projective*))函数。如果 $c = 0, d > 0$,则 $f$ 的定义域为 $\bfR^n$ 并且 $f$ 是仿射函数。因此,我们可以将仿射和线性函数视为特殊的线性分式函数。 + +> **注释** **投射解释**。可以很方便地将一个线性分式函数表示为:将矩阵 +> +> $$\begin{equation} +> Q = \left[\begin{array}{c} +> A & b \\ c^\TT & d +> \end{array}\right] \in \bfR^{(m+1)\times (n+1)} +> \end{equation}$$ +> +> 作用于(即左乘)点 $(x,1)$,得到 $(Ax + b,c^\TT x + d)$;然后将所得结果做伸缩变换或归一化,以使得其最后一个分量为一,得到 $(f(x), 1)$。 +> +> 也可以从儿何上进行解释,即这个表达式将 $\bfR^n$ 与 $\bfR^{n+1}$ 空间上的一组射线联系了起来。也就是说,对于 $\bfR^n$ 空间的一个点 $z$,我们可以构造一个 $\bfR^{n+1}$ 空间的(开)射线 $P(z) = \{t(z,1)\ |\ t > 0\}$。这条射线上每个点的最后一个分量均是正值。反之, $\bfR^{n+1}$ 空间中每条以原点为顶点并且最后一个分量为正值的射线均可以由一些 $v\in\bfR^n$ 表示为 $\P(v) = \{t(v, 1)\ |\ t \geqslant 0\}$。$\P$ 表示了 $\bfR^n$ 与最后一个分量为正的射线之间的(投射)关系,这种关系是一一对应和满的。 +> +> 线性分式函数 $\eqref{LinearFractionalFunction}$ 可以表示为 +> +> $$ +> f(x) = \P^{-1}(Q\P(x)) +> $$ +> +> 因此,从 $x\in\dom f$ 出发,即由一个满足 $c^\TT x +d > 0$ 的点,可以得到 $\bfR^{n+1}$ 空间的一条射线 $\P(x)$。将线性变换矩阵 $Q$ 作用于这条射线,就可以得到另一条射线 $Q\P(x)$。因为 $x \in \dom f$, 这条射线的最后一个分量为正。最后,我们也可以通过逆投射变换恢复出 $f(x)$。 + +  类似于透视函数,线性分式函数也是保凸的。如果 $C$ 是凸集并且在 $f$ 的定义域中(即任意 $x\in C$ 满足 $c^\TT x+d > 0$),那么 $C$ 的象 $f(C)$ 也是凸集。根据前述的结果可以直接得到这个结论: $C$ 在仿射映射 $\eqref{AffineFunction}$ 下的象是凸的,并且在透视函数 $P$ 下的映射(即 $f(C)$)是凸的。类似地,如果 $C \subseteq \bfR^m$ 是凸集,那么其原象 $f^{-1}(C)$ 也是凸的。 + +> **举例** **条件概率**。设 $u$ 和 $v$ 是分别在 $\{1, \cdots, n\}$ 和 $\{1, \cdots, m\}$ 中取值的随机变量,并且 $p_ij$ 表示概率 $\prob(u = i,v = j)$。那么条件概率 $f_{ij} = \prob(u = i\ |\ v = j)$ 由下式给出 +> +> $$ +> f_{ij} = \frac{p_{ij}}{\displaystyle\sum_{k=1}^n p_{kj}} +> $$ +> +> 因此,$f$ 可以通过一个线性分式映射从 $p$ 得到。 +> +> 可以知道,如果 $C$ 是一个关于 $(u,v)$ 的联合密度的凸集,那么相应的 $u$ 的条件密度(给定 $v$)的集合也是凸集。 + +  [图 16](#图16) 表示了集合 $C\subseteq \bfR^2$ 及其在下面的线性分式函数下的象 + +$$ +f(x) = \frac{1}{x_1 + x_2 + 1} x,\qquad \dom f = \{(x_1,x_2)\ |\ x_1+x_2+1>0\} +$$ + + + +![图 16. **左**:集合 $C\subseteq \bfR^2$。虚线显示了线性分式函数 $f(x) = x/(x_1 + x_2 + 1)$ 的定义域的边界,其中 $\dom f = \{(x_1,x_2)\ |\ x_1+x_2+1>0\}$。**右**:$C$ 在 $f$ 下的象。虚线显示了 $f^{-1}$ 的定义域的边界。](../images/post/2024-06-08-josh-cvx-1-3/2024-06-08-josh-cvx-1-3-160-ASetAndItsImageUnderLFF.png){width=800px} + # 参考文献 1. Stephen P. Boyd and Lieven Vandenberghe, *Convex optimization*. Cambridge, UK: Cambridge University Press, 2004. diff --git a/source/images/post/2024-06-08-josh-cvx-1-3/2024-06-08-josh-cvx-1-3-160-ASetAndItsImageUnderLFF.png b/source/images/post/2024-06-08-josh-cvx-1-3/2024-06-08-josh-cvx-1-3-160-ASetAndItsImageUnderLFF.png new file mode 100644 index 0000000..f256883 Binary files /dev/null and b/source/images/post/2024-06-08-josh-cvx-1-3/2024-06-08-josh-cvx-1-3-160-ASetAndItsImageUnderLFF.png differ