Functions to perform calibration transfer by likelihood maximization: a standard-free approach capable of handling non-overlapping wavelength ranges.
In this approach, calibration for spectral data on primary instrument is performed by likelihood maximization inverse regression (LMIR).
Based on a limited number of spectra from a secondary instrument and the corresponding reference values, an estimation model is created based on block pairs.
The latter can then be used to estimate spectra from secondary instrument in the domain of primary instrument to be able to use to primary calibration.
Cf: F.B. Lavoie, A. Langlet, K. Muteki, R. Gosselin, Likelihood Maximization Inverse Regression: A novel non-linear multivariate model, Chemom. Intell. Lab. Syst. 194 (2019) 103844. https://doi.org/10.1016/j.chemolab.2019.103844.
F.B. Lavoie, G. Robert, A. Langlet, R. Gosselin, Calibration transfer by likelihood maximization : A standard-free approach capable of handling non-overlapping wavelength ranges, Chemom. Intell. Lab. Syst. 234 (2023) 104766. https://doi.org/10.1016/j.chemolab.2023.104766.
Call function
model, ypred = LMIR_create(X1,Y1,linear=True)
R1_all, g1_all, R2_all, g2_all = estimation_model(X1, Y1, X2c, Y2c,factor_k,nb_pairs=30,B)
ypred_ct, x1hat_ct, covx1_ct = estimation_exploit(R1_all,g1_all,R2_all,g2_all,X2v,X1,model)
Input arguments
- X1 (n1,k1): spectral data from primary instrument
- Y1 (n1,1): reference values for spectra from primary instrument
- X2c (n2,k2): spectral data from secondary instrument
- Y2c (n2,1): reference values for spectra from secondary instrument
- factor_k: parameter for supervised selection of observations for estimation model
- X2v: spectral data from secondary instrument for validation
Optional input arguments
- linear: option to create linear or non-linear models linking y to each varibale in X for LMIR modeling (default_value=True for linear modeling)
- nb_pairs: number of block pairs in estimation model (default_value=30)
- B: number of variable bootstrapping trials (default_value=3*max(k1,k2))
Outputs
- model: model created by LMIR
- ypred: predicted values by LMIR
- R1_all, g1_all, R2_all, g2_all: blocks pairs in estimation model
- ypred_ct: predicted values using estimation model and LMIR model from spectra from secondary instrument
- x1hat_ct: estimated spectra in domain of primary instrument
- covx1_ct: uncertainty associated to estimation of spectra in domain of primary instrument
Examples
Two full examples, along with datasets are provided in folder 'tests' of 'Download Files'.
- Example 1: Tablet shootout dataset
- Example 2: Coating times dataset
- Example 3: Wheat shootout dataset
Compatibility
transfer_lmir tested on Python 3.8 using the following modules:
- numpy 1.20.1
- matplotlib 3.3.4
- SciPy 1.6.2
Release files for transfer-lmir 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| transfer_lmir-0.0.7.tar.gz | 9.5 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| transfer_lmir-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.5 MB
Release files / transfer_lmir-0.0.7.tar.gz
| Download URL | transfer_lmir-0.0.7.tar.gz |
|---|---|
| Size | 9.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d87618e6ccb8ded69648951f92dae1d72d5c449699d61f81d395eef21cbbadb0
|
|
BLAKE2b-256 checksum How to use checksums |
5c2be995c53487b51ad2aa01a80a1276fee37469cbb8a8e1267ab121862b328d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / transfer_lmir-0.0.7-py3-none-any.whl
| Download URL | transfer_lmir-0.0.7-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e10797be763aa5385206f79b9619d6f2025659e562a45284946abc454099afb
|
|
BLAKE2b-256 checksum How to use checksums |
a678687ed2176afabb511fde7bd9943c1b1602315c1fd9909ad7ccc94600ce8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|