GNU Scientific Library Reference Manual - Third Edition (v1.12)by M. Galassi, J. Davies, J. Theiler, B. Gough, G. Jungman, P. Alken, M. Booth, F. Rossi Paperback (6"x9"), 592 pages, 60 figures ISBN 0954612078 RRP £24.95 ($39.95) |

## 36.3 Linear fitting without a constant term

The functions described in this section can be used to perform least-squares fits to a straight line model without a constant term, Y = c_1 X.

__Function:__int**gsl_fit_mul***(const double **`x`, const size_t`xstride`, const double *`y`, const size_t`ystride`, size_t`n`, double *`c1`, double *`cov11`, double *`sumsq`)- This function computes the best-fit linear regression coefficient
`c1`of the model Y = c_1 X for the datasets (`x`,`y`), two vectors of length`n`with strides`xstride`and`ystride`. The errors on`y`are assumed unknown so the variance of the parameter`c1`is estimated from the scatter of the points around the best-fit line and returned via the parameter`cov11`. The sum of squares of the residuals from the best-fit line is returned in`sumsq`.

__Function:__int**gsl_fit_wmul***(const double **`x`, const size_t`xstride`, const double *`w`, const size_t`wstride`, const double *`y`, const size_t`ystride`, size_t`n`, double *`c1`, double *`cov11`, double *`sumsq`)- This function computes the best-fit linear regression coefficient
`c1`of the model Y = c_1 X for the weighted datasets (`x`,`y`), two vectors of length`n`with strides`xstride`and`ystride`. The vector`w`, of length`n`and stride`wstride`, specifies the weight of each datapoint. The weight is the reciprocal of the variance for each datapoint in`y`.The variance of the parameter

`c1`is computed using the weights and returned via the parameter`cov11`. The weighted sum of squares of the residuals from the best-fit line, \chi^2, is returned in`chisq`.

__Function:__int**gsl_fit_mul_est***(double*`x`, double`c1`, double`cov11`, double *`y`, double *`y_err`)- This function uses the best-fit linear regression coefficient
`c1`and its covariance`cov11`to compute the fitted function`y`and its standard deviation`y_err`for the model Y = c_1 X at the point`x`.

ISBN 0954612078 | GNU Scientific Library Reference Manual - Third Edition (v1.12) | See the print edition |