-
Notifications
You must be signed in to change notification settings - Fork 22
Coefficients and Parameters
Ivan Svetunkov edited this page Apr 10, 2026
·
11 revisions
This page documents methods for extracting and analysing model parameters from smooth models.
Extracts the estimated parameters from the model.
model <- adam(AirPassengers, "MMM", lags=12, h=12, holdout=TRUE)
# Extract all coefficients
coef(model)
# Same as
coefficients(model)from smooth import ADAM
model = ADAM(model="MMM", lags=12)
model.fit(y)
# Extract all coefficients
coefficients = model.coefR: 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).
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 ...Computes confidence intervals for the estimated parameters.
Python: Not yet implemented.
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)| Parameter | Type (R) | Type (Python) | Default | Description |
|---|---|---|---|---|
object |
adam | TBA | - | Fitted model |
parm |
character | TBA | NULL | Which parameters (NULL = all) |
level |
numeric | TBA | 0.95 | Confidence level |
bootstrap |
logical | TBA | FALSE | Use bootstrap for intervals (passed to vcov()) |
... |
- | TBA | - | Additional parameters passed to vcov() if bootstrap=TRUE |
Returns a matrix with columns:
-
S.E.- Standard error (if bootstrap=TRUE) - Lower bound (e.g., "2.5%")
- Upper bound (e.g., "97.5%")
Returns the variance-covariance matrix of the estimated parameters.
Python: Not yet implemented.
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))| Parameter | Type (R) | Type (Python) | Default | Description |
|---|---|---|---|---|
object |
adam | TBA | - | Fitted model |
bootstrap |
logical | TBA | FALSE | Use bootstrap (calls coefbootstrap()) |
heuristics |
numeric | TBA | NULL | If set, variance equals abs(coef)*heuristics. Fast approximation |
... |
- | TBA | - | Additional parameters passed to coefbootstrap() if bootstrap=TRUE |
Returns a square matrix with:
- Rows/columns named by parameters
- Diagonal contains variances
- Off-diagonal contains covariances
Generates bootstrap estimates of model coefficients for inference. Method is defined in greybox and extended for adam.
Python: Not yet implemented.
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| Parameter | Type (R) | Type (Python) | Default | Description |
|---|---|---|---|---|
object |
adam | TBA | - | Fitted model |
nsim |
integer | TBA | 1000 | Number of bootstrap samples |
size |
integer | TBA | floor(0.75*nobs(object)) | Size of each bootstrap sample. Used in method="cr"
|
replace |
logical | TBA | FALSE | Sample with replacement. Needed for method="cr". |
prob |
numeric vector | TBA | NULL | Probability weights for sampling. Used in method="cr"
|
parallel |
logical/integer | TBA | FALSE | Use parallel processing. If integer, specifies number of cores |
method |
character | TBA | "cr" | Bootstrap method: "cr" (Case Resampling) or "dsr" (Data Shape Replication) |
... |
- | TBA | - | Additional parameters |
| 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 |
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 |
- ADAM - Main ADAM function
- Fitted-Values-and-Forecasts - Fitted values, forecasts and simulation
- Refitting-and-Reforecasting - Parameter uncertainty analysis
- Visualisation-and-Output - Plotting forecasts