Skip to main content

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

  1. X1 (n1,k1): spectral data from primary instrument
  2. Y1 (n1,1): reference values for spectra from primary instrument
  3. X2c (n2,k2): spectral data from secondary instrument
  4. Y2c (n2,1): reference values for spectra from secondary instrument
  5. factor_k: parameter for supervised selection of observations for estimation model
  6. X2v: spectral data from secondary instrument for validation

Optional input arguments

  1. 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)
  2. nb_pairs: number of block pairs in estimation model (default_value=30)
  3. B: number of variable bootstrapping trials (default_value=3*max(k1,k2))

Outputs

  1. model: model created by LMIR
  2. ypred: predicted values by LMIR
  3. R1_all, g1_all, R2_all, g2_all: blocks pairs in estimation model
  4. ypred_ct: predicted values using estimation model and LMIR model from spectra from secondary instrument
  5. x1hat_ct: estimated spectra in domain of primary instrument
  6. 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

transfer_lmir-0.0.7.tar.gz (9.5 MB view details)

Uploaded Source

Built Distribution

transfer_lmir-0.0.7-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

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

Hashes for transfer_lmir-0.0.7.tar.gz
Algorithm Hash digest
SHA256 d87618e6ccb8ded69648951f92dae1d72d5c449699d61f81d395eef21cbbadb0
MD5 be2a0dd9d532e1e2055bc861380f33fe
BLAKE2b-256 5c2be995c53487b51ad2aa01a80a1276fee37469cbb8a8e1267ab121862b328d

See more details on using hashes here.

File details

Details for the file transfer_lmir-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for transfer_lmir-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3e10797be763aa5385206f79b9619d6f2025659e562a45284946abc454099afb
MD5 f4d639aeb081db3a968a377fa36ccb8b
BLAKE2b-256 a678687ed2176afabb511fde7bd9943c1b1602315c1fd9909ad7ccc94600ce8a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page