Description Usage Arguments Details Value See Also Examples
estimateDetSignal
estimates the deterministic signal based on a
fractal-deterministic model that consists on a linear superposition of a
fractional brownian motion (fBm) B and a deterministic band-limited
signal x (Y = x + B). The model is represented (in wavelet
domain) through a fracdet
object which also contains estimates of the
fBm parameters (see fracdet
). To obtain the estimate of the
deterministic component, all the knowledge we may have
about the signals is exploited using a bayesian framework. This knowledge
consist on:
The estimates of the fBm parameters (which completely characterize the statistical properties of the fBm signal).
The well-known statistical properties of the fBm signals in wavelet domain.
The deviations from the theoretical wavelet coefficients' variance (as a function of the resolution level) permit the estimation of the energy distribution accross the resolution levels of the deterministic signal.
Using all this information, a bayesian model of the distribution of the deterministic and stochastic wavelet coefficients is built. The wavelet transform of the deterministic signal is estimated by calculating the decision rule that minimizes the posterior expected value of a squared loss function.
1 2 3 | estimateDetSignal(x, estimate_from, df = 5, nsim_bootstrap = 1000,
amplitude_fraction = 0.01, signal_amplitude = NULL, gk_method = 6,
rel_tol = 1e-07, nsubintv = 100000L, aggr_strategy = TRUE)
|
x |
A |
estimate_from |
Numeric vector specifying which resolution levels of the wavelet transform should be used to estimate the deterministic signal. |
df |
Degrees of freedom of the Student's t used to model the deterministic wavelet coefficients with large energy. Default: df = 5. |
nsim_bootstrap |
Number of bootstrap replicates used to estimate the
regression errors in each resolution level. Default: |
amplitude_fraction |
Fraction of the deterministic signal amplitude used
to compute a soft bound of what should be considered a negligible
deterministic wavelet coefficient. Default: |
signal_amplitude |
An estimate of the deterministic signal amplitude. If not provided, a proper estimate is computed. |
gk_method |
An integer code specifying the integration rule to be used
in the computations. |
rel_tol |
Desired relative error used in the numerical integration.
Defautl |
nsubintv |
Maximum number of subintervals to be used in the numerical
integration. Default: |
aggr_strategy |
Logical value. If |
The decision rule involves the computation of several integrals. The numerical integrals were computed using an adaptive integration scheme from the GSL - GNU Scientific Library. For further details about the numerical integration method, the interested reader is referred to the GSL documentation.
A wd
object representing the wavelet transform of the
deterministic signal estimation. To obtain the final estimate of x,
the wr
function (wr
) may be used.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | ## Not run:
# set parameters for the example
set.seed(3)
nlevels = 14
n = 2 ^ nlevels
xlim = c(200, 400)
H = 0.3
# simulate a simple fbm + sinusal signal
x = 1.25 * cospi(2 * 1:n / 10)
y = fbmSim(n = n, H = H) + x
# compute the wavelet transform and the wavelet coefficients' variances
wy = wd(y, bc = "symmetric")
vpr = waveletVar(wy)
# do you note the increase in variance in level 11?
plot(vpr, xlim = c(4, nlevels - 1),
ylim = range(vpr[5:nlevels]))
# estimate the fBm parameters avoiding levels 11 and 12 (with deterministic
# contributions). Level 12 is also avoid as a precaution
model = estimateFbmPars(vpr, use_resolution_levels = c(5:10, 13))
# Create a fracdet object...
fd = fracdet(wy, model)
# ... and check the fit
print(coef(fd))
# plot the experimental and the fitted wavelet's variances
plot(getWaveletVar(fd))
points(getFittedWaveletVar(fd),
col = 2,
pch = 2)
# Estimate the deterministic signal (this may take a while) taking
# into account the deviations in level 11, 12. The estimateDetSignal uses
# this information using a Bayesian modelling approach
wx = estimateDetSignal(fd, estimate_from = 11:12)
x_est = wr(wx)
# compare the original signal and the estimation
old_par = par(mfrow = c(2,1))
plot(y, xlim = xlim,
ylim = range(y[xlim[[1]]:xlim[[2]]]),
type = "l")
lines(x, lty = 2, col = 2)
legend("topright", lty = 1:2, col = 1:2,
legend = c("Y", "x"), bty = "n")
plot(x, type = "l", xlim = xlim,
ylim = range(x) * c(1, 2))
lines(x_est, col = 2, lty = 2)
legend("topright", lty = 1:2, col = 1:2,
legend = c("x", "x estimate"), bty = "n")
par(old_par)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.