Skip to content
Snippets Groups Projects
Commit b75416da authored by Liam M. Healy's avatar Liam M. Healy
Browse files

Improved docstring for #'linear-fit

parent 0e427340
No related branches found
No related tags found
No related merge requests found
;; Linear least squares, or linear regression ;; Linear least squares, or linear regression
;; Liam Healy <2008-01-21 12:41:46EST linear-least-squares.lisp> ;; Liam Healy <2008-01-21 12:41:46EST linear-least-squares.lisp>
;; Time-stamp: <2013-01-01 21:29:30EST linear-least-squares.lisp> ;; Time-stamp: <2013-01-03 10:14:04EST linear-least-squares.lisp>
;; ;;
;; Copyright 2008, 2009, 2010, 2011, 2012, 2013 Liam M. Healy ;; Copyright 2008, 2009, 2010, 2011, 2012, 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
(cov11 (:pointer :double)) (sumsq (:pointer :double)))) (cov11 (:pointer :double)) (sumsq (:pointer :double))))
:inputs (x weight y) :inputs (x weight y)
:switch (weight weight-stride) :switch (weight weight-stride)
:documentation ; FDL :documentation ; GSL texi partial
"Compute the best-fit linear regression coefficients "Compute the best-fit linear regression coefficients
c0, c1 of the model Y = c_0 + c_1 X for the weighted or unweighted c0, c1 of the model Y = c_0 + c_1 X for the weighted or unweighted
dataset (x, y), two vectors of equal length with strides dataset (x, y), two vectors of equal length with strides
...@@ -66,14 +66,15 @@ ...@@ -66,14 +66,15 @@
unweighted sum of squares of the residuals from the best-fit line, unweighted sum of squares of the residuals from the best-fit line,
\chi^2, is returned as the last value. \chi^2, is returned as the last value.
Returns: c0, c1, cov00, cov01, cov11, sumsq.") Returns: c0, c1, cov00, cov01, cov11, sumsq.
Returns: intercept, slope, intercept variance, covariance, slope variance, sum square of residuals.")
(defmfun linear-estimate (x c0 c1 cov00 cov01 cov11) (defmfun linear-estimate (x c0 c1 cov00 cov01 cov11)
"gsl_fit_linear_est" "gsl_fit_linear_est"
((x :double) (c0 :double) (c1 :double) ((x :double) (c0 :double) (c1 :double)
(cov00 :double) (cov01 :double) (cov11 :double) (cov00 :double) (cov01 :double) (cov11 :double)
(y (:pointer :double)) (y-error (:pointer :double))) (y (:pointer :double)) (y-error (:pointer :double)))
:documentation ; FDL :documentation ; GSL texi partial
"Use the best-fit linear regression coefficients "Use the best-fit linear regression coefficients
c0, c1 and their covariance c0, c1 and their covariance
cov00, cov01, cov11 to compute the fitted function cov00, cov01, cov11 to compute the fitted function
...@@ -100,7 +101,7 @@ ...@@ -100,7 +101,7 @@
(sumsq (:pointer :double)))) (sumsq (:pointer :double))))
:inputs (x y weight) :inputs (x y weight)
:switch (weight weight-stride) :switch (weight weight-stride)
:documentation ; FDL :documentation ; GSL texi
"Compute the best-fit linear regression coefficient "Compute the best-fit linear regression coefficient
c1 of the model Y = c_1 X for the weighted or unweighted datasets c1 of the model Y = c_1 X for the weighted or unweighted datasets
(x, y), two vectors of equal length with strides (x, y), two vectors of equal length with strides
...@@ -117,7 +118,7 @@ ...@@ -117,7 +118,7 @@
"gsl_fit_mul_est" "gsl_fit_mul_est"
((x :double) (c1 :double) (cov11 :double) ((x :double) (c1 :double) (cov11 :double)
(y (:pointer :double)) (y-error (:pointer :double))) (y (:pointer :double)) (y-error (:pointer :double)))
:documentation ; FDL :documentation ; GSL texi
"Use the best-fit linear regression coefficient "Use the best-fit linear regression coefficient
c1 and its covariance cov11 to compute the fitted function c1 and its covariance cov11 to compute the fitted function
y and its standard deviation y-error for the model y and its standard deviation y-error for the model
...@@ -207,7 +208,7 @@ ...@@ -207,7 +208,7 @@
:return (parameters covariance (cffi:mem-ref chisq :double)) :return (parameters covariance (cffi:mem-ref chisq :double))
:export nil :export nil
:index linear-mfit :index linear-mfit
:documentation ; FDL :documentation ; GSL texi
"Compute the best-fit parameters c of the weighted or unweighted "Compute the best-fit parameters c of the weighted or unweighted
model y = X c for the observations y and optional weights model y = X c for the observations y and optional weights
and the model matrix X. The covariance matrix of and the model matrix X. The covariance matrix of
...@@ -252,7 +253,7 @@ ...@@ -252,7 +253,7 @@
:return ((cffi:mem-ref chisq :double) (cffi:mem-ref rank ':sizet)) :return ((cffi:mem-ref chisq :double) (cffi:mem-ref rank ':sizet))
:export nil :export nil
:index linear-mfit :index linear-mfit
:documentation ; FDL :documentation ; GSL texi
"Compute the best-fit parameters c of the weighted or unweighted "Compute the best-fit parameters c of the weighted or unweighted
model y = X c for the observations y and weights and the model model y = X c for the observations y and weights and the model
matrix X. The covariance matrix of the model parameters is matrix X. The covariance matrix of the model parameters is
...@@ -276,7 +277,7 @@ ...@@ -276,7 +277,7 @@
((mpointer covariance) :pointer) ((mpointer covariance) :pointer)
(y (:pointer :double)) (y-error (:pointer :double))) (y (:pointer :double)) (y-error (:pointer :double)))
:inputs (x coefficients covariance) :inputs (x coefficients covariance)
:documentation ; FDL :documentation ; GSL texi
"Use the best-fit multilinear regression coefficients "Use the best-fit multilinear regression coefficients
and their covariance matrix to compute the fitted function value and their covariance matrix to compute the fitted function value
y and its standard deviation for the model y = x.c y and its standard deviation for the model y = x.c
...@@ -293,7 +294,7 @@ ...@@ -293,7 +294,7 @@
:inputs (x observations coefficients) :inputs (x observations coefficients)
:outputs (residuals) :outputs (residuals)
:gsl-version (1 11) :gsl-version (1 11)
:documentation ; FDL :documentation ; GSL texi
"Compute the vector of residuals r = y - X c for the observations y, "Compute the vector of residuals r = y - X c for the observations y,
coefficients c and matrix of predictor variables X.") coefficients c and matrix of predictor variables X.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment