|
JMSLTM Numerical Library 5.0.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.imsl.stat.ARAutoUnivariate
public class ARAutoUnivariate
Automatically determines the best autoregressive time series model using Akaike's Information Criterion.
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 autoregressive coefficients. For each model, Akaike's Information Criterion (AIC) is calculated based on the formula
ClassARAutoUnivariate
uses the approximation to this formula developed by Ozaki
and Oda (1979),
where 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
the calculation is simplified to
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 coeficients. 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. |
Nested Class Summary | |
---|---|
static class |
ARAutoUnivariate.Formatter
Simple formatter for ARAutoUnivariate logging |
static class |
ARAutoUnivariate.TriangularMatrixSingularException
The input triangular matrix is singular. |
Field Summary | |
---|---|
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 Summary | |
---|---|
ARAutoUnivariate(int maxlag,
double[] z)
ARAutoUnivariate constructor. |
Method Summary | |
---|---|
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 , 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 . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LEAST_SQUARES
public static final int MAX_LIKELIHOOD
public static final int METHOD_OF_MOMENTS
Constructor Detail |
---|
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 seriesMethod Detail |
---|
public void compute() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException, ARMAMaxLikelihood.InitialMAException
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.
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[][] forecast(int nForecast) throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException, ARMAMaxLikelihood.InitialMAException
nForecast
- an input int
representing the number of
requested forecasts
double
matrix of dimension
nForecast
by backwardOrigin + 1
containing the forecasts. The forecasts are for
lead times at
origins z.length-backwardOrigin-1+j
where
.
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
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 getAIC() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException, ARMAMaxLikelihood.InitialMAException
double
scalar value which is an approximation to
, where L is the
value of the maximum likelihood function evaluated at the
parameter estimates. The approximation uses the calculation
where 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
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
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[] getAR() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException, ARMAMaxLikelihood.InitialMAException
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.
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 int getBackwardOrigin()
int
scalar specifying the maximum backward origin.public double getConfidence()
getDeviations
.
double
scalar value representing the confidence
level used in computing forecast confidence intervals.public double getConstant() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException, ARMAMaxLikelihood.InitialMAException
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.
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 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 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 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[] getForecast(int nForecast) throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException, ARMAMaxLikelihood.InitialMAException
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.
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, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException, ARMAMaxLikelihood.InitialMAException
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.
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 getLikelihood() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException, ARMAMaxLikelihood.InitialMAException
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, .
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.
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 Logger getLogger()
public int getMaxIterations()
int
containing the maximum number of iterations
allowed.public int getMaxlag()
int
containing the maximum number of
autoregressive lags evaluated.public double getMean() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException, ARMAMaxLikelihood.InitialMAException
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.
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 int getOrder() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException, ARMAMaxLikelihood.InitialMAException
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.
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 double[] getTimeSeries()
double
array containing the
time series values set in the constructor.public double[] getTimsacAR() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException, ARMAMaxLikelihood.InitialMAException
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.
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 getTimsacConstant() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException, ARMAMaxLikelihood.InitialMAException
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.
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 getTimsacVariance() throws ARMA.MatrixSingularException, ARMA.TooManyCallsException, ARMA.IncreaseErrRelException, ARMA.NewInitialGuessException, ARMA.IllConditionedException, ARMA.TooManyITNException, ARMA.TooManyFcnEvalException, ARMA.TooManyJacobianEvalException, ARAutoUnivariate.TriangularMatrixSingularException, ARMAMaxLikelihood.NonStationaryException, ARMAMaxLikelihood.NonInvertibleException, ARMAMaxLikelihood.InitialMAException
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.
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 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 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 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 =
.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 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 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.
|
JMSLTM Numerical Library 5.0.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |