| nmfkc.ar.degree.cv | R Documentation |
nmfkc.ar.degree.cv selects the optimal lag order for an autoregressive model
by applying cross-validation over candidate degrees.
This function accepts both standard matrices (Variables x Time) and ts objects
(Time x Variables). ts objects are automatically transposed internally.
nmfkc.ar.degree.cv(
Y,
rank = 1,
degree = 1:2,
intercept = TRUE,
plot = TRUE,
...
)
Y |
Observation matrix |
rank |
Rank of the basis matrix. For backward compatibility,
|
degree |
A vector of candidate lag orders to be evaluated. |
intercept |
Logical. If TRUE (default), an intercept is added to the covariate matrix. |
plot |
Logical. If TRUE (default), a plot of the objective function values is drawn. |
... |
Additional arguments passed to |
A list with components:
degree |
The lag order that minimizes the cross-validation objective function. |
degree.max |
Maximum recommended lag order, computed as |
objfunc |
Objective function values for each candidate lag order. |
nmfkc.ar, nmfkc.cv
# Example using ts object directly
d <- AirPassengers
# Selection of degree (using ts object)
# Note: Y is automatically transposed if it is a ts object
nmfkc.ar.degree.cv(Y=d, rank=1, degree=11:14)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.