Package: serrsBayes 0.5-0

serrsBayes: Bayesian Modelling of Raman Spectroscopy

Sequential Monte Carlo (SMC) algorithms for fitting a generalised additive mixed model (GAMM) to surface-enhanced resonance Raman spectroscopy (SERRS), using the method of Moores et al. (2016) <arxiv:1604.07299>. Multivariate observations of SERRS are highly collinear and lend themselves to a reduced-rank representation. The GAMM separates the SERRS signal into three components: a sequence of Lorentzian, Gaussian, or pseudo-Voigt peaks; a smoothly-varying baseline; and additive white noise. The parameters of each component of the model are estimated iteratively using SMC. The posterior distributions of the parameters given the observed spectra are represented as a population of weighted particles.

Authors:Matt Moores [aut, cre], Jake Carson [aut], Benjamin Moskowitz [ctb], Kirsten Gracie [dtc], Karen Faulds [dtc], Mark Girolami [aut], Engineering and Physical Sciences Research Council [fnd], University of Warwick [cph]

serrsBayes_0.5-0.tar.gz
serrsBayes_0.5-0.zip(r-4.5)serrsBayes_0.5-0.zip(r-4.4)serrsBayes_0.5-0.zip(r-4.3)
serrsBayes_0.5-0.tgz(r-4.4-x86_64)serrsBayes_0.5-0.tgz(r-4.4-arm64)serrsBayes_0.5-0.tgz(r-4.3-x86_64)serrsBayes_0.5-0.tgz(r-4.3-arm64)
serrsBayes_0.5-0.tar.gz(r-4.5-noble)serrsBayes_0.5-0.tar.gz(r-4.4-noble)
serrsBayes_0.5-0.tgz(r-4.4-emscripten)serrsBayes_0.5-0.tgz(r-4.3-emscripten)
serrsBayes.pdf |serrsBayes.html
serrsBayes/json (API)
NEWS

# Install 'serrsBayes' in R:
install.packages('serrsBayes', repos = c('https://mooresm.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/mooresm/serrsbayes/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • lsTamra - Surface-enhanced Raman spectram of tetramethylrhodamine+DNA
  • methanol - Raman spectrum of methanol
  • result - SMC particles for TAMRA+DNA
  • result2 - SMC particles for methanol

On CRAN:

bayesianchemometricsramansequential-monte-carlospectroscopy

22 exports 7 stars 1.33 score 5 dependencies 36 scripts 260 downloads

Last updated 3 years agofrom:1896185dba. Checks:OK: 9. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 13 2024
R-4.5-win-x86_64OKSep 13 2024
R-4.5-linux-x86_64OKSep 13 2024
R-4.4-win-x86_64OKSep 13 2024
R-4.4-mac-x86_64OKSep 13 2024
R-4.4-mac-aarch64OKSep 13 2024
R-4.3-win-x86_64OKSep 13 2024
R-4.3-mac-x86_64OKSep 13 2024
R-4.3-mac-aarch64OKSep 13 2024

Exports:computeLogLikelihoodcopyLogProposalseffectiveSampleSizefitSpectraMCMCfitSpectraSMCfitVoigtIBISfitVoigtPeaksSMCgetBsplineBasisgetVoigtParammarginalMetropolisUpdatemhUpdateVoigtmixedVoigtresampleParticlesresidualResamplingreWeightParticlessumDexpsumDlogNormsumDnormweightedGaussianweightedLorentzianweightedMeanweightedVariance

Dependencies:latticeMatrixRcppRcppEigentruncnorm

Introducing serrsBayes

Rendered fromIntroduction.Rmdusingknitr::rmarkdownon Sep 13 2024.

Last update: 2021-06-28
Started: 2018-02-18

Methanol example

Rendered fromMethanol.Rmdusingknitr::rmarkdownon Sep 13 2024.

Last update: 2021-06-06
Started: 2019-04-11

Readme and manuals

Help Manual

Help pageTopics
Compute the log-likelihood.computeLogLikelihood
Initialise the vector of Metropolis-Hastings proposals.copyLogProposals
Compute the effective sample size (ESS) of the particles.effectiveSampleSize
Fit the model using Markov chain Monte Carlo.fitSpectraMCMC
Fit the model using Sequential Monte Carlo (SMC).fitSpectraSMC
Fit the model with Voigt peaks using iterated batch importance sampling (IBIS).fitVoigtIBIS
Fit the model with Voigt peaks using Sequential Monte Carlo (SMC).fitVoigtPeaksSMC
Compute cubic B-spline basis functions for the given wavenumbers.getBsplineBasis
Compute the pseudo-Voigt mixing ratio for each peak.getVoigtParam
Surface-enhanced Raman spectram of tetramethylrhodamine+DNA (T20)lsTamra
Update all of the parameters using a single Metropolis-Hastings step.marginalMetropolisUpdate
Raman spectrum of methanol (CH3OH)methanol
Update the parameters of the Voigt peaks using marginal Metropolis-Hastings.mhUpdateVoigt
Compute the spectral signature using Voigt peaks.mixedVoigt
Resample in place to avoid expensive copying of data structures, using a permutation of the ancestry vector.resampleParticles
Compute an ancestry vector for residual resampling of the SMC particles.residualResampling
SMC particles for TAMRA+DNA (T20)result
SMC particles for methanol (CH3OH)result2
Update the importance weights of each particle.reWeightParticles
Bayesian modelling and quantification of Raman spectroscopyserrsBayes
Sum log-likelihoods of i.i.d. exponential.sumDexp
Sum log-likelihoods of i.i.d. lognormal.sumDlogNorm
Sum log-likelihoods of Gaussian.sumDnorm
Compute the spectral signature using Gaussian peaks.weightedGaussian
Compute the spectral signature using Lorentzian peaks.weightedLorentzian
Compute the weighted arithmetic means of the particles.weightedMean
Compute the weighted variance of the particles.weightedVariance