computeLogLikelihood: Compute the log-likelihood.

Description Usage Arguments Value

View source: R/RcppExports.R

Description

This is an internal function that is only exposed on the public API for unit testing purposes. It computes the log-likelihood of the spline and the noise, once the spectral signature has been subtracted from the observed data. Thus, it can be used with either Lorentzian, Gaussian, or pseudo-Voigt broadening functions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
computeLogLikelihood(
  obsi,
  lambda,
  prErrNu,
  prErrSS,
  basisMx,
  eigVal,
  precMx,
  xTx,
  aMx,
  ruMx
)

Arguments

obsi

Vector of residuals after the spectral signature has been subtracted.

lambda

smoothing parameter of the penalised B-spline.

prErrNu

hyperparameter of the additive noise

prErrSS

hyperparameter of the additive noise

basisMx

Matrix of B-spline basis functions

eigVal

eigenvalues of the Demmler-Reinsch factorisation

precMx

precision matrix for the spline

xTx

sparse matrix cross-product

aMx

orthoganal matrix A from the Demmler-Reinsch factorisation

ruMx

product of Ru from the Demmler-Reinsch factorisation

Value

The logarithm of the likelihood.


serrsBayes documentation built on June 28, 2021, 5:14 p.m.