comparison doc/misc/calc.texi @ 108542:f69005ce0acc

calc.texi: Remove "\turnoffactive" commands throughout.
author Jay Belanger <jay.p.belanger@gmail.com>
date Thu, 13 May 2010 17:33:11 -0500
parents 3abe022e56e9
children 2f98c61bd2c1
comparison
equal deleted inserted replaced
108541:ce09b34d4a43 108542:f69005ce0acc
74 @newcount@calcclubpenalty @calcclubpenalty=1000 74 @newcount@calcclubpenalty @calcclubpenalty=1000
75 @ignore 75 @ignore
76 @newcount@calcpageno 76 @newcount@calcpageno
77 @newtoks@calcoldeverypar @calcoldeverypar=@everypar 77 @newtoks@calcoldeverypar @calcoldeverypar=@everypar
78 @everypar={@calceverypar@the@calcoldeverypar} 78 @everypar={@calceverypar@the@calcoldeverypar}
79 @ifx@turnoffactive@undefinedzzz@def@turnoffactive{}@fi
80 @ifx@ninett@undefinedzzz@font@ninett=cmtt9@fi 79 @ifx@ninett@undefinedzzz@font@ninett=cmtt9@fi
81 @catcode`@\=0 \catcode`\@=11 80 @catcode`@\=0 \catcode`\@=11
82 \r@ggedbottomtrue 81 \r@ggedbottomtrue
83 \catcode`\@=0 @catcode`@\=@active 82 \catcode`\@=0 @catcode`@\=@active
84 @end ignore 83 @end ignore
1802 6 * 7 1801 6 * 7
1803 @end group 1802 @end group
1804 @end example 1803 @end example
1805 @end ifnottex 1804 @end ifnottex
1806 @tex 1805 @tex
1807 \turnoffactive
1808 \beforedisplay 1806 \beforedisplay
1809 $$ 2 + { 3 \times 4 \times 5 \over 6 \times 7^8 } - 9 $$ 1807 $$ 2 + { 3 \times 4 \times 5 \over 6 \times 7^8 } - 9 $$
1810 \afterdisplay 1808 \afterdisplay
1811 @end tex 1809 @end tex
1812 1810
3356 7a + 6b = 3 3354 7a + 6b = 3
3357 @end example 3355 @end example
3358 @end group 3356 @end group
3359 @end ifnottex 3357 @end ifnottex
3360 @tex 3358 @tex
3361 \turnoffactive
3362 \beforedisplayh 3359 \beforedisplayh
3363 $$ \openup1\jot \tabskip=0pt plus1fil 3360 $$ \openup1\jot \tabskip=0pt plus1fil
3364 \halign to\displaywidth{\tabskip=0pt 3361 \halign to\displaywidth{\tabskip=0pt
3365 $\hfil#$&$\hfil{}#{}$& 3362 $\hfil#$&$\hfil{}#{}$&
3366 $\hfil#$&$\hfil{}#{}$& 3363 $\hfil#$&$\hfil{}#{}$&
3383 [ 7, 6, 0 ] ] [ c ] ] [ 3 ] ] 3380 [ 7, 6, 0 ] ] [ c ] ] [ 3 ] ]
3384 @end example 3381 @end example
3385 @end group 3382 @end group
3386 @end ifnottex 3383 @end ifnottex
3387 @tex 3384 @tex
3388 \turnoffactive
3389 \beforedisplay 3385 \beforedisplay
3390 $$ \pmatrix{ 1 & 2 & 3 \cr 4 & 5 & 6 \cr 7 & 6 & 0 } 3386 $$ \pmatrix{ 1 & 2 & 3 \cr 4 & 5 & 6 \cr 7 & 6 & 0 }
3391 \times 3387 \times
3392 \pmatrix{ a \cr b \cr c } = \pmatrix{ 6 \cr 2 \cr 3 } 3388 \pmatrix{ a \cr b \cr c } = \pmatrix{ 6 \cr 2 \cr 3 }
3393 $$ 3389 $$
3455 x + b y = 10 3451 x + b y = 10
3456 @end example 3452 @end example
3457 @end group 3453 @end group
3458 @end ifnottex 3454 @end ifnottex
3459 @tex 3455 @tex
3460 \turnoffactive
3461 \beforedisplay 3456 \beforedisplay
3462 $$ \eqalign{ x &+ a y = 6 \cr 3457 $$ \eqalign{ x &+ a y = 6 \cr
3463 x &+ b y = 10} 3458 x &+ b y = 10}
3464 $$ 3459 $$
3465 \afterdisplay 3460 \afterdisplay
3481 on the left by the transpose of @expr{A}: 3476 on the left by the transpose of @expr{A}:
3482 @ifnottex 3477 @ifnottex
3483 @samp{trn(A)*A*X = trn(A)*B}. 3478 @samp{trn(A)*A*X = trn(A)*B}.
3484 @end ifnottex 3479 @end ifnottex
3485 @tex 3480 @tex
3486 \turnoffactive
3487 $A^T A \, X = A^T B$, where $A^T$ is the transpose \samp{trn(A)}. 3481 $A^T A \, X = A^T B$, where $A^T$ is the transpose \samp{trn(A)}.
3488 @end tex 3482 @end tex
3489 Now 3483 Now
3490 @texline @math{A^T A} 3484 @texline @math{A^T A}
3491 @infoline @expr{trn(A)*A} 3485 @infoline @expr{trn(A)*A}
3504 2a + 4b + 6c = 11 3498 2a + 4b + 6c = 11
3505 @end example 3499 @end example
3506 @end group 3500 @end group
3507 @end ifnottex 3501 @end ifnottex
3508 @tex 3502 @tex
3509 \turnoffactive
3510 \beforedisplayh 3503 \beforedisplayh
3511 $$ \openup1\jot \tabskip=0pt plus1fil 3504 $$ \openup1\jot \tabskip=0pt plus1fil
3512 \halign to\displaywidth{\tabskip=0pt 3505 \halign to\displaywidth{\tabskip=0pt
3513 $\hfil#$&$\hfil{}#{}$& 3506 $\hfil#$&$\hfil{}#{}$&
3514 $\hfil#$&$\hfil{}#{}$& 3507 $\hfil#$&$\hfil{}#{}$&
3776 @example 3769 @example
3777 m = (N sum(x y) - sum(x) sum(y)) / (N sum(x^2) - sum(x)^2) 3770 m = (N sum(x y) - sum(x) sum(y)) / (N sum(x^2) - sum(x)^2)
3778 @end example 3771 @end example
3779 @end ifnottex 3772 @end ifnottex
3780 @tex 3773 @tex
3781 \turnoffactive
3782 \beforedisplay 3774 \beforedisplay
3783 $$ m = {N \sum x y - \sum x \sum y \over 3775 $$ m = {N \sum x y - \sum x \sum y \over
3784 N \sum x^2 - \left( \sum x \right)^2} $$ 3776 N \sum x^2 - \left( \sum x \right)^2} $$
3785 \afterdisplay 3777 \afterdisplay
3786 @end tex 3778 @end tex
3818 These are @samp{sum(x)}, @samp{sum(x^2)}, @samp{sum(y)}, and @samp{sum(x y)}, 3810 These are @samp{sum(x)}, @samp{sum(x^2)}, @samp{sum(y)}, and @samp{sum(x y)},
3819 respectively. (We could have used @kbd{*} to compute @samp{sum(x^2)} and 3811 respectively. (We could have used @kbd{*} to compute @samp{sum(x^2)} and
3820 @samp{sum(x y)}.) 3812 @samp{sum(x y)}.)
3821 @end ifnottex 3813 @end ifnottex
3822 @tex 3814 @tex
3823 \turnoffactive
3824 These are $\sum x$, $\sum x^2$, $\sum y$, and $\sum x y$, 3815 These are $\sum x$, $\sum x^2$, $\sum y$, and $\sum x y$,
3825 respectively. (We could have used \kbd{*} to compute $\sum x^2$ and 3816 respectively. (We could have used \kbd{*} to compute $\sum x^2$ and
3826 $\sum x y$.) 3817 $\sum x y$.)
3827 @end tex 3818 @end tex
3828 3819
3872 @example 3863 @example
3873 b = (sum(y) - m sum(x)) / N 3864 b = (sum(y) - m sum(x)) / N
3874 @end example 3865 @end example
3875 @end ifnottex 3866 @end ifnottex
3876 @tex 3867 @tex
3877 \turnoffactive
3878 \beforedisplay 3868 \beforedisplay
3879 $$ b = {\sum y - m \sum x \over N} $$ 3869 $$ b = {\sum y - m \sum x \over N} $$
3880 \afterdisplay 3870 \afterdisplay
3881 \vskip10pt 3871 \vskip10pt
3882 @end tex 3872 @end tex
5221 (h/3) * (f(a) + 4 f(a+h) + 2 f(a+2h) + 4 f(a+3h) + ... 5211 (h/3) * (f(a) + 4 f(a+h) + 2 f(a+2h) + 4 f(a+3h) + ...
5222 + 2 f(a+(n-2)*h) + 4 f(a+(n-1)*h) + f(a+n*h)) 5212 + 2 f(a+(n-2)*h) + 4 f(a+(n-1)*h) + f(a+n*h))
5223 @end example 5213 @end example
5224 @end ifnottex 5214 @end ifnottex
5225 @tex 5215 @tex
5226 \turnoffactive
5227 \beforedisplay 5216 \beforedisplay
5228 $$ \displaylines{ 5217 $$ \displaylines{
5229 \qquad {h \over 3} (f(a) + 4 f(a+h) + 2 f(a+2h) + 4 f(a+3h) + \cdots 5218 \qquad {h \over 3} (f(a) + 4 f(a+h) + 2 f(a+2h) + 4 f(a+3h) + \cdots
5230 \hfill \cr \hfill {} + 2 f(a+(n-2)h) + 4 f(a+(n-1)h) + f(a+n h)) \qquad 5219 \hfill \cr \hfill {} + 2 f(a+(n-2)h) + 4 f(a+(n-1)h) + f(a+n h)) \qquad
5231 } $$ 5220 } $$
5243 h * (f(a) + f(a+h) + f(a+2h) + f(a+3h) + ... 5232 h * (f(a) + f(a+h) + f(a+2h) + f(a+3h) + ...
5244 + f(a+(n-2)*h) + f(a+(n-1)*h)) 5233 + f(a+(n-2)*h) + f(a+(n-1)*h))
5245 @end example 5234 @end example
5246 @end ifnottex 5235 @end ifnottex
5247 @tex 5236 @tex
5248 \turnoffactive
5249 \beforedisplay 5237 \beforedisplay
5250 $$ h (f(a) + f(a+h) + f(a+2h) + f(a+3h) + \cdots 5238 $$ h (f(a) + f(a+h) + f(a+2h) + f(a+3h) + \cdots
5251 + f(a+(n-2)h) + f(a+(n-1)h)) $$ 5239 + f(a+(n-2)h) + f(a+(n-1)h)) $$
5252 \afterdisplay 5240 \afterdisplay
5253 @end tex 5241 @end tex
5684 @example 5672 @example
5685 cos(x) = 1 - x^2 / 2! + x^4 / 4! - x^6 / 6! + ... 5673 cos(x) = 1 - x^2 / 2! + x^4 / 4! - x^6 / 6! + ...
5686 @end example 5674 @end example
5687 @end ifnottex 5675 @end ifnottex
5688 @tex 5676 @tex
5689 \turnoffactive
5690 \beforedisplay 5677 \beforedisplay
5691 $$ \cos x = 1 - {x^2 \over 2!} + {x^4 \over 4!} - {x^6 \over 6!} + \cdots $$ 5678 $$ \cos x = 1 - {x^2 \over 2!} + {x^4 \over 4!} - {x^6 \over 6!} + \cdots $$
5692 \afterdisplay 5679 \afterdisplay
5693 @end tex 5680 @end tex
5694 5681
5702 @example 5689 @example
5703 cos(x) = 1 - x^2 / 2! + O(x^3) 5690 cos(x) = 1 - x^2 / 2! + O(x^3)
5704 @end example 5691 @end example
5705 @end ifnottex 5692 @end ifnottex
5706 @tex 5693 @tex
5707 \turnoffactive
5708 \beforedisplay 5694 \beforedisplay
5709 $$ \cos x = 1 - {x^2 \over 2!} + O(x^3) $$ 5695 $$ \cos x = 1 - {x^2 \over 2!} + O(x^3) $$
5710 \afterdisplay 5696 \afterdisplay
5711 @end tex 5697 @end tex
5712 5698
6334 s(n,0) = 0 for n > 0, 6320 s(n,0) = 0 for n > 0,
6335 s(n+1,m) = s(n,m-1) - n s(n,m) for n >= m >= 1. 6321 s(n+1,m) = s(n,m-1) - n s(n,m) for n >= m >= 1.
6336 @end example 6322 @end example
6337 @end ifnottex 6323 @end ifnottex
6338 @tex 6324 @tex
6339 \turnoffactive
6340 \beforedisplay 6325 \beforedisplay
6341 $$ \eqalign{ s(n,n) &= 1 \qquad \hbox{for } n \ge 0, \cr 6326 $$ \eqalign{ s(n,n) &= 1 \qquad \hbox{for } n \ge 0, \cr
6342 s(n,0) &= 0 \qquad \hbox{for } n > 0, \cr 6327 s(n,0) &= 0 \qquad \hbox{for } n > 0, \cr
6343 s(n+1,m) &= s(n,m-1) - n \, s(n,m) \qquad 6328 s(n+1,m) &= s(n,m-1) - n \, s(n,m) \qquad
6344 \hbox{for } n \ge m \ge 1.} 6329 \hbox{for } n \ge m \ge 1.}
6873 x + b y = 10 6858 x + b y = 10
6874 @end group 6859 @end group
6875 @end example 6860 @end example
6876 @end ifnottex 6861 @end ifnottex
6877 @tex 6862 @tex
6878 \turnoffactive
6879 \beforedisplay 6863 \beforedisplay
6880 $$ \eqalign{ x &+ a y = 6 \cr 6864 $$ \eqalign{ x &+ a y = 6 \cr
6881 x &+ b y = 10} 6865 x &+ b y = 10}
6882 $$ 6866 $$
6883 \afterdisplay 6867 \afterdisplay
6937 2a + 4b + 6c = 11 6921 2a + 4b + 6c = 11
6938 @end group 6922 @end group
6939 @end example 6923 @end example
6940 @end ifnottex 6924 @end ifnottex
6941 @tex 6925 @tex
6942 \turnoffactive
6943 \beforedisplayh 6926 \beforedisplayh
6944 $$ \openup1\jot \tabskip=0pt plus1fil 6927 $$ \openup1\jot \tabskip=0pt plus1fil
6945 \halign to\displaywidth{\tabskip=0pt 6928 \halign to\displaywidth{\tabskip=0pt
6946 $\hfil#$&$\hfil{}#{}$& 6929 $\hfil#$&$\hfil{}#{}$&
6947 $\hfil#$&$\hfil{}#{}$& 6930 $\hfil#$&$\hfil{}#{}$&
7072 @example 7055 @example
7073 m*x + b*1 = y 7056 m*x + b*1 = y
7074 @end example 7057 @end example
7075 @end ifnottex 7058 @end ifnottex
7076 @tex 7059 @tex
7077 \turnoffactive
7078 \beforedisplay 7060 \beforedisplay
7079 $$ m \times x + b \times 1 = y $$ 7061 $$ m \times x + b \times 1 = y $$
7080 \afterdisplay 7062 \afterdisplay
7081 @end tex 7063 @end tex
7082 7064
7863 @example 7845 @example
7864 3 (3 a + b - 511 m) + c - 511 n 7846 3 (3 a + b - 511 m) + c - 511 n
7865 @end example 7847 @end example
7866 @end ifnottex 7848 @end ifnottex
7867 @tex 7849 @tex
7868 \turnoffactive
7869 \beforedisplay 7850 \beforedisplay
7870 $$ 3 (3 a + b - 511 m) + c - 511 n $$ 7851 $$ 3 (3 a + b - 511 m) + c - 511 n $$
7871 \afterdisplay 7852 \afterdisplay
7872 @end tex 7853 @end tex
7873 7854
7879 @example 7860 @example
7880 9 a + 3 b + c - 511*3 m - 511 n 7861 9 a + 3 b + c - 511*3 m - 511 n
7881 @end example 7862 @end example
7882 @end ifnottex 7863 @end ifnottex
7883 @tex 7864 @tex
7884 \turnoffactive
7885 \beforedisplay 7865 \beforedisplay
7886 $$ 9 a + 3 b + c - 511\times3 m - 511 n $$ 7866 $$ 9 a + 3 b + c - 511\times3 m - 511 n $$
7887 \afterdisplay 7867 \afterdisplay
7888 @end tex 7868 @end tex
7889 7869
7897 @example 7877 @example
7898 9 a + 3 b + c - 511 n' 7878 9 a + 3 b + c - 511 n'
7899 @end example 7879 @end example
7900 @end ifnottex 7880 @end ifnottex
7901 @tex 7881 @tex
7902 \turnoffactive
7903 \beforedisplay 7882 \beforedisplay
7904 $$ 9 a + 3 b + c - 511 n^{\prime} $$ 7883 $$ 9 a + 3 b + c - 511 n^{\prime} $$
7905 \afterdisplay 7884 \afterdisplay
7906 @end tex 7885 @end tex
7907 7886
14406 [(3, 4), 3:4, 3 +/- 4, [3 .. inf)] 14385 [(3, 4), 3:4, 3 +/- 4, [3 .. inf)]
14407 [3 + 4i, @{3 \over 4@}, 3 \pm 4, [3 \ldots \infty)] 14386 [3 + 4i, @{3 \over 4@}, 3 \pm 4, [3 \ldots \infty)]
14408 @end group 14387 @end group
14409 @end example 14388 @end example
14410 @tex 14389 @tex
14411 \turnoffactive
14412 $$ [3 + 4i, {3 \over 4}, 3 \pm 4, [ 3 \ldots \infty)] $$ 14390 $$ [3 + 4i, {3 \over 4}, 3 \pm 4, [ 3 \ldots \infty)] $$
14413 @end tex 14391 @end tex
14414 @sp 1 14392 @sp 1
14415 14393
14416 @example 14394 @example
14432 [\sin@{a@}, \sin@{2 a@}, \sin(2 + a), 14410 [\sin@{a@}, \sin@{2 a@}, \sin(2 + a),
14433 \sin\left( @{a \over b@} \right)] 14411 \sin\left( @{a \over b@} \right)]
14434 @end group 14412 @end group
14435 @end example 14413 @end example
14436 @tex 14414 @tex
14437 \turnoffactive
14438 $$ [\sin{a}, \sin{2 a}, \sin(2 + a), \sin\left( {a \over b} \right)] $$ 14415 $$ [\sin{a}, \sin{2 a}, \sin(2 + a), \sin\left( {a \over b} \right)] $$
14439 @end tex 14416 @end tex
14440 @sp 2 14417 @sp 2
14441 14418
14442 First with plain @kbd{d T}, then with @kbd{C-u d T}, then finally with 14419 First with plain @kbd{d T}, then with @kbd{C-u d T}, then finally with
14465 2 + 3 => 5 14442 2 + 3 => 5
14466 \evalto 2 + 3 \to 5 14443 \evalto 2 + 3 \to 5
14467 @end group 14444 @end group
14468 @end example 14445 @end example
14469 @tex 14446 @tex
14470 \turnoffactive
14471 $$ 2 + 3 \to 5 $$ 14447 $$ 2 + 3 \to 5 $$
14472 $$ 5 $$ 14448 $$ 5 $$
14473 @end tex 14449 @end tex
14474 @sp 2 14450 @sp 2
14475 14451
14480 [2 + 3 => 5, a / 2 => (b + c) / 2] 14456 [2 + 3 => 5, a / 2 => (b + c) / 2]
14481 [@{2 + 3 \to 5@}, @{@{a \over 2@} \to @{b + c \over 2@}@}] 14457 [@{2 + 3 \to 5@}, @{@{a \over 2@} \to @{b + c \over 2@}@}]
14482 @end group 14458 @end group
14483 @end example 14459 @end example
14484 @tex 14460 @tex
14485 \turnoffactive
14486 $$ [{2 + 3 \to 5}, {{a \over 2} \to {b + c \over 2}}] $$ 14461 $$ [{2 + 3 \to 5}, {{a \over 2} \to {b + c \over 2}}] $$
14487 {\let\to\Rightarrow 14462 {\let\to\Rightarrow
14488 $$ [{2 + 3 \to 5}, {{a \over 2} \to {b + c \over 2}}] $$} 14463 $$ [{2 + 3 \to 5}, {{a \over 2} \to {b + c \over 2}}] $$}
14489 @end tex 14464 @end tex
14490 @sp 2 14465 @sp 2
14497 \matrix@{ @{a \over b@} & 0 \\ 0 & 2^@{(x + 1)@} @} 14472 \matrix@{ @{a \over b@} & 0 \\ 0 & 2^@{(x + 1)@} @}
14498 \pmatrix@{ @{a \over b@} & 0 \\ 0 & 2^@{(x + 1)@} @} 14473 \pmatrix@{ @{a \over b@} & 0 \\ 0 & 2^@{(x + 1)@} @}
14499 @end group 14474 @end group
14500 @end example 14475 @end example
14501 @tex 14476 @tex
14502 \turnoffactive
14503 $$ \matrix{ {a \over b} & 0 \cr 0 & 2^{(x + 1)} } $$ 14477 $$ \matrix{ {a \over b} & 0 \cr 0 & 2^{(x + 1)} } $$
14504 $$ \pmatrix{ {a \over b} & 0 \cr 0 & 2^{(x + 1)} } $$ 14478 $$ \pmatrix{ {a \over b} & 0 \cr 0 & 2^{(x + 1)} } $$
14505 @end tex 14479 @end tex
14506 @sp 2 14480 @sp 2
14507 @end iftex 14481 @end iftex
17933 ddb(cost, salv, life, per) = --------, book = cost - depreciation so far 17907 ddb(cost, salv, life, per) = --------, book = cost - depreciation so far
17934 life 17908 life
17935 @end example 17909 @end example
17936 @end ifnottex 17910 @end ifnottex
17937 @tex 17911 @tex
17938 \turnoffactive
17939 $$ \code{fv}(r, n, p) = p { (1 + r)^n - 1 \over r } $$ 17912 $$ \code{fv}(r, n, p) = p { (1 + r)^n - 1 \over r } $$
17940 $$ \code{fvb}(r, n, p) = p { ((1 + r)^n - 1) (1 + r) \over r } $$ 17913 $$ \code{fvb}(r, n, p) = p { ((1 + r)^n - 1) (1 + r) \over r } $$
17941 $$ \code{fvl}(r, n, p) = p (1 + r)^n $$ 17914 $$ \code{fvl}(r, n, p) = p (1 + r)^n $$
17942 $$ \code{pv}(r, n, p) = p { 1 - (1 + r)^{-n} \over r } $$ 17915 $$ \code{pv}(r, n, p) = p { 1 - (1 + r)^{-n} \over r } $$
17943 $$ \code{pvb}(r, n, p) = p { (1 - (1 + r)^{-n}) (1 + r) \over r } $$ 17916 $$ \code{pvb}(r, n, p) = p { (1 - (1 + r)^{-n}) (1 + r) \over r } $$
18589 (where @expr{g} and @expr{G} represent the lower- and upper-case Greek 18562 (where @expr{g} and @expr{G} represent the lower- and upper-case Greek
18590 letter gamma). You can obtain these using the @kbd{H f G} [@code{gammag}] 18563 letter gamma). You can obtain these using the @kbd{H f G} [@code{gammag}]
18591 and @kbd{H I f G} [@code{gammaG}] commands. 18564 and @kbd{H I f G} [@code{gammaG}] commands.
18592 @end ifnottex 18565 @end ifnottex
18593 @tex 18566 @tex
18594 \turnoffactive
18595 The functions corresponding to the integrals that define $P(a,x)$ 18567 The functions corresponding to the integrals that define $P(a,x)$
18596 and $Q(a,x)$ but without the normalizing $1/\Gamma(a)$ 18568 and $Q(a,x)$ but without the normalizing $1/\Gamma(a)$
18597 factor are called $\gamma(a,x)$ and $\Gamma(a,x)$, respectively. 18569 factor are called $\gamma(a,x)$ and $\Gamma(a,x)$, respectively.
18598 You can obtain these using the \kbd{H f G} [\code{gammag}] and 18570 You can obtain these using the \kbd{H f G} [\code{gammag}] and
18599 \kbd{I H f G} [\code{gammaG}] commands. 18571 \kbd{I H f G} [\code{gammaG}] commands.
20557 @infoline @samp{x +/- s}, 20529 @infoline @samp{x +/- s},
20558 this is the weighted mean of the @expr{x} values with weights 20530 this is the weighted mean of the @expr{x} values with weights
20559 @texline @math{1 /\sigma^2}. 20531 @texline @math{1 /\sigma^2}.
20560 @infoline @expr{1 / s^2}. 20532 @infoline @expr{1 / s^2}.
20561 @tex 20533 @tex
20562 \turnoffactive
20563 $$ \mu = { \displaystyle \sum { x_i \over \sigma_i^2 } \over 20534 $$ \mu = { \displaystyle \sum { x_i \over \sigma_i^2 } \over
20564 \displaystyle \sum { 1 \over \sigma_i^2 } } $$ 20535 \displaystyle \sum { 1 \over \sigma_i^2 } } $$
20565 @end tex 20536 @end tex
20566 If the inputs are not error forms, this is simply the sum of the 20537 If the inputs are not error forms, this is simply the sum of the
20567 values divided by the count of the values. 20538 values divided by the count of the values.
20591 the mean. If the inputs are error forms, the error is the square 20562 the mean. If the inputs are error forms, the error is the square
20592 root of the reciprocal of the sum of the reciprocals of the squares 20563 root of the reciprocal of the sum of the reciprocals of the squares
20593 of the input errors. (I.e., the variance is the reciprocal of the 20564 of the input errors. (I.e., the variance is the reciprocal of the
20594 sum of the reciprocals of the variances.) 20565 sum of the reciprocals of the variances.)
20595 @tex 20566 @tex
20596 \turnoffactive
20597 $$ \sigma_\mu^2 = {1 \over \displaystyle \sum {1 \over \sigma_i^2}} $$ 20567 $$ \sigma_\mu^2 = {1 \over \displaystyle \sum {1 \over \sigma_i^2}} $$
20598 @end tex 20568 @end tex
20599 If the inputs are plain 20569 If the inputs are plain
20600 numbers, the error is equal to the standard deviation of the values 20570 numbers, the error is equal to the standard deviation of the values
20601 divided by the square root of the number of values. (This works 20571 divided by the square root of the number of values. (This works
20602 out to be equivalent to calculating the standard deviation and 20572 out to be equivalent to calculating the standard deviation and
20603 then assuming each value's error is equal to this standard 20573 then assuming each value's error is equal to this standard
20604 deviation.) 20574 deviation.)
20605 @tex 20575 @tex
20606 \turnoffactive
20607 $$ \sigma_\mu^2 = {\sigma^2 \over N} $$ 20576 $$ \sigma_\mu^2 = {\sigma^2 \over N} $$
20608 @end tex 20577 @end tex
20609 20578
20610 @kindex H u M 20579 @kindex H u M
20611 @pindex calc-vector-median 20580 @pindex calc-vector-median
20634 The @kbd{H I u M} (@code{calc-vector-harmonic-mean}) [@code{vhmean}] 20603 The @kbd{H I u M} (@code{calc-vector-harmonic-mean}) [@code{vhmean}]
20635 command computes the harmonic mean of the data values. This is 20604 command computes the harmonic mean of the data values. This is
20636 defined as the reciprocal of the arithmetic mean of the reciprocals 20605 defined as the reciprocal of the arithmetic mean of the reciprocals
20637 of the values. 20606 of the values.
20638 @tex 20607 @tex
20639 \turnoffactive
20640 $$ { N \over \displaystyle \sum {1 \over x_i} } $$ 20608 $$ { N \over \displaystyle \sum {1 \over x_i} } $$
20641 @end tex 20609 @end tex
20642 20610
20643 @kindex u G 20611 @kindex u G
20644 @pindex calc-vector-geometric-mean 20612 @pindex calc-vector-geometric-mean
20648 command computes the geometric mean of the data values. This 20616 command computes the geometric mean of the data values. This
20649 is the @var{n}th root of the product of the values. This is also 20617 is the @var{n}th root of the product of the values. This is also
20650 equal to the @code{exp} of the arithmetic mean of the logarithms 20618 equal to the @code{exp} of the arithmetic mean of the logarithms
20651 of the data values. 20619 of the data values.
20652 @tex 20620 @tex
20653 \turnoffactive
20654 $$ \exp \left ( \sum { \ln x_i } \right ) = 20621 $$ \exp \left ( \sum { \ln x_i } \right ) =
20655 \left ( \prod { x_i } \right)^{1 / N} $$ 20622 \left ( \prod { x_i } \right)^{1 / N} $$
20656 @end tex 20623 @end tex
20657 20624
20658 @kindex H u G 20625 @kindex H u G
20660 The @kbd{H u G} [@code{agmean}] command computes the ``arithmetic-geometric 20627 The @kbd{H u G} [@code{agmean}] command computes the ``arithmetic-geometric
20661 mean'' of two numbers taken from the stack. This is computed by 20628 mean'' of two numbers taken from the stack. This is computed by
20662 replacing the two numbers with their arithmetic mean and geometric 20629 replacing the two numbers with their arithmetic mean and geometric
20663 mean, then repeating until the two values converge. 20630 mean, then repeating until the two values converge.
20664 @tex 20631 @tex
20665 \turnoffactive
20666 $$ a_{i+1} = { a_i + b_i \over 2 } , \qquad b_{i+1} = \sqrt{a_i b_i} $$ 20632 $$ a_{i+1} = { a_i + b_i \over 2 } , \qquad b_{i+1} = \sqrt{a_i b_i} $$
20667 @end tex 20633 @end tex
20668 20634
20669 @cindex Root-mean-square 20635 @cindex Root-mean-square
20670 Another commonly used mean, the RMS (root-mean-square), can be computed 20636 Another commonly used mean, the RMS (root-mean-square), can be computed
20683 as weights just as for @kbd{u M}. This is the @emph{sample} standard 20649 as weights just as for @kbd{u M}. This is the @emph{sample} standard
20684 deviation, whose value is the square root of the sum of the squares of 20650 deviation, whose value is the square root of the sum of the squares of
20685 the differences between the values and the mean of the @expr{N} values, 20651 the differences between the values and the mean of the @expr{N} values,
20686 divided by @expr{N-1}. 20652 divided by @expr{N-1}.
20687 @tex 20653 @tex
20688 \turnoffactive
20689 $$ \sigma^2 = {1 \over N - 1} \sum (x_i - \mu)^2 $$ 20654 $$ \sigma^2 = {1 \over N - 1} \sum (x_i - \mu)^2 $$
20690 @end tex 20655 @end tex
20691 20656
20692 This function also applies to distributions. The standard deviation 20657 This function also applies to distributions. The standard deviation
20693 of a single error form is simply the error part. The standard deviation 20658 of a single error form is simply the error part. The standard deviation
20710 data values in the distribution; the sample standard deviation 20675 data values in the distribution; the sample standard deviation
20711 is used when the input represents a sample of the set of all 20676 is used when the input represents a sample of the set of all
20712 data values, so that the mean computed from the input is itself 20677 data values, so that the mean computed from the input is itself
20713 only an estimate of the true mean. 20678 only an estimate of the true mean.
20714 @tex 20679 @tex
20715 \turnoffactive
20716 $$ \sigma^2 = {1 \over N} \sum (x_i - \mu)^2 $$ 20680 $$ \sigma^2 = {1 \over N} \sum (x_i - \mu)^2 $$
20717 @end tex 20681 @end tex
20718 20682
20719 For error forms and continuous intervals, @code{vpsdev} works 20683 For error forms and continuous intervals, @code{vpsdev} works
20720 exactly like @code{vsdev}. For integer intervals, it computes the 20684 exactly like @code{vsdev}. For integer intervals, it computes the
20775 errors are used as weight factors. If both @var{x} and @var{y} 20739 errors are used as weight factors. If both @var{x} and @var{y}
20776 are composed of error forms, the error for a given data point 20740 are composed of error forms, the error for a given data point
20777 is taken as the square root of the sum of the squares of the two 20741 is taken as the square root of the sum of the squares of the two
20778 input errors. 20742 input errors.
20779 @tex 20743 @tex
20780 \turnoffactive
20781 $$ \sigma_{x\!y}^2 = {1 \over N-1} \sum (x_i - \mu_x) (y_i - \mu_y) $$ 20744 $$ \sigma_{x\!y}^2 = {1 \over N-1} \sum (x_i - \mu_x) (y_i - \mu_y) $$
20782 $$ \sigma_{x\!y}^2 = 20745 $$ \sigma_{x\!y}^2 =
20783 {\displaystyle {1 \over N-1} 20746 {\displaystyle {1 \over N-1}
20784 \sum {(x_i - \mu_x) (y_i - \mu_y) \over \sigma_i^2} 20747 \sum {(x_i - \mu_x) (y_i - \mu_y) \over \sigma_i^2}
20785 \over \displaystyle {1 \over N} \sum {1 \over \sigma_i^2}} 20748 \over \displaystyle {1 \over N} \sum {1 \over \sigma_i^2}}
20803 command computes the linear correlation coefficient of two vectors. 20766 command computes the linear correlation coefficient of two vectors.
20804 This is defined by the covariance of the vectors divided by the 20767 This is defined by the covariance of the vectors divided by the
20805 product of their standard deviations. (There is no difference 20768 product of their standard deviations. (There is no difference
20806 between sample or population statistics here.) 20769 between sample or population statistics here.)
20807 @tex 20770 @tex
20808 \turnoffactive
20809 $$ r_{x\!y} = { \sigma_{x\!y}^2 \over \sigma_x^2 \sigma_y^2 } $$ 20771 $$ r_{x\!y} = { \sigma_{x\!y}^2 \over \sigma_x^2 \sigma_y^2 } $$
20810 @end tex 20772 @end tex
20811 20773
20812 @node Reducing and Mapping, Vector and Matrix Formats, Statistical Operations, Matrix Functions 20774 @node Reducing and Mapping, Vector and Matrix Formats, Statistical Operations, Matrix Functions
20813 @section Reducing and Mapping Vectors 20775 @section Reducing and Mapping Vectors
24359 [ 5, 7, 9, 11, 13 ] ] 24321 [ 5, 7, 9, 11, 13 ] ]
24360 @end group 24322 @end group
24361 @end example 24323 @end example
24362 @end ifnottex 24324 @end ifnottex
24363 @tex 24325 @tex
24364 \turnoffactive
24365 \turnoffactive
24366 \beforedisplay 24326 \beforedisplay
24367 $$ \pmatrix{ 1 & 2 & 3 & 4 & 5 \cr 24327 $$ \pmatrix{ 1 & 2 & 3 & 4 & 5 \cr
24368 5 & 7 & 9 & 11 & 13 } 24328 5 & 7 & 9 & 11 & 13 }
24369 $$ 24329 $$
24370 \afterdisplay 24330 \afterdisplay
24420 @example 24380 @example
24421 chi^2 = sum((y_i - (a + b x_i))^2, i, 1, N) 24381 chi^2 = sum((y_i - (a + b x_i))^2, i, 1, N)
24422 @end example 24382 @end example
24423 @end ifnottex 24383 @end ifnottex
24424 @tex 24384 @tex
24425 \turnoffactive
24426 \beforedisplay 24385 \beforedisplay
24427 $$ \chi^2 = \sum_{i=1}^N (y_i - (a + b x_i))^2 $$ 24386 $$ \chi^2 = \sum_{i=1}^N (y_i - (a + b x_i))^2 $$
24428 \afterdisplay 24387 \afterdisplay
24429 @end tex 24388 @end tex
24430 24389
24611 @example 24570 @example
24612 chi^2 = sum(((y_i - (a + b x_i)) / sigma_i)^2, i, 1, N) 24571 chi^2 = sum(((y_i - (a + b x_i)) / sigma_i)^2, i, 1, N)
24613 @end example 24572 @end example
24614 @end ifnottex 24573 @end ifnottex
24615 @tex 24574 @tex
24616 \turnoffactive
24617 \beforedisplay 24575 \beforedisplay
24618 $$ \chi^2 = \sum_{i=1}^N \left(y_i - (a + b x_i) \over \sigma_i\right)^2 $$ 24576 $$ \chi^2 = \sum_{i=1}^N \left(y_i - (a + b x_i) \over \sigma_i\right)^2 $$
24619 \afterdisplay 24577 \afterdisplay
24620 @end tex 24578 @end tex
24621 24579
25386 enter a blank line at any of these prompts, that prompt and 25344 enter a blank line at any of these prompts, that prompt and
25387 any later ones are answered by reading additional elements from 25345 any later ones are answered by reading additional elements from
25388 the stack. Thus, @kbd{' k^2 @key{RET} ' k @key{RET} 1 @key{RET} 5 @key{RET} a + @key{RET}} 25346 the stack. Thus, @kbd{' k^2 @key{RET} ' k @key{RET} 1 @key{RET} 5 @key{RET} a + @key{RET}}
25389 produces the result 55. 25347 produces the result 55.
25390 @tex 25348 @tex
25391 \turnoffactive
25392 $$ \sum_{k=1}^5 k^2 = 55 $$ 25349 $$ \sum_{k=1}^5 k^2 = 55 $$
25393 @end tex 25350 @end tex
25394 25351
25395 The choice of index variable is arbitrary, but it's best not to 25352 The choice of index variable is arbitrary, but it's best not to
25396 use a variable with a stored value. In particular, while 25353 use a variable with a stored value. In particular, while