ka2_strip_penalized {alkahest} | R Documentation |
Strip XRD ka2
Description
Strip XRD ka2
Usage
ka2_strip_penalized(x, y, ...)
## S4 method for signature 'numeric,numeric'
ka2_strip_penalized(
x,
y,
lambda,
wave = c(1.5406, 1.54443),
tau = 0.5,
nseg = 1,
progress = interactive()
)
## S4 method for signature 'ANY,missing'
ka2_strip_penalized(
x,
lambda,
wave = c(1.5406, 1.54443),
tau = 0.5,
nseg = 1,
progress = interactive()
)
Arguments
x , y |
A |
... |
Currently not used. |
lambda |
An |
wave |
A length-two |
tau |
A length-one |
nseg |
A length-one |
progress |
A |
Value
Returns a list
with two components x
and y
.
Note
Matrix is required.
Author(s)
J. J. de Rooi et al. (original R code).
References
de Rooi, J. J., van der Pers, N. M., Hendrikx, R. W. A., Delhez, R., Böttger A. J. and Eilers, P. H. C. (2014). Smoothing of X-ray diffraction data and Ka2 elimination using penalized likelihood and the composite link model. Journal of Applied Crystallography, 47: 852-860. doi:10.1107/S1600576714005809
Examples
## Not run:
## X-ray diffraction
data("XRD")
## Subset from 20 to 40 degrees
XRD <- signal_select(XRD, from = 20, to = 40)
## Plot diffractogram
plot(XRD, type = "l", xlab = expression(2*theta), ylab = "Count")
## Penalized likelihood smoothing
lambda <- seq(from = 1, to = 8, length.out = 40)
lambda <- 10^lambda
likelihood <- smooth_likelihood(XRD, lambda = lambda, d = 3)
lines(likelihood, col = "red")
## Strip ka2
ka2 <- ka2_strip_penalized(XRD, lambda = lambda, tau = 0.5, nseg = 1)
lines(ka2, col = "blue")
## End(Not run)