seqdiffusion {diffusion}R Documentation

Enables fitting various sequential diffusion curves.

Description

This function fits diffusion curves of the type "bass", "gompertz", gsgompertz or weibull across generations. Parameters are estimated for each generation individually by minimizing the Mean Squared Error with subplex algorithms from the optimx package. Optionally p-values of the coefficients can be determined via bootstraping. Furthermore, the bootstrapping allows removing insignificant parameters from the optimisation process.

Usage

seqdiffusion(
  y,
  w = NULL,
  cleanlead = c(TRUE, FALSE),
  loss = 2,
  cumulative = c(TRUE, FALSE),
  pvalreps = 0,
  eliminate = c(FALSE, TRUE),
  sig = 0.05,
  verbose = c(FALSE, TRUE),
  type = c("bass", "gompertz", "gsgompertz", "weibull"),
  method = c("L-BFGS-B", "Nelder-Mead", "BFGS", "hjkb", "Rcgmin", "bobyqa"),
  maxiter = 500,
  opttol = 1e-06,
  multisol = c(FALSE, TRUE),
  initpar = c("linearize", "preset"),
  mscal = c(TRUE, FALSE),
  bootloss = c("smthempir", "empir", "se"),
  ...
)

Arguments

y

matrix containing in each column the adoption per period for generation k

w

matrix containing in each column the curve parameters for generation k (see note). Parameters set to NA will be optimised. If w = NULL (default) all parameters are optimized.

cleanlead

removes leading zeros for fitting purposes (default == T)

loss

the l-norm (1 is absolute errors, 2 is squared errors)

cumulative

If TRUE optimization is done on cumulative adoption.

pvalreps

bootstrap repetitions to estimate (marginal) p-values

eliminate

if TRUE eliminates insignificant parameters from the estimation. Forces pvalreps = 1000 if left to 0.

sig

significance level used to eliminate parameters

verbose

if TRUE console output is provided during estimation (default == F)

type

of diffusion curve to use. This can be "bass", "gompertz", "gsgompertz" and "weibull"

method

optimization method to use. This can be "nm" for Nelder-Meade or "hj" for Hooke-Jeeves. #' @param maxiter number of iterations the optimiser takes (default == 10000 for "nm" and Inf for "hj")

opttol

Tolerance for convergence (default == 1.e-06)

multisol

when "TRUE" multiple optmisation solutions from different initialisations of the market parameter are used (default == "FALSE")

initpar

vector of initalisation parameters. If set to preset a predfined set of internal initalisation parameters is used while "linearize" uses linearised initalisation methods (default == "linearize".

mscal

scales market potential at initalisation with the maximum of the observed market potential for better optimization results (default == TRUE)

Value

Returns an object of class seqdiffusion, which contains:

Bass curve

The optimization of the Bass curve is initialized by the linear approximation suggested in Bass (1969).

Gompertz curve

The initialization of the Gompertz curve uses the approach suggested by Jukic et al. (2004), but is adapted to allow for the non-exponential version of the Gompertz curve. This makes the market potential parameter equivalent to the Bass curves and the market potential from Bass curve is used for initialization.

Gamma/Shifted Gompertz

The curve is initialized by assuming the shift operator to be 1 and becomes equivalent to the Bass curve, as shown in Bemmaor (1994). A Bass curve is therefore used as an estimator for the remaining initial parameters.

Weibull

The initialization is obtained through by a linear approximation median-ranked OLS described in Sharif and Islam 1980.

Author(s)

Oliver Schaer, info@oliverschaer.ch,

Nikolaos Kourentzes, nikolaos@kourentzes.com

References

See Also

plot.seqdiffusion and print.seqdiffusion.

Examples

  fit <- seqdiffusion(tsIbm)
  plot(fit)


[Package diffusion version 0.4.0 Index]