Description Usage Arguments Details Value References Examples
This function either sets the pointwise experimental uncertainty or estimates it using aws
library.
1 |
data |
an object of type |
sigma |
numeric vector which, if not |
x.bkg.only |
if parameter |
n.regions |
if both parameters |
hmax |
specifies the maximal bandwidth |
sigma2 |
specifies the estimation of the signal's variance |
We assume the experimental uncertainty to have a Gaussian distribution with x-dependent amplitude. Splitting the grid into n.regions
segments and estimating Gaussian standard deviations over each of these segments allows us to approximate the true distribution.
The function uses aws
package that uses a Propagation-Separation Approach for signal smoothing. The use of sigma2
argument allows to obtain a smoother or rougher result.
An object of type data
. Elements
sigma |
numeric vector containing the estimated noise level. |
smoothed |
if both parameters |
are replaced with their new values.
Polzehl J, Papafitsoros K, Tabelow K (2020). Patch-Wise Adaptive Weights Smoothing in R. Journal of Statistical Software, 95(6), 1-27. Joerg Polzehl, Felix Anker (2020): aws: Adaptive Weights Smoothing. Version 2.5. https://CRAN.R-project.org/package=aws.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
# Setting x and y
x <- seq(.7, 30, 0.01)
y <- sin(x)
# Adding x-dependent noise
y <- y + rnorm(sd=0.05+x/240, n=length(x))
# estimating noise
dat <- list(x=x, y=y)
dat <- set.sigma(dat, n.regions=1, sigma2 = 0.005)
# use
# dat <- set.sigma(dat, n.regions=5)
# to see the difference
# Plotting results: noisy function and a
# smoothed estimate +/- 2 standard deviations
plot(x, y, t="l")
lines(dat$x, dat$smoothed, col=3, lwd=2)
lines(dat$x, dat$smoothed+2*dat$sigma, col=2)
lines(dat$x, dat$smoothed-2*dat$sigma, col=2)
abline(v=seq(min(x), max(x),length=5), col=4)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.