Description Usage Arguments Value Warning See Also Examples
estimateFbmPars
determines the fractional Brownian motion (fBm)
parameters by fitting the theoretical wavelet coefficients' variances
to given experimental variances. The estimation procedure is thus based
on nonlinear least-squares estimates and makes use of the nls
function
nls
.
1 2 |
x |
A |
use_resolution_levels |
A numeric vector specifying which resolution levels should be used in the fit. |
start |
A named list or named numeric vector of starting estimates. The
names of the list should be |
lower, upper |
Vectors of lower and upper bounds. Note that the |
use_weights |
Logical value indicating wheter the objective function is
weighted least squares or not. If |
algorithm |
Character string specifying the algorithm to use (see
|
... |
Additional |
A nls
object representing the fitted model. See
nls
for further details.
Do not use nls on artificial "zero-residual" data. See
nls
for further details.
waveletVar
, theoreticalWaveletVar
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | set.seed(10)
fbm = fbmSim(n = 2 ^ 13, H = 0.4)
vpr = waveletVar(wd(fbm, bc = "symmetric"))
plot(vpr)
# Estimate the fBm parameters using the largest resolution levels
# since the estimates of their variances are better
model = estimateFbmPars(vpr, use_resolution_levels = 5:12)
# The nls-fit is performed in semilog-space. Thus, a transformation
# of the predicted values is required
points(resolutionLevels(vpr),
2 ^ predict(model, newdata = data.frame(x = 0:12)),
col = 2,
pch = 2)
# Since the estimates of the largest resolution levels are better we may
# use a weigthed regression scheme
wmodel = estimateFbmPars(vpr, use_resolution_levels = 5:12,
use_weights = TRUE)
points(resolutionLevels(vpr),
2 ^ predict(wmodel, newdata = data.frame(x = 0:12)),
col = 3,
pch = 3)
legend("topright", pch = 1:3, col = 1:3, bty = "n",
legend = c("Original data", "nls model", "weighted-nls model"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.