Efron-Stein theorem

[[concept]]

Topics

const fieldName = "theme"; // Your field with links
const oldPrefix = "Thoughts/01 Themes/";
const newPrefix = "Digital Garden/Topics/";
 
const relatedLinks = dv.current()[fieldName];
 
if (Array.isArray(relatedLinks)) {
    // Map over the links, replace the path, and output only clickable links
    dv.el("span",
        relatedLinks
            .map(link => {
                if (link && link.path) {
                    let newPath = link.path.startsWith(oldPrefix)
                        ? link.path.replace(oldPrefix, newPrefix)
                        : link.path;
                    return dv.fileLink(newPath);
                }
            })
            .filter(Boolean).join(", ") 
	// Remove any undefined/null items
    );
} else {
    dv.el(dv.current().theme);
}
 
 

Efron-Stein Theorem

Let be independent random variables and any function of them. Then

Remark

The only assumption that we make in the above is that And the are independent.

NOTE

We generally want something to avoid taking these expectations

Proof

Let’s denote and

\text{Var}(f) &= \mathbb{E}\left[f-\mathbb{E}\left[f\right]^2 \right] \\ &= \mathbb{E}\left[ (f-\cancel{ \mathbb{E}_{\leq 1}\left[f\right] } ) + \underbrace{ (\cancel{ \mathbb{E}_{\leq 1}\left[f\right] } - \cancel{ \mathbb{E}_{\leq 2}\left[f\right] } ) }_{ \mathbb{E}_{y_{1}}\left[f(y_{1},x_{2},\dots,x_{N})\right] -\mathbb{E}_{y_{1},y_{2}}\left[y_{1},y_{2},x_{3},\dots,x_{N}\right] }+\cancel{ \dots }+(\cancel{ \mathbb{E}_{\leq N-1}\left[f\right] } -\mathbb{E}_{\leq N}\left[f\right] )^2\right] \\ & \end{align}$$ Expanding for the cross terms, if $i \leq j$, we get $$\begin{align} \mathbb{E}_{x_{1},\dots,x_{N}}&\left[\,(\mathbb{E}_{y_{1},\dots,y_{i}}\left[y_{1},\dots,y_{i},x_{i+1},\dots,x_{j},\dots,x_{N}\right]) \times(\mathbb{E}_{z_{1},\dots,z_{j}}\left[z_{1},\dots,z_{j},x_{j+1},\dots,x_{N}\right] ) \,\right] \\ &=\mathbb{E}\left[\,\mathbb{E}_{\leq j}\left[f\right] ^2\,\right] \end{align}$$ Generally, $\mathbb{E}\left[\,\mathbb{E}_{\leq i}\left[f\right]\,\,\mathbb{E}_{\leq j}\left[f\right]\,\right]=\mathbb{E}_{}\left[(\mathbb{E}_{\leq\max\{ i,j \}}\left[f\right])^2\right]$ $$\begin{align} &\mathbb{E}_{}\left[(\mathbb{E}_{\leq i}\left[f\right] -\mathbb{E}_{\leq i+1}\left[f\right] )\times(\mathbb{E}_{\leq j}\left[f\right] -\mathbb{E}_{\leq j+1}\left[f\right] )\right] \\ &= \mathbb{E}_{}\left[(\mathbb{E}_{\leq j}\left[f\right]) ^2\right] - \mathbb{E}_{}\left[(\mathbb{E}_{\leq j}\left[f\right])^2 \right] +\mathbb{E}_{}\left[(\mathbb{E}_{\leq j+1}\left[f\right] )^2\right] -\mathbb{E}_{}\left[(\mathbb{E}_{\leq j+1}\left[f\right] )^2\right] \\ &=0 \end{align}$$ By [[Jensen's inequality]]. So we get $$\begin{align} \text{Var}(f) &= \sum_{i=1}^N \mathbb{E}_{}\left[(\mathbb{E}_{\leq i-1}\left[f\right] -\mathbb{E}_{\leq i}\left[f\right] )^2\right] \\ &= \sum_{i=1}^N \mathbb{E}_{}\left[\mathbb{E}_{y_{1},\dots,y_{i-1}}\left[f(y_{1},\dots,y_{i-1},x_{i},\dots,x_{N})\right] -\mathbb{E}_{y_{i}}\left[f(y_{1},\dots,y_{i-1}, y_{i}, x_{i+1},\dots,x_{N})\right] \right] \\ (*)&\leq \sum_{i=1}^N \underbrace{ \mathbb{E}_{}\left[\mathbb{E}_{x_{i}}\left[f(x_{1},\dots,x_{N})\right] -\mathbb{E}_{y_{i}}\left[f(x_{1},\dots,x_{i-1}, y_{i}, x_{i+1},\dots x_{N})\right] \right] }_{ \text{Var}_{x_{i}}f(x) } \\ &= \sum_{i=1}^N \text{Var}_{x_{i}}(f(x)) \end{align}$$ Where we apply the inequality at $(*)$, and note that the $y_{i}$ are iid copies of the $x_i$ (and therefore can be interchanged freely, as convenient) $$\tag*{$\blacksquare$}$$

References

References

See Also

Mentions

Mentions

const modules = await cJS()
 
const COLUMNS = [  
	{ id: "Name", value: page => page.$link },  
	{ id: "Last Modified", value: page => modules.dateTime.getLastMod(page) },
];  
  
return function View() {  
	const current = dc.useCurrentFile();
// Selecting `#game` pages, for example. 
	let queryString = `@page and linksto(${current.$link})`;
	let pages = dc.useQuery(queryString);
	
	// check types
	pages = pages.filter( (p) => !modules.typeCheck.checkAll(p, current) ).sort()
	
	
	return <dc.Table columns={COLUMNS} rows={pages} paging={20}/>;  
}  
const { dateTime } = await cJS()
 
return function View() {
	const file = dc.useCurrentFile();
	return <p class="dv-modified">Created {dateTime.getCreated(file)}     ֍     Last Modified {dateTime.getLastMod(file)}</p>
}