Functions to perform calibration transfer with LMIR
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file transfer_lmir-0.0.7.tar.gz
.
File metadata
- Download URL: transfer_lmir-0.0.7.tar.gz
- Upload date:
- Size: 9.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d87618e6ccb8ded69648951f92dae1d72d5c449699d61f81d395eef21cbbadb0 |
|
MD5 | be2a0dd9d532e1e2055bc861380f33fe |
|
BLAKE2b-256 | 5c2be995c53487b51ad2aa01a80a1276fee37469cbb8a8e1267ab121862b328d |
File details
Details for the file transfer_lmir-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: transfer_lmir-0.0.7-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e10797be763aa5385206f79b9619d6f2025659e562a45284946abc454099afb |
|
MD5 | f4d639aeb081db3a968a377fa36ccb8b |
|
BLAKE2b-256 | a678687ed2176afabb511fde7bd9943c1b1602315c1fd9909ad7ccc94600ce8a |