How do you find the standard deviation of the weighted mean?   The weighted mean is defined: $\bar{x}_w = \frac{\sum{wx}}{\sum{w}}$  The weighted standard deviation (since it is not specified, I take it as of the distribution) is defined:  $$s_w = \sqrt{\frac{N'\sum_{i=1}^N {w_i(x_i-\bar{x}_w)^2}}{(N'-1)\sum_{i=1}^N{w_i}}},$$  where $N'$ is the number of nonzero weights, and $\bar x_w$ is the weighted mean of the sample ()  For an unweighted sample, calculating the standard deviation of the mean from the standard deviation of the distribution is .  How do I calculate it for the weighted mean, and how is the expression derived?
I am studying statistics and I am wondering when it comes to standard error or a sampling if the calculation changes when there are weights added.   I have a weighted mean:  $$\mu_{w} = \dfrac{\sum_{i=1}^Nw_ix_i}{\sum_{i=1}^Nw_i}$$ and a weighted variance calculated by:  $$s^2_{w}=\dfrac{\sum_{i=1}^Nw_i}{(\sum_{i=1}^Nw_i)^2-\sum_{i=1}^Nw_i^2}\cdot \sum_{i=1}^N(x_i-\mu)^2$$  is the sampling error still calculated as  $$\text{SE}=\sqrt{\dfrac{s^2_{w}}{n}}$$
Piping for loop output prevents local variable modification I'm trying to write a simple bash function that takes, as its arguments, a number of files and/or directories. It should:   Fully qualify the filenames. Sort them. Remove duplicates. Print all that actually exist. Return the number of non-existent files.   I have a script that almost does what I want, but falls down on the sorting. The return value of the script as it stands is correct, but the output is not (unsorted and duplicates). If I uncomment the | sort -u statement as indicated, the output is correct but the return value is always 0.  N.B. Simpler solutions to solve the problem are welcome but the question is really about why is this occurring in the code I have. That is, why does adding the pipe seemingly stop the script incrementing the variable r?  Here's the script:  function uniqfile {     local r=0       for arg in "$@"     do           readlink -e "$arg" || (( ++r ))      done #| sort -u    ## remove that comment      return $r } Switching a DIV background image with jQuery We all know that the amount of current flowing b/w the plates is independent of the frequency. If I were to ask why doesn't it depend then you'd probably say that it depends on the number of electrons rather than the frequency or you might show me a current vs frequency graph.  But here is my theoretical argument. Electric current is defined as the amount of charge flowing through a point/space/wire per unit time. Let I be current due to photo electrons ejected by photons of some frequency. Now if I would increase the frequency, the kinetic energy of the ejected electron would increases, therefore it will move faster and therefore contribute more current (charge will through the same point many times per unit time) . Thereby, giving a net current greater than I.  What is wrong with my argument?  After thinking a lot, I came up with a possible reason. However fast the electrons may move, but when they hit the metal plate, they would lose their velocity and start moving in drift velocity. Now there is a problem with this argument. If this were to be true then I should expect to see a big chunk of extra electrons getting stuck at the anode.  If my reasoning was correct, then why can't I see a big charge buildup at the anode. sed : Ignore line starting whitespace for match Benevolent aliens who (initially) refuse to show themselves This is a sci-fi book where aliens arrive on Earth and push Earth towards world peace, but refuse to reveal themselves physically. When the aliens finally do show themselves, we find that they       look like .   I recall that the aliens seemed benevolent, but that humanity did not like the direction they were being told to go. I cannot remember the ending or if the aliens turned out to be truly benevolent. How do you join or create a server in multiplayer? How do I resize root partition? ubuntu 18.04 LTS bluetooth [0cf3:3004] discovery not working How to access the correct `this` inside a callback? I'm not normally a fan of mac software implementations, but recently I saw a copy of Parallels Desktop for mac that I was very much impressed by. I looked into parallel's offerings for Linux (I was initially excited that they developed for *nix) but found that it has essentially the same features as VMware.   Does anyone know if there is a software solution for linux that offers the level of integration that the current Parallels Deesktop for mac has?  I looked into wine for the programs I want to run and was very frustrated. I feel like all the ratings in their application database were fabricated honesty. I've tried wine once every Ubuntu release since 8.10 and have never gotten it to work stably. Evaluate this power series Evaluate the sum  $$x+\frac{2}{3}x^3+\frac{2}{3}\cdot\frac{4}{5}x^5+\frac{2}{3}\cdot\frac{4}{5}\cdot\frac{6}{7}x^7+\dots$$  Totally no idea. I think this series may related to the $\sin x$ series because of those missing even powers. Another way of writing this series:  $$\sum_{k=0}^{\infty}\frac{(2k)!!}{(2k+1)!!}x^{2k+1}.$$ popping to root view in navigation controller I tried:   Launching Ubuntu Software Centre I typed in "air" and found "adobe air" It says "available from the 'maverick-partner' source. and has a button "use this source" I clicked "use this source", I saw a "in progress (1)" icon come up in the side bar, and disappear, but nothing happened/changed.   I'm stuck.  I have actually already added the maverick-partner source to apt so I could install sun-java6-jdk. Change Linux Mint to Ubuntu In normal line integration, from what I understand, you are measuring the area underneath $f(x,y)$ along a curve in the $x\text{-}y$ plane from point $a$ to point $b$.  But what is being measured with complex line integration, when you go from a point $z_1$ to a point $z_2$ in the complex plane?  With regular line integration I can see $f(x,y)$ maps $(x,y)$ to a point on the $z$ axis directly above above/below $(x,y)$.  But in the complex case, when you map from the domain $Z$ to the image $W$, you are mapping from $\mathbb{R^2}$ to $\mathbb{R^2}$ ...it is not mapping a point to 'directly above/below'...so I don't have any intuition of what is happening with complex line integration. power outage/frozen meat We were on vacation for a week. The neighbor said we were out of power the whole time.  We have a chest freezer full of beef. It thawed but remained in the freezer unopened the whole time. Is the meat bad if it is thawed but still cold? Can we refreeze it and eat it? postfix fails to send mail with "fatal: unknown service: smtp/tcp" How is offside determined in football? The offside rule on the pitch is often unclear and called suddenly. How do I know if a player is offside? I have a graph. This is my code.    \documentclass[10pt]{article}     \usepackage{pgf,tikz}     \usetikzlibrary{arrows,patterns}     \pagestyle{empty}      \definecolor{ttqqcc}{rgb}{0.2,0,0.8}     \definecolor{ffqqtt}{rgb}{1,0,0.2}     \definecolor{ttqqff}{rgb}{0.2,0,1}     \definecolor{uququq}{rgb}{0.25,0.25,0.25}      \begin{document}      \begin{tikzpicture}[line cap=round,line join=round,&gt;=triangle 45,x=1.0cm,y=1.0cm]      \draw[-&gt;] (-3.63,0) -- (3.67,0);     \foreach \x in {-3,-2,-1,1,2,3}       \draw[shift={(\x,0)}] (0pt,2pt) -- (0pt,-2pt)          node[below] {\footnotesize $\x$};     \draw[color=black] (3.48,0.07) node [anchor=south west] { $x$};      \draw[-&gt;] (0,-1.93) -- (0,5.57);     \foreach \y in {-1,1,2,3,4,5}       \draw[shift={(0,\y)}] (2pt,0pt) -- (-2pt,0pt)          node[left] {\footnotesize $\y$};     \draw[color=black] (0.06,5.19) node [anchor=west] { $y$};      \draw (0pt,-10pt) node[right] {\footnotesize $0$};      \clip(-3.63,-1.93) rectangle (3.67,5.57);     \draw[pattern color=ffqqtt,pattern=north east lines,fill opacity=0.1, smooth,samples=50,domain=0:1.0]      plot(\x,{\x^4-4*\x^2+3}) -- (1,0) -- (0,0) -- cycle;     \draw[pattern color=ttqqcc,pattern=crosshatch,fill opacity=0.1, smooth,samples=50,domain=1.0:1.7320508075688772]      plot(\x,{\x^4-4*\x^2+3}) -- (1.73,0) -- (1,0) -- cycle;      \begin{scope}[xscale=-1]     \draw[pattern color=ffqqtt,pattern=north east lines,fill opacity=0.1, smooth,samples=50,domain=0:1.0]        plot(\x,{\x^4-4*\x^2+3}) -- (1,0) -- (0,0) -- cycle;     \draw[pattern color=ttqqcc,pattern=crosshatch,fill opacity=0.1, smooth,samples=50,domain=1.0:1.7320508075688772]        plot(\x,{\x^4-4*\x^2+3}) -- (1.73,0) -- (1,0) -- cycle;     \end{scope}      \draw[smooth,samples=100,domain=-3.6342419080068153:3.665758091993186] plot(\x,{(\x)^4-4*(\x)^2+3});      \fill [color=uququq] (-1.73,0) circle (1.5pt);      \fill [color=uququq] (-1,0) circle (1.5pt);      \fill [color=uququq] (1,0) circle (1.5pt);      \fill [color=uququq] (1.73,0) circle (1.5pt);      \end{tikzpicture}     \end{document}   When I see the DVI output DVI, I have    And if I look at the PDF file, I have Completely clear all output from a Terminal window