aTSA (version 3.1.2)

accurate: Accurate Computation

Description

Computes the accurate criterion of smoothed (fitted) values.

Usage

accurate(x, x.hat, k, output = TRUE)

Arguments

x
a numeric vector of original values.
x.hat
a numeric vector of smoothed (fitted) values.
k
the number of parameters in obtaining the smoothed (fitted) values.
output
a logical value indicating to print the results in R console. The default is TRUE.

Value

A vector containing the following components:
SST
the total sum of squares.
SSE
the sum of the squared residuals.
MSE
the mean squared error.
RMSE
the root mean square error.
MAPE
the mean absolute percent error.
MPE
the mean percent error.
MAE
the mean absolute error.
ME
the mean error.
R.squared
R^2 = 1 - SSE/SST.
R.adj.squared
the adjusted R^2.
RW.R.squared
the random walk R^2.
AIC
the Akaike's information criterion.
SBC
the Schwarz's Bayesian criterion.
APC
the Amemiya's prediction criterion

Details

See http://www.dms.umontreal.ca/~duchesne/chap12.pdf in page 616 - 617 for the details of calculations for each criterion.

Examples

X <- matrix(rnorm(200),100,2)
y <- 0.1*X[,1] + 2*X[,2] + rnorm(100)
y.hat <- fitted(lm(y ~ X))
accurate(y,y.hat,2)