I feel like I'm missing something obvious here, but....
I'm playing around, trying to do the standard deviation for my stats homework (don't worry, I already worked out the answer by hand), and I have
μ := 0.906
y = {0.343, 0.441, 0.189, 0.027}
Sqrt[\!\(
\*SubsuperscriptBox[\(∑\), \(i = 0\), \(3\)]\(
\*SuperscriptBox[\((i - μ)\), \(2\)]\
\*SubscriptBox[\(y\), \([i]\)]\)\)]
which looks like $ \sqrt{\sum _{i=0}^3 (i-\mu )^2 y_i} $
Now that looks like what I want, but it does not evaluate how I'd hope.
So I tried out $y_1$ on it's own, and just get the whole list followed by subscript 1, rather than the second (or third...) element.
Ok, so that's fine, if a little disappointing that I can't index into a vector as easily as that. But I can't for the life of me figure out how to cleanly achieve the goal of retrieving the ith element of a vector within an expression like this.
Sqrt[\!\( \*SubsuperscriptBox[\(\[Sum]\), \(i = 1\), \(3\)]\( \*SuperscriptBox[\((i - \[Mu])\), \(2\)]\ \*SubscriptBox[\(y\), \([\([i]\)]\)]\)\)]? $\endgroup$1, not0(2) you need to use[[i]]to refer toithPartof a list, (3)Partsyntaxy[[i]]also works in subscripts. (4) Much simpler formSqrt[Sum[(i - \[Mu])^2 y[[i]], {i, 1, 4}]]gives the same result. $\endgroup$iini-\[Mu]is the same as the part index, maybe you need to change the sum toSqrt[Sum[(i - 1 - \[Mu])^2 y[[i]], {i, 1, 4}]]? $\endgroup$