Skip to content

Coefficients and Parameters

Ivan Svetunkov edited this page Jan 30, 2026 · 11 revisions

Coefficients and Parameters

This page documents methods for extracting and analysing model parameters from smooth models.

coef() / coefficients()

Extracts the estimated parameters from the model.

R Usage

model <- adam(AirPassengers, "MMM", lags=12, h=12, holdout=TRUE)

# Extract all coefficients
coef(model)

# Same as
coefficients(model)

Python Usage

from smooth import ADAM

model = ADAM(model="MMM", lags=12)
model.fit(y)

# Extract all coefficients
coefficients = model.coef

Output

R: Returns a named vector containing:

  • Smoothing parameters (alpha, beta, gammas, deltas)
  • Damping parameter (phi) if applicable
  • ARIMA parameters (AR, MA coefficients) if applicable
  • Initial states (level, trend, seasonal, ARIMA states)
  • Regression coefficients if applicable

Python: Returns an NDArray containing the estimated parameter vector (B).

Example

model <- adam(AirPassengers, "MAM", lags=12)
coef(model)
# Output:
#       alpha        beta       gamma       level      trend   seasonal1 ...
#   0.3521234   0.0012345   0.0001234 126.3456789   0.9987654   0.8765432 ...

confint()

Computes confidence intervals for the estimated parameters.

R Usage

model <- adam(AirPassengers, "MMM", lags=12, h=12, holdout=TRUE)

# 95% confidence intervals (default)
confint(model)

# 99% confidence intervals
confint(model, level=0.99)

# Bootstrap-based confidence intervals
confint(model, bootstrap=TRUE, nsim=1000)

Parameters

Parameter Type (R) Type (Python) Default Description
object adam - - Fitted model
parm character - NULL Which parameters (NULL = all)
level numeric - 0.95 Confidence level
bootstrap logical - FALSE Use bootstrap for intervals (passed to vcov())
... - - - Additional parameters passed to vcov() if bootstrap=TRUE

Output

Returns a matrix with columns:

  • S.E. - Standard error (if bootstrap=TRUE)
  • Lower bound (e.g., "2.5%")
  • Upper bound (e.g., "97.5%")

vcov()

Returns the variance-covariance matrix of the estimated parameters.

R Usage

model <- adam(AirPassengers, "AAN", h=12, holdout=TRUE)

# Get covariance matrix (Fisher Information based)
V <- vcov(model)

# Bootstrap-based covariance matrix
V <- vcov(model, bootstrap=TRUE, nsim=1000)

# Heuristic estimation (fast approximation)
V <- vcov(model, heuristics=0.1)

# Standard errors
sqrt(diag(V))

Parameters

Parameter Type (R) Type (Python) Default Description
object adam - - Fitted model
bootstrap logical - FALSE Use bootstrap (calls coefbootstrap())
heuristics numeric - NULL If set, variance equals abs(coef)*heuristics. Fast approximation
... - - - Additional parameters passed to coefbootstrap() if bootstrap=TRUE

Output

Returns a square matrix with:

  • Rows/columns named by parameters
  • Diagonal contains variances
  • Off-diagonal contains covariances

coefbootstrap()

Generates bootstrap estimates of model coefficients for inference. Method is defined in greybox and extended for adam.

R Usage

model <- adam(AirPassengers, "AAN", h=12, holdout=TRUE)

# Bootstrap with default settings
bootCoef <- coefbootstrap(model)

# Bootstrap with custom settings
bootCoef <- coefbootstrap(model, nsim=500, method="dsr", parallel=TRUE)

# Examine distribution
hist(bootCoef$coefficients[,"alpha"])

# Bootstrap confidence intervals
apply(bootCoef$coefficients, 2, quantile, probs=c(0.025, 0.975))

# Extract the covariance matrix
bootCoef$vcov

Parameters

Parameter Type (R) Type (Python) Default Description
object adam - - Fitted model
nsim integer - 1000 Number of bootstrap samples
size integer - floor(0.75*nobs(object)) Size of each bootstrap sample. Used in method="cr"
replace logical - FALSE Sample with replacement. Needed for method="cr".
prob numeric vector - NULL Probability weights for sampling. Used in method="cr"
parallel logical/integer - FALSE Use parallel processing. If integer, specifies number of cores
method character - "cr" Bootstrap method: "cr" (Case Resampling) or "dsr" (Data Shape Replication)
... - - - Additional parameters

Bootstrap Methods

Method Description
"cr" Case Resampling - resamples observations with varying sample sizes
"dsr" Data Shape Replication - model free, creates data of the similar shape as the original series

Output

Returns an object of class "bootstrap" containing:

Element Description
vcov Covariance matrix of bootstrapped coefficients
coefficients Matrix of bootstrapped coefficients (rows: samples, columns: parameters)
method Bootstrap method used ("cr" or "dsr")
nsim Number of simulations performed
size Sample size used (NA for some methods)
replace Whether replacement was used
prob Probability weights used
parallel Whether parallel processing was used
model Model call
timeElapsed Time elapsed for computation

See Also

Clone this wiki locally