;;; calc-stat.el --- statistical functions for Calc
-;; Copyright (C) 1990-1993, 2001-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2016 Free Software Foundation, Inc.
;; Author: David Gillespie <daveg@synaptics.com>
-;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
;; This file is part of GNU Emacs.
(calc-vector-op "meae" 'calcFunc-vmeane arg)
(calc-vector-op "mean" 'calcFunc-vmean arg)))))
+(defun calc-vector-rms (arg)
+ (interactive "P")
+ (calc-slow-wrapper
+ (calc-vector-op "rms" 'calcFunc-rms arg)))
+
(defun calc-vector-mean-error (arg)
(interactive "P")
(calc-invert-func)
suminvsqrwts))
(math-div (calcFunc-reduce '(var add var-add) means) len)))))))
+(defun calcFunc-rms (a)
+ "Return the root-mean-square of the vector A."
+ (math-sqrt
+ (calcFunc-vmean
+ (calcFunc-map '(var abssqr var-abssqr) a))))
+
(defun math-fix-int-intv (x)
(if (math-floatp x)
x