Description Usage Arguments Details Value Author(s) References See Also Examples
Auxiliary function (i.e. not intended for the average user) that enables fast and efficient GETSmodelling with userspecified estimators and models, and userspecified diagnostics. In future versions of the package, the function will be called and relied upon by getsm
, getsv
and isat
.
1 2 3 4 5 6 7 8 9  getsFun(y, x, untransformed.residuals=NULL,
user.estimator=list(name="ols", tol=1e07, LAPACK=FALSE, method=3),
gum.result=NULL, t.pval=0.05, wald.pval=t.pval, do.pet=TRUE,
ar.LjungB=NULL, arch.LjungB=NULL, normality.JarqueB=NULL,
user.diagnostics=NULL, gof.function=list(name="infocrit", method="sc"),
gof.method=c("min", "max"), keep=NULL, include.gum=FALSE,
include.1cut=FALSE, include.empty=FALSE, max.paths=NULL, turbo=FALSE,
tol=1e07, LAPACK=FALSE, max.regs=NULL, print.searchinfo=TRUE,
alarm=FALSE)

y 
a numeric vector (with no missing values, i.e. no nonnumeric 'holes') 
x 
a 
untransformed.residuals 

user.estimator 
a 
gum.result 
a 
t.pval 
numeric value between 0 and 1. The significance level used for the twosided regressor significance ttests 
wald.pval 
numeric value between 0 and 1. The significance level used for the Parsimonious Encompassing Tests (PETs). By default, it is the same as 
do.pet 
logical. If 
ar.LjungB 
a two element vector or 
arch.LjungB 
a two element vector or 
normality.JarqueB 

user.diagnostics 

gof.function 
a 
gof.method 
a 
keep 

include.gum 
logical. If 
include.1cut 
logical. If 
include.empty 
logical. If 
max.paths 

turbo 
logical. If 
tol 
numeric value ( 
LAPACK 
currently not used 
max.regs 
integer. The maximum number of regressions along a deletion path. It is not recommended that this is altered 
print.searchinfo 
logical. If 
alarm 
logical. If 
The value returned by the estimator specified in user.estimator
should be a list containing at least six items: "coefficients", "df", "vcov", "logl", "n" and "k". The item "coefficients" should be a vector of length equal to NCOL(x)
that contains the estimated coefficients. The item named "df" is used to compute the pvalues associated with the tstatistics, i.e. coef/std.err. The item named "vcov" contains the (symmetric) coefficientcovariance matrix of the estimated coefficients. The items "logl" (the loglikelihood), "n" (the number of observations) and "k" (the number of estimated parameters; not necessarily equal to the number of coefficients) are used to compute the information criterion. Finally, the estimator MUST be able to handle NULL
regressormatrices (i.e. is.null(x)=TRUE
or NCOL(x)=0
). In this case, then the first three items (i.e. "coefficients2", "df" and "vcov") can  and should  be NULL
.
The argument user.diagnostics
enables the user to specify additional  or alternative  diagnostics, see diagnostics
.
The returned value depends on the user.estimator
. For the default, see ols
with method=3
.
Genaro Sucarrat, http://www.sucarrat.net/
C. Jarque and A. Bera (1980): 'Efficient Tests for Normality, Homoscedasticity and Serial Independence'. Economics Letters 6, pp. 255259
G. Ljung and G. Box (1979): 'On a Measure of Lack of Fit in Time Series Models'. Biometrika 66, pp. 265270
ols
, diagnostics
, infocrit
, getsv
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35  ##aim: do gets on the xpart (i.e. the covariates) of an armax model.
##create the userdefined estimator (essentially consists of adding,
##renaming and reorganising the items returned by the chosen
##estimator):
myEstimator < function(y, x)
{
tmp < arima(y, order=c(1,0,1), xreg=x)
#rename and reorganise:
result < list()
result$coefficients < tmp$coef[c(1:3)]
result$vcov < tmp$var.coef
result$vcov < result$vcov[c(1:3),c(1:3)]
result$logl < tmp$loglik
result$n < tmp$nobs
result$k < NCOL(x)
result$df < result$n  result$k
return(result)
}
##generate some data:
##a series w/structural break and eleven stepdummies near the break
set.seed(123)
eps < arima.sim(list(ar=0.4, ma=0.1), 60)
x < coredata(sim(eps, which.ones=25:35)) #eleven stepdummies
y < 4*x[,"sis30"] + eps #create shift upwards at observation 30
plot(y)
##estimate the gum and then do gets in a single step:
getsFun(y, x, user.estimator=list(name="myEstimator"))
##estimate the gum and then do gets in two steps:
#mygum < myEstimator(y,x)
#getsFun(y, x, user.estimator=list(name="myEstimator"), gum.result=mygum)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.