Selecting optimum model weights by comparing sum relative errors, this is
`relerr()`

, of weighted `calibration()`

models as
suggested by Almeida et al. (2002).

## Usage

```
weight_select(x, weights, ...)
# S3 method for calibration
weight_select(x, weights = NULL, ...)
relerr(x)
# S3 method for calibration
relerr(x)
```

## Arguments

- x
an object of class '

`calibration`

'.- weights
a list of weights to be added to the default weights to be checked. These are

`1/concentration^0.5`

,`1/concentration^1`

,`1/concentration^2`

,`1/signal^0.5`

,`1/signal^1`

, and`1/signal^2`

.- ...
further arguments passed to

`calibration()`

.

## Value

`weight_select()`

produces a matrix with differently weighted
'`calibration`

' models ordered by sum relative errors.
`relerr()`

compares the nominal concentrations with those predicted by
the `calibration`

model.

## Details

If calibration data is not homoscedastic, a weighted least squares linear
calibration model may be applied to counteract the influence of high
concentrations on the regression model. This, in turn, typically improves the
accuracy at the lower end of the calibration curve (Almeida et al., 2002).
`weight_select`

uses sum relative errors (`relerr`

) to
find the best weight as suggested by Almeida et al. (2002). Predefined
weights include `1/concentration^0.5`

, `1/concentration^1`

,
`1/concentration^2`

, `1/signal^0.5`

, `1/signal^1`

, and
`1/signal^2`

(see `calibration()`

for details).

## References

Almeida, A.M.D., Castel-Branco, M.M., & Falcao, A.C. (2002). Linear
regression for calibration lines revisited: weighting schemes for
bioanalytical methods. *Journal of Chromatography B*, **774**(2),
215-222. doi:10.1016/S1570-0232(02)00244-1
.

## See also

Other calibration:
`calibration()`

,
`din32645`

,
`icp`

,
`matrix_effect()`

,
`neitzel2003`

,
`phenolics`

## Examples

```
data(din32645)
din <- calibration(Area ~ Conc, data = din32645)
weight_select(din)
#> Sum relative error Adj. R-squared
#> 1/Conc^2.0 0.6109420 0.9841021
#> 1/Conc^1.0 0.6928994 0.9863181
#> 1/Conc^0.5 0.7463664 0.9854612
#> 1/Area^2.0 0.7545672 0.9839309
#> 1/Area^1.0 0.7795665 0.9842662
#> 1/Area^0.5 0.7896535 0.9838375
#> din 0.7977949 0.9829773
#> NULL 0.7977949 0.9829773
relerr(din)
#> [1] 0.19879314 0.07756144 -0.15397708 -0.06895849 0.06692175 0.04503979
#> [7] -0.04717936 -0.03639084 0.07526913 -0.02770383
```