stsmFit(x, stsm.method = c("maxlik.fd.scoring", "maxlik.td.scoring", "maxlik.fd.optim", "maxlik.td.optim"), xreg = NULL, ...)stsm.method.stsmFit.
See the section Value in maxlik.fd.
stsm.method.
For example, the package tsoutliers uses:
do.call("stsmFit", args = c(list(x = y, args.tsmethod)),
where args.tsmethod is a list containing the arguments to
be passed to stsmFit, which includes stsm.method.
Thus, the code is simplified since no switch or if
statements are necessary; the number of arguments is also reduced
since those that are passed tot the function specified in
stsm.method are gathered in a list.The external regressors can be defined in the input object
x of class stsm. This is the way the recommend specification
for functions maxlik.td and maxlik.fd. This interface allows
defining xreg as an argument passed to this function because it
simplifies the code in some functions of package tsoutliers.
If xreg and x@xreg are both not NULL and error is returned.
maxlik.fd.scoring,
maxlik.td.scoring,
maxlik.fd.optim and
maxlik.td.optim.