estimateFbmPars: Estimate fractional Brownian motion parameters from its...

Description Usage Arguments Value Warning See Also Examples

Description

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.

Usage

1
2
estimateFbmPars(x, use_resolution_levels, start = NULL, lower = NULL,
  upper = NULL, use_weights = FALSE, algorithm = "port", ...)

Arguments

x

A waveletVar object.

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 H and sigma2.

lower, upper

Vectors of lower and upper bounds. Note that the H parameter should fulfil 0 < H < 1, whereas that sigma2 should be sigma2 > 0 If unspecified, proper bounds are computed.

use_weights

Logical value indicating wheter the objective function is weighted least squares or not. If use_weights is TRUE, proper weights are automatically computed.

algorithm

Character string specifying the algorithm to use (see nls. Note that bounds can only be used with the "port" algorithm (default choice).

...

Additional nls arguments (see nls).

Value

A nls object representing the fitted model. See nls for further details.

Warning

Do not use nls on artificial "zero-residual" data. See nls for further details.

See Also

waveletVar, theoreticalWaveletVar

Examples

 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"))

citiususc/fracdet documentation built on May 13, 2019, 7:30 p.m.