public class ARAutoUnivariate extends Object implements Serializable
ARAutoUnivariate
automatically selects the order of the AR
model that best fits the data and then computes the AR coefficients. The
algorithm used in ARAutoUnivariate
is derived from the work of
Akaike, H., et. al (1979) and Kitagawa and Akaike (1978). This code was
adapted from the UNIMAR procedure published as part of the TIMSAC-78
Library.
The best fit AR model is determined by successively fitting AR models
with \(0,1,2,\dots,\rm{maxlag}\) autoregressive
coefficients. For each model, Akaike's Information Criterion (AIC) is
calculated based on the formula $$\mbox{AIC} =
-2\ln(likelihood)+2p$$
Class ARAutoUnivariate
uses the approximation to this formula
developed by Ozaki and Oda (1979), $$\mbox{AIC} =
(n-\mbox{maxlag})\ln({\hat {\sigma}}^2)+2(p+1)+(n-\mbox{maxlag})(\ln(2\pi)+
1)$$ where \({\hat {\sigma}}^2\) is an estimate of
the residual variance of the series, commonly known in time series analysis
as the innovation variance and n is the number of observations in the
time series z
, n=z.length
. By dropping the
constant $$(n-\mbox{maxlag})(\ln(2\pi)+1),
$$ the calculation is simplified to
$$\mbox{AIC}=(n-\mbox{maxlag})\ln({\hat{\sigma}}^2)+
2(p+1),$$
The best fit model is the model with minimum AIC. If the number of
parameters in this model selected by ARAutoUnivariate
is equal
to the highest order autoregressive model fitted, i.e., p=
maxlag
, then a model with smaller AIC might exist for larger values
of maxlag
. In this case, increasing maxlag
to
explore AR models with additional autoregressive parameters might be
warranted.
Method setEstimationMethod
can be used to specify the method
used to calculate the AR coefficients. If setEstimationMethod
is
set to METHOD_OF_MOMENTS
, estimates of the autoregressive
coefficients for the model with minimum AIC are calculated using method of
moments as described in the ARMA
class. If LEAST_SQUARES
is specified, the coefficients are determined by the method of least
squares applied in the form described by Kitagawa and Akaike (1978). If
MAX_LIKELIHOOD
is specified, the coefficients are estimated
using maximum likelihood as described in the ARMAMaxLikelihood
class.
The Java Logging API can be used to trace the execution of
ARAutoUnivariate
. The name of this logger is
com.imsl.stat.ARAutoUnivariate
. Accumulated levels of detail
correspond to Java's FINE, FINER, and FINEST logging levels with FINE
yielding the smallest amount of information and FINEST yielding the most.
The levels of output yield the following:
Level | Output |
FINE | A message on entering and exiting method
compute . |
FINER | All of the messages in FINE , a message
entering and exiting the compute method, plus the
final computations. |
FINEST | All of the messages in FINER , plus the
intermediate computations. |
Modifier and Type | Class and Description |
---|---|
static class |
ARAutoUnivariate.Formatter
Deprecated.
Use
IMSLFormatter instead. |
static class |
ARAutoUnivariate.TriangularMatrixSingularException
The input triangular matrix is singular.
|
Modifier and Type | Field and Description |
---|---|
static int |
LEAST_SQUARES
Indicates that least-squares should be used for estimating the
coefficients in the time series.
|
static int |
MAX_LIKELIHOOD
Indicates that maximum likelihood should be used for estimating the
coefficients in the time series.
|
static int |
METHOD_OF_MOMENTS
Indicates the method of moments should be used for estimating the
coefficients in the time series.
|
Constructor and Description |
---|
ARAutoUnivariate(int maxlag,
double[] z)
ARAutoUnivariate constructor. |
Modifier and Type | Method and Description |
---|---|
void |
compute()
Determines the autoregressive model with the minimum AIC by fitting
autoregressive models from 0 to
maxlag lags using the method
of moments or an estimation method specified by the user through
setEstimationMethod . |
double[][] |
forecast(int nForecast)
Returns forecasts and associated confidence interval offsets.
|
double |
getAIC()
Returns the final estimate for Akaike's Information Criterion (AIC) at
the optimum.
|
double[] |
getAR()
Returns the final auto regressive parameter estimates at the optimum AIC
using the estimation method specified in
setEstimationMethod
. |
int |
getBackwardOrigin()
Returns the maximum backward origin.
|
double |
getConfidence()
Returns the confidence level for calculating confidence limit deviations
returned from
getDeviations . |
double |
getConstant()
Returns the estimate for the constant parameter in the ARMA series.
|
double |
getConvergenceTolerance()
Returns the tolerance level used to determine convergence of the
nonlinearleast-squares and maximum likelihood algorithms.
|
double[] |
getDeviations()
Returns the deviations used for calculating the forecast confidence
limits.
|
int |
getEstimationMethod()
Returns the estimation method used for estimating the autoregressive
coefficients.
|
double[] |
getForecast(int nForecast)
Returns forecasts
|
double |
getInnovationVariance()
Returns the final estimate for the innovation variance.
|
double |
getLikelihood()
Returns the final estimate for \(L=e^{-(\mbox{AIC} - 2p)/2}
\), where p is the AR order, AIC is Akaike's Information
Criterion, and L is the likelihood function evaluated for the
optimum autoregressive model.
|
Logger |
getLogger()
Returns the logger object.
|
int |
getMaxIterations()
Returns the value currently being used as the maximum number of
iterations allowed in the nonlinear equation solver used in both the
method of moments and least-squares algorithms.
|
int |
getMaxlag()
Returns the current value used to represent the maximum number of
autoregressive lags to achieve the minimum AIC.
|
double |
getMean()
Returns the mean used to center the time series
z . |
int |
getOrder()
Returns the order of the AR model selected with the minimum AIC.
|
double[] |
getResiduals()
Returns the current values of the vector of residuals.
|
double[] |
getTimeSeries()
Returns the time series used for estimating the minimum AIC and the
autoregressive coefficients.
|
double[] |
getTimsacAR()
Returns the final auto regressive parameter estimates at the optimum AIC
estimated by the original TIMSAC routine (UNIMAR).
|
double |
getTimsacConstant()
Returns the estimate for the constant parameter in the ARMA series.
|
double |
getTimsacVariance()
Returns the final estimate for the innovation variance calculated by the
TIMSAC automatic AR modeling routine (UNIMAR).
|
void |
setBackwardOrigin(int backwardOrigin)
Sets the maximum backward origin used in calculating the forecasts.
|
void |
setConfidence(double confidence)
Sets the confidence level for calculating confidence limit deviations
returned from
getDeviations . |
void |
setConvergenceTolerance(double convergenceTolerance)
Sets the tolerance level used to determine convergence of the nonlinear
least-squares and maximum likelihood algorithms.
|
void |
setEstimationMethod(int method)
Sets the estimation method used for estimating the final estimates for
the autoregressive coefficients.
|
void |
setMaxIterations(int iterations)
Sets the maximum number of iterations used for estimating the
autoregressive coefficients.
|
void |
setMean(double mean)
Sets the estimate of the mean used for centering the time series
z
. |
public static final int METHOD_OF_MOMENTS
public static final int LEAST_SQUARES
public static final int MAX_LIKELIHOOD
public ARAutoUnivariate(int maxlag, double[] z)
ARAutoUnivariate
constructor.maxlag
- an int
scalar specifying the maximum number
of autoregressive lags to evaluatez
- a double
array containing the time seriespublic void compute() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARMA.ResidualsTooLargeException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException
maxlag
lags using the method
of moments or an estimation method specified by the user through
setEstimationMethod
.ARMA.MatrixSingularException
- is thrown if the input matrix
is singular.ARMA.TooManyCallsException
- is thrown if the number of calls
to the function has exceeded the maximum number of
iterations times the number of moving average (MA)
parameters + 1.ARMA.IncreaseErrRelException
- is thrown if the bound for the
relative error is too small.ARMA.NewInitialGuessException
- is thrown if the iteration has
not made good progress.ARMA.IllConditionedException
- is thrown if the problem is
ill-conditioned.ARMA.TooManyITNException
- is thrown if the maximum number of
iterations is exceeded.ARMA.TooManyFcnEvalException
- is thrown if the maximum number
of function evaluations is exceeded.ARMA.TooManyJacobianEvalException
- is thrown if the maximum
number of Jacobian evaluations is exceeded.ARMA.ResidualsTooLargeException
- is thrown if the residuals
computed in one step of the Least Squares estimation of the
ARMA coefficients become too large.ARAutoUnivariate.TriangularMatrixSingularException
- is thrown if the input
triangular matrix is singular.ARMAMaxLikelihood.NonStationaryException
- is thrown if the
final maximum likelihood estimates for the time series
are non-stationaryARMAMaxLikelihood.NonInvertibleException
- is thrown if the
final maximum likelihood estimates for the time series
are noninvertible.ARMAMaxLikelihood.InitialMAException
- is thrown if the
initial values provided for the moving average terms
using setMA
are noninvertible. In this
case, ARMAMaxLikelihood
terminates and does
not compute the time series estimates.public double getAIC() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARMA.ResidualsTooLargeException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException
double
scalar value which is an approximation to
\(\mbox{AIC} = -2\ln(L)+2p\), where L
is the value of the maximum likelihood function evaluated at
the parameter estimates. The approximation uses the calculation
$$\mbox{AIC} \approx (\rm{n-maxlag})
\ln({\hat {\sigma}}^2)+2(p+1)+(\rm{n-maxlag})(\ln(2\pi)+1),
$$
where \({\hat {\sigma}}^2\) is an estimate of
the residual variance of the series, commonly known in time
series analysis as the innovation variance, and n
is the number of observations in the time series (
n=z.length
).ARMA.MatrixSingularException
- is thrown if the input matrix
is singularARMA.TooManyCallsException
- is thrown if the number of calls
to the function has exceeded the maximum number of
iterations times the number of moving average (MA)
parameters + 1ARMA.IncreaseErrRelException
- is thrown if the bound for the
relative error is too smallARMA.NewInitialGuessException
- is thrown if the iteration has
not made good progressARMA.IllConditionedException
- is thrown if the problem is
ill-conditionedARMA.TooManyITNException
- is thrown if the maximum number of
iterations is exceededARMA.TooManyFcnEvalException
- is thrown if the maximum number
of function evaluations is exceededARMA.TooManyJacobianEvalException
- is thrown if the maximum
number of Jacobian evaluations is exceededARMA.ResidualsTooLargeException
- is thrown if the residuals
computed in one step of the Least Squares estimation of the
ARMA coefficients become too large.ARAutoUnivariate.TriangularMatrixSingularException
- is thrown if the input
triangular matrix is singularARMAMaxLikelihood.NonStationaryException
- is thrown if the
final maximum likelihood estimates for the time series
are nonstationaryARMAMaxLikelihood.NonInvertibleException
- is thrown if the
final maximum likelihood estimates for the time series
are noninvertibleARMAMaxLikelihood.InitialMAException
- is thrown if the
initial values provided for the moving average terms
using setMA
are noninvertible. In this
case, ARMAMaxLikelihood
terminates and does
not compute the time series estimates.public double getConfidence()
getDeviations
.double
scalar value representing the confidence
level used in computing forecast confidence intervals.public int getBackwardOrigin()
int
scalar specifying the maximum backward
origin.public double getTimsacConstant() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARMA.ResidualsTooLargeException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException
double
scalar equal to the estimate for the
constant parameter in the ARMA series.ARMA.MatrixSingularException
- is thrown if the input matrix is
singular.ARMA.TooManyCallsException
- is thrown if the number of calls
to the function has exceeded the maximum number of
iterations times the number of moving average (MA)
parameters + 1.ARMA.IncreaseErrRelException
- is thrown if the bound for the
relative error is too small.ARMA.NewInitialGuessException
- is thrown if the iteration has
not made good progress.ARMA.IllConditionedException
- is thrown if the problem is
ill-conditioned.ARMA.TooManyITNException
- is thrown if the maximum number of
iterations is exceeded.ARMA.TooManyFcnEvalException
- is thrown if the maximum number
of function evaluations is exceeded.ARMA.TooManyJacobianEvalException
- is thrown if the maximum
number of Jacobian evaluations is exceeded.ARMA.ResidualsTooLargeException
- is thrown if the residuals
computed in one step of the Least Squares estimation of the
ARMA coefficients become too large.ARAutoUnivariate.TriangularMatrixSingularException
- is thrown if the input
triangular matrix is singular.ARMAMaxLikelihood.NonStationaryException
- is thrown if the
final maximum likelihood estimates for the time series
are non-stationary.ARMAMaxLikelihood.NonInvertibleException
- is thrown if the
final maximum likelihood estimates for the time series
are noninvertible.ARMAMaxLikelihood.InitialMAException
- is thrown if the initial
values provided for the moving average terms using
setMA
are noninvertible. In this case,
ARMAMaxLikelihood
terminates and does not compute
the time series estimates.public double getConstant() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARMA.ResidualsTooLargeException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException
double
scalar equal to the estimate for the
constant parameter in the ARMA series.ARMA.MatrixSingularException
- is thrown if the input matrix is
singular.ARMA.TooManyCallsException
- is thrown if the number of calls
to the function has exceeded the maximum number of
iterations times the number of moving average (MA)
parameters + 1.ARMA.IncreaseErrRelException
- is thrown if the bound for the
relative error is too small.ARMA.NewInitialGuessException
- is thrown if the iteration has
not made good progress.ARMA.IllConditionedException
- is thrown if the problem is
ill-conditioned.ARMA.TooManyITNException
- is thrown if the maximum number of
iterations is exceeded.ARMA.TooManyFcnEvalException
- is thrown if the maximum number
of function evaluations is exceeded.ARMA.TooManyJacobianEvalException
- is thrown if the maximum
number of Jacobian evaluations is exceeded.ARMA.ResidualsTooLargeException
- is thrown if the residuals
computed in one step of the Least Squares estimation of the
ARMA coefficients become too large.ARAutoUnivariate.TriangularMatrixSingularException
- is thrown if the input
triangular matrix is singular.ARMAMaxLikelihood.NonStationaryException
- is thrown if the
final maximum likelihood estimates for the time series
are non-stationary.ARMAMaxLikelihood.NonInvertibleException
- is thrown if the
final maximum likelihood estimates for the time series
are noninvertible.ARMAMaxLikelihood.InitialMAException
- is thrown if the initial
values provided for the moving average terms using
setMA
are noninvertible. In this case,
ARMAMaxLikelihood
terminates and does not compute
the time series estimates.public double[] getTimeSeries()
double
array containing the
time series values set in the constructor.public void setBackwardOrigin(int backwardOrigin)
backwardOrigin
- an int
scalar specifying the
maximum backward origin. backwardOrigin
must be greater than or equal to 0 and
less than or equal to z.length - p
,
where p
is the optimum number of
AR coeficients determined by
ARAutoUnivariate
. The forecasted values
returned will be z.length - backwardOrigin
through z.length
. Default:
backwardOrigin = 0
.public double[][] forecast(int nForecast) throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARMA.ResidualsTooLargeException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException
nForecast
- an input int
representing the number of
requested forecastsdouble
matrix of dimension nForecast
by backwardOrigin + 1
containing the forecasts. The
forecasts are for lead times \(l=1,2,\ldots,
\rm{nForecast}\) at origins
z.length-backwardOrigin-1+j
where \(j=1,\ldots,
\rm{backwardOrigin}+1\).ARMA.MatrixSingularException
- is thrown if the input matrix is
singularARMA.TooManyCallsException
- is thrown if the number of calls
to the function has exceeded the maximum number of
iterations times the number of moving average (MA)
parameters + 1ARMA.IncreaseErrRelException
- is thrown if the bound for the
relative error is too smallARMA.NewInitialGuessException
- is thrown if the iteration has
not made good progressARMA.IllConditionedException
- is thrown if the problem is
ill-conditionedARMA.TooManyITNException
- is thrown if the maximum number of
iterations is exceededARMA.TooManyFcnEvalException
- is thrown if the maximum number
of function evaluations is exceededARMA.TooManyJacobianEvalException
- is thrown if the maximum
number of Jacobian evaluations is exceededARAutoUnivariate.TriangularMatrixSingularException
- is thrown if the input
triangular matrix is singularARMAMaxLikelihood.NonStationaryException
- is thrown if the
final maximum likelihood estimates for the time series
are nonstationaryARMAMaxLikelihood.NonInvertibleException
- is thrown if the
final maximum likelihood estimates for the time series
are noninvertibleARMAMaxLikelihood.InitialMAException
- is thrown if the initial
values provided for the moving average terms using
setMA
are noninvertible. In this case,
ARMAMaxLikelihood
terminates and does not compute
the time series estimates.ARMA.ResidualsTooLargeException
public double[] getForecast(int nForecast) throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARMA.ResidualsTooLargeException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException
nForecast
- an input int
representing the number of
requested forecasts beyond the last value in the
series.double
array containing the
nForecast+backwardOrigin
forecasts. The first
backwardOrigin
forecasts are one-step ahead forecasts for
the last backwardOrigin
values in the series. The
next nForecast
values in the returned series are
forecasts for the next values beyond the series.NonStationary
- is thrown if the final maximum likelihood
estimates for the time series are nonstationary.NonInvertible
- is thrown if the final maximum likelihood
estimates for the time series are noninvertible.InitialMAException
- is thrown if the initial values provided
for the moving average terms using setMA
are
noninvertible. In this case, ARMAMaxLikelihood
terminates and does not compute the time series
estimates.ARMA.MatrixSingularException
- is thrown if the input matrix is
singular.ARMA.TooManyCallsException
- is thrown if the number of calls
to the function has exceeded the maximum number of
iterations times the number of moving average (MA)
parameters + 1.ARMA.IncreaseErrRelException
- is thrown if the bound for the
relative error is too small.ARMA.NewInitialGuessException
- is thrown if the iteration has
not made good progress.ARMA.IllConditionedException
- is thrown if the problem is
ill-conditioned.ARMA.TooManyITNException
- is thrown if the maximum number of
iterations is exceeded.ARMA.TooManyFcnEvalException
- is thrown if the maximum number
of function evaluations is exceeded.ARMA.TooManyJacobianEvalException
- is thrown if the maximum
number of Jacobian evaluations is exceeded.ARMA.ResidualsTooLargeException
- is thrown if the residuals
computed in one step of the Least Squares estimation of the
ARMA coefficients become too large.ARAutoUnivariate.TriangularMatrixSingularException
- is thrown if the input
triangular matrix is singular.ARMAMaxLikelihood.NonStationaryException
- is thrown if the
final maximum likelihood estimates for the time series
are non-stationary.ARMAMaxLikelihood.NonInvertibleException
- is thrown if the
final maximum likelihood estimates for the time series
are noninvertible.ARMAMaxLikelihood.InitialMAException
- is thrown if the initial
values provided for the moving average terms using
setMA
are noninvertible. In this case,
ARMAMaxLikelihood
terminates and does not compute
the time series estimates.public double[] getDeviations()
double
array of length
backwardOrigin+nForecast
containing the deviations for
calculating forecast confidence intervals. The confidence level
is specified in confidence
. By default,
confidence
= 0.95.public double getLikelihood() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARMA.ResidualsTooLargeException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException
MAX_LIKELIHOOD
is set in
the setEstimationMethod
, the exact likelihood evaluated for
the optimum autoregressive model will be returned. Otherwise it is
calculated using the approximation to the AIC.double
scalar equal to the maximum of the
likelihood function, \(L=e^{-(\mbox{AIC} - 2p)/2}
\).ARMA.MatrixSingularException
- is thrown if the input matrix is
singular.ARMA.TooManyCallsException
- is thrown if the number of calls
to the function has exceeded the maximum number of
iterations times the number of moving average (MA)
parameters + 1.ARMA.IncreaseErrRelException
- is thrown if the bound for the
relative error is too small.ARMA.NewInitialGuessException
- is thrown if the iteration has
not made good progress.ARMA.IllConditionedException
- is thrown if the problem is
ill-conditioned.ARMA.TooManyITNException
- is thrown if the maximum number of
iterations is exceeded.ARMA.TooManyFcnEvalException
- is thrown if the maximum number
of function evaluations is exceeded.ARMA.TooManyJacobianEvalException
- is thrown if the maximum
number of Jacobian evaluations is exceeded.ARMA.ResidualsTooLargeException
- is thrown if the residuals
computed in one step of the Least Squares estimation of the
ARMA coefficients become too large.ARAutoUnivariate.TriangularMatrixSingularException
- is thrown if the input
triangular matrix is singular.ARMAMaxLikelihood.NonStationaryException
- is thrown if the
final maximum likelihood estimates for the time series
are non-stationary.ARMAMaxLikelihood.NonInvertibleException
- is thrown if the
final maximum likelihood estimates for the time series
are noninvertible.ARMAMaxLikelihood.InitialMAException
- is thrown if the initial
values provided for the moving average terms using
setMA
are noninvertible. In this case,
ARMAMaxLikelihood
terminates and does not compute
the time series estimates.public double getTimsacVariance() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARMA.ResidualsTooLargeException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException
maxlag
since the series length in this
computation depends on its value. Use getInnovationVariance
to return the innovation variance calculated using the maximum series
length.double
scalar value equal to the estimate for
the innovation variance.ARMA.MatrixSingularException
- is thrown if the input matrix is
singular.ARMA.TooManyCallsException
- is thrown if the number of calls
to the function has exceeded the maximum number of
iterations times the number of moving average (MA)
parameters + 1.ARMA.IncreaseErrRelException
- is thrown if the bound for the
relative error is too small.ARMA.NewInitialGuessException
- is thrown if the iteration has
not made good progress.ARMA.IllConditionedException
- is thrown if the problem is
ill-conditioned.ARMA.TooManyITNException
- is thrown if the maximum number of
iterations is exceeded.ARMA.TooManyFcnEvalException
- is thrown if the maximum number
of function evaluations is exceeded.ARMA.TooManyJacobianEvalException
- is thrown if the maximum
number of Jacobian evaluations is exceeded.ARMA.ResidualsTooLargeException
- is thrown if the residuals
computed in one step of the Least Squares estimation of the
ARMA coefficients become too large.ARAutoUnivariate.TriangularMatrixSingularException
- is thrown if the input
triangular matrix is singular.ARMAMaxLikelihood.NonStationaryException
- is thrown if the
final maximum likelihood estimates for the time series
are nonstationary.ARMAMaxLikelihood.NonInvertibleException
- is thrown if the
final maximum likelihood estimates for the time series
are noninvertible.ARMAMaxLikelihood.InitialMAException
- is thrown if the initial
values provided for the moving average terms using
setMA
are noninvertible. In this case,
ARMAMaxLikelihood
terminates and does not compute
the time series estimates.public double getInnovationVariance() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARMA.ResidualsTooLargeException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException
double
scalar value equal to the estimate for
the innovation variance.ARMA.MatrixSingularException
- is thrown if the input matrix is
singular.ARMA.TooManyCallsException
- is thrown if the number of calls
to the function has exceeded the maximum number of
iterations times the number of moving average (MA)
parameters + 1.ARMA.IncreaseErrRelException
- is thrown if the bound for the
relative error is too small.ARMA.NewInitialGuessException
- is thrown if the iteration has
not made good progress.ARMA.IllConditionedException
- is thrown if the problem is
ill-conditioned.ARMA.TooManyITNException
- is thrown if the maximum number of
iterations is exceeded.ARMA.TooManyFcnEvalException
- is thrown if the maximum number
of function evaluations is exceeded.ARMA.TooManyJacobianEvalException
- is thrown if the maximum
number of Jacobian evaluations is exceeded.ARMA.ResidualsTooLargeException
- is thrown if the residuals
computed in one step of the Least Squares estimation of the
ARMA coefficients become too large.ARAutoUnivariate.TriangularMatrixSingularException
- is thrown if the input
triangular matrix is singular.ARMAMaxLikelihood.NonStationaryException
- is thrown if the
final maximum likelihood estimates for the time series
are non-stationary.ARMAMaxLikelihood.NonInvertibleException
- is thrown if the
final maximum likelihood estimates for the time series
are noninvertible.ARMAMaxLikelihood.InitialMAException
- is thrown if the initial
values provided for the moving average terms using
setMA
are noninvertible. In this case,
ARMAMaxLikelihood
terminates and does not compute
the time series estimates.public double getMean() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARMA.ResidualsTooLargeException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException
z
.double
containing the value used to center the
series before searching for the optimum number of AR lags. This
is equal to the mean of the time series z
unless the
mean was set in the setMean
method.ARMA.MatrixSingularException
- is thrown if the input matrix is
singular.ARMA.TooManyCallsException
- is thrown if the number of calls
to the function has exceeded the maximum number of
iterations times the number of moving average (MA)
parameters + 1.ARMA.IncreaseErrRelException
- is thrown if the bound for the
relative error is too small.ARMA.NewInitialGuessException
- is thrown if the iteration has
not made good progress.ARMA.IllConditionedException
- is thrown if the problem is
ill-conditioned.ARMA.TooManyITNException
- is thrown if the maximum number of
iterations is exceeded.ARMA.TooManyFcnEvalException
- is thrown if the maximum number
of function evaluations is exceeded.ARMA.TooManyJacobianEvalException
- is thrown if the maximum
number of Jacobian evaluations is exceeded.ARMA.ResidualsTooLargeException
- is thrown if the residuals
computed in one step of the Least Squares estimation of the
ARMA coefficients become too large.ARAutoUnivariate.TriangularMatrixSingularException
- is thrown if the input
triangular matrix is singular.ARMAMaxLikelihood.NonStationaryException
- is thrown if the
final maximum likelihood estimates for the time series
are nonstationary.ARMAMaxLikelihood.NonInvertibleException
- is thrown if the
final maximum likelihood estimates for the time series
are noninvertible.ARMAMaxLikelihood.InitialMAException
- is thrown if the initial
values provided for the moving average terms using
setMA
are noninvertible. In this case,
ARMAMaxLikelihood
terminates and does not compute
the time series estimates.public void setMean(double mean)
z
.mean
- a double
containing the estimate of the mean for
the time series z
. By default, the time series
z
is centered about its sample mean.public void setConvergenceTolerance(double convergenceTolerance)
convergenceTolerance
- a double
scalar containing
the tolerance level used to determine convergence of the
nonlinear least-squares and maximum likelihood algorithms.
convergenceTolerance
represents the minimum
relative decrease in sum of squares between two iterations
required to determine convergence. Hence,
convergenceTolerance
must be greater than or
equal to 0. By default, convergenceTolerance =
\(10^{-10}\).public double getConvergenceTolerance()
double
scalar containing the tolerance level
used to determine convergence of the nonlinear least-squares
algorithm. convergenceTolerance
represents the
minimum relative decrease in sum of squares between two
iterations required to determine convergence.public void setMaxIterations(int iterations)
iterations
- an int
scalar specifying the maximum
number of iterations allowed in the nonlinear
equation solver used in both the method of moments
and least-squares algorithms. Default:
iterations
= 300.IllegalArgumentException
- is thrown if
iterations
is less than or equal to 0.public void setConfidence(double confidence)
getDeviations
.confidence
- a double
scalar specifying the
confidence level used in computing forecast
confidence intervals. Typical choices for
confidence
are 0.90, 0.95, and 0.99.
confidence
must be greater than 0.0 and less
than 1.0. Default: confidence = 0.95
.public int getMaxIterations()
int
containing the maximum number of iterations
allowed.public void setEstimationMethod(int method)
method
- an int
scalar specifying the estimation
method. Specify
METHOD_OF_MOMENTS
LEAST_SQUARES
MAX_LIKELIHOOD
method
=
LEAST_SQUARES
.public int getEstimationMethod()
int
equal to 0, 1, or 2, representing the
autoregressive coefficient estimation method, which implies
METHOD_OF_MOMENTS
LEAST_SQUARES
MAX_LIKELIHOOD
public double[] getTimsacAR() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARMA.ResidualsTooLargeException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException
maxlag
since its value changes
the length of the series used to estimate these parameters. Use the
getAR
method to obtain the best estimates from the
estimation method specified by setEstimationMethod
calculated using the maximum number of available observations.double
array of length p containing the
estimates for the autoregressive parameters.ARMA.MatrixSingularException
- is thrown if the input matrix is
singular.ARMA.TooManyCallsException
- is thrown if the number of calls
to the function has exceeded the maximum number of
iterations times the number of moving average (MA)
parameters + 1.ARMA.IncreaseErrRelException
- is thrown if the bound for the
relative error is too small.ARMA.NewInitialGuessException
- is thrown if the iteration has
not made good progress.ARMA.IllConditionedException
- is thrown if the problem is
ill-conditioned.ARMA.TooManyITNException
- is thrown if the maximum number of
iterations is exceeded.ARMA.TooManyFcnEvalException
- is thrown if the maximum number
of function evaluations is exceeded.ARMA.TooManyJacobianEvalException
- is thrown if the maximum
number of Jacobian evaluations is exceeded.ARMA.ResidualsTooLargeException
- is thrown if the residuals
computed in one step of the Least Squares estimation of the
ARMA coefficients become too large.ARAutoUnivariate.TriangularMatrixSingularException
- is thrown if the input
triangular matrix is singular.ARMAMaxLikelihood.NonStationaryException
- is thrown if the
final maximum likelihood estimates for the time series
are non-stationary.ARMAMaxLikelihood.NonInvertibleException
- is thrown if the
final maximum likelihood estimates for the time series
are noninvertible.ARMAMaxLikelihood.InitialMAException
- is thrown if the initial
values provided for the moving average terms using
setMA
are noninvertible. In this case,
ARMAMaxLikelihood
terminates and does not compute
the time series estimates.public double[] getAR() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARMA.ResidualsTooLargeException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException
setEstimationMethod
.double
array containing the estimates for the
autoregressive parameters.ARMA.MatrixSingularException
- is thrown if the input matrix is
singular.ARMA.TooManyCallsException
- is thrown if the number of calls
to the function has exceeded the maximum number of
iterations times the number of moving average (MA)
parameters + 1.ARMA.IncreaseErrRelException
- is thrown if the bound for the
relative error is too small.ARMA.NewInitialGuessException
- is thrown if the iteration has
not made good progress.ARMA.IllConditionedException
- is thrown if the problem is
ill-conditioned.ARMA.TooManyITNException
- is thrown if the maximum number of
iterations is exceeded.ARMA.TooManyFcnEvalException
- is thrown if the maximum number
of function evaluations is exceeded.ARMA.TooManyJacobianEvalException
- is thrown if the maximum
number of Jacobian evaluations is exceeded.ARMA.ResidualsTooLargeException
- is thrown if the residuals
computed in one step of the Least Squares estimation of the
ARMA coefficients become too large.ARAutoUnivariate.TriangularMatrixSingularException
- is thrown if the input
triangular matrix is singular.ARMAMaxLikelihood.NonStationaryException
- is thrown if the
final maximum likelihood estimates for the time series
are nonstationary.ARMAMaxLikelihood.NonInvertibleException
- is thrown if the
final maximum likelihood estimates for the time series
are noninvertible.ARMAMaxLikelihood.InitialMAException
- is thrown if the initial
values provided for the moving average terms using
setMA
are noninvertible. In this case,
ARMAMaxLikelihood
terminates and does not compute
the time series estimates.public double[] getResiduals()
double
array of length backwardOrigin
containing the residuals for the last
backwardOrigin
values in the time series. This array
will be null unless compute
and either the
forecast
or getForecast
methods are called
previously.public int getOrder() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARMA.ResidualsTooLargeException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException
int
containing the optimum AR order selected by
ARAutoUnivariate
's minimum AIC selection.ARMA.MatrixSingularException
- is thrown if the input matrix is
singular.ARMA.TooManyCallsException
- is thrown if the number of calls
to the function has exceeded the maximum number of
iterations times the number of moving average (MA)
parameters + 1.ARMA.IncreaseErrRelException
- is thrown if the bound for the
relative error is too small.ARMA.NewInitialGuessException
- is thrown if the iteration has
not made good progress.ARMA.IllConditionedException
- is thrown if the problem is
ill-conditioned.ARMA.TooManyITNException
- is thrown if the maximum number of
iterations is exceeded.ARMA.TooManyFcnEvalException
- is thrown if the maximum number
of function evaluations is exceeded.ARMA.TooManyJacobianEvalException
- is thrown if the maximum
number of Jacobian evaluations is exceeded.ARMA.ResidualsTooLargeException
- is thrown if the residuals
computed in one step of the Least Squares estimation of the
ARMA coefficients become too large.ARAutoUnivariate.TriangularMatrixSingularException
- is thrown if the input
triangular matrix is singular.ARMAMaxLikelihood.NonStationaryException
- is thrown if the
final maximum likelihood estimates for the time series
are non-stationary.ARMAMaxLikelihood.NonInvertibleException
- is thrown if the
final maximum likelihood estimates for the time series
are noninvertible.ARMAMaxLikelihood.InitialMAException
- is thrown if the initial
values provided for the moving average terms using
setMA
are noninvertible. In this case,
ARMAMaxLikelihood
terminates and does not compute
the time series estimates.public int getMaxlag()
int
containing the maximum number of
autoregressive lags evaluated.public Logger getLogger()
Copyright © 2020 Rogue Wave Software. All rights reserved.