Function: math-nlfit-chi-sq

math-nlfit-chi-sq is a byte-compiled function defined in calc-nlfit.el.gz.

Signature

(math-nlfit-chi-sq XLIST YLIST PARMS FN &optional SLIST)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-nlfit.el.gz
(defun math-nlfit-chi-sq (xlist ylist parms fn &optional slist)
  (let ((cs 0))
    (while xlist
      (let ((c
             (math-sub
              (apply fn (car xlist) parms)
              (car ylist))))
        (if slist
            (setq c (math-div c (car slist))))
        (setq cs
              (math-add cs
                 (math-mul c c))))
      (setq xlist (cdr xlist))
      (setq ylist (cdr ylist))
      (setq slist (cdr slist)))
    cs))