Displaying 20 results from an estimated 1000 matches similar to: "predict.Arima error "'xreg' and 'newxreg' have different numbers of columns""
2009 Feb 17
0
What's the predict procedure of ARIMA in R?
Hello,guys:
Recently, I am working on a seasonal ARIMA model. And I met some problem in the forecasting.
Now I just want to know that How does R perform the predict procedure(the predict formula, the initial setting of errors,etc.)?
I run the following commands and get the original code of the "predict" command, but I can't read it.
Can anybody explain it to me?
Thanks!
saji from
2010 Mar 31
1
predict.Arima: warnings from xreg magic
When I run predict.Arima in my code, I get warnings like:
Warning message:
In cbind(intercept = rep(1, n), xreg) :
number of rows of result is not a multiple of vector length (arg 1)
I think this is because I'm not running predict.Arima in the same
environment that I did the fit, so the data object used in the fit is no
longer present. Looking at the predict.Arima source,
2009 Mar 06
0
modifying a built in function from the stats package (fixing arima) (CONCLUSIONS)
Thanks a lot to everybody that helped me out with this.
Conclusions:
(1)
In order to edit arima in R:
>fix(arima)
or alternatively:
>arima<-edit(arima)
(2)
This is not contained in the "Introduction to R" manual.
(3)
A "productive" fix of arima is attached (arma coefficients printed out and
error catched so that it doesn't halt parent loops to search for
2025 Jan 02
1
Possible issue in stats/arima.R package
On 2025-01-02 9:04 a.m., Norbert Kuder wrote:
> Hello all,
>
> I am running R version 4.4.2 (2024-10-31 ucrt) on Windows 10 x64, and
> noticed something that might be a minor bug (or at least inconsistent code)
> in the stats/arima.R package.
> I have found:
> 1. A missing stop() call at line 69:
> if (length(order) == 3) seasonal <- list(order = seasonal) else
2025 Jan 02
1
Possible issue in stats/arima.R package
On 2025-01-02 11:20 a.m., Duncan Murdoch wrote:
> On 2025-01-02 9:04 a.m., Norbert Kuder wrote:
>> Hello all,
>>
>> I am running R version 4.4.2 (2024-10-31 ucrt) on Windows 10 x64, and
>> noticed something that might be a minor bug (or at least inconsistent code)
>> in the stats/arima.R package.
>> I have found:
>> 1. A missing stop() call at line 69:
2025 Jan 02
2
Possible issue in stats/arima.R package
>>>>> Duncan Murdoch
>>>>> on Thu, 2 Jan 2025 11:28:45 -0500 writes:
> On 2025-01-02 11:20 a.m., Duncan Murdoch wrote:
>> On 2025-01-02 9:04 a.m., Norbert Kuder wrote:
>>> Hello all,
>>>
>>> I am running R version 4.4.2 (2024-10-31 ucrt) on Windows 10 x64, and
>>> noticed something that might
2008 Jul 08
0
forecast & xreg
Dear all,
I am fitting an arimax (arima with some extra explanatory variables)
model to a time series. Say, I have a Y (dependent variable) and an X
(explanatory).
Y is 100 observations (time series) and X is 100 + 20 (20 to use for the
forecast horizon).
I can not make xreg work with the forecast function for an arima fit.
The "predict" function seems to be working but the
2009 Mar 26
1
arima, xreg, and the armax model
Hello all,
I''m having fun again with the arima function. This time I read in:
http://www.stat.pitt.edu/stoffer/tsa2/R_time_series_quick_fix.htm
<<It has recently been suggested (by a reliable source) that using xreg in
arima() does NOT fit an ARMAX model [insert slap head icon here]. This will
be investigated as soon as time permits.>>
(by R.H. Shumway & D.S. Stoffer)
2012 Nov 14
0
Time Series with External Regressors in R Problems with XReg
Hello everyone,
Hope you all are doing great! I have been fitting arima models and
performing forecasts pretty straightforwardly in R.
However, I wanted to add a couple of regressors to the arima model to see if
it could improve the accuracy of the forecasts but have had a hard time
trying to do so.
I used the following R function:
arima(x, order = c(0, 0, 0),
seasonal = list(order = c(0, 0,
2009 Mar 01
0
Variable scope.
I have a question on scope/reference/value type of variables with 'R'.
The issue cam up first when I look at the arima code.
I see code like:
myupARIMA <- function(mod, phi, theta) {
. . . .
mod
}
Then
armafn <- function(p, trans) {
. . . .
Z <- upARIMA(mod, trarma[[1]], trarma[[2]])
. . . .
res <- .Call(R_ARIMA_Like, x,
2009 Dec 03
0
Problem with predict() and factors
I am working on a script that takes numeric performance indicators and runs
them against a series of regressors (dummy regressors, yes\no stuff via 0
and 1, e.g. Was is Christmas this week 0=no, 1=yes).
The script is as follows (Written as a function):
-- Begin Script --
doEnv <- function(HOUR,ENVNAME,REPORTNAME) {
library(RODBC)
library(forecast)
library("geneplotter")
2007 Mar 02
0
R: ARIMA forecasting
Dear all,
I just have a short question regarding the forecasting of ARIMA models with
external regressors.
I tried to program a ARX(1) model
arx.mod <- arima(reihe.lern, order = c(1, 0, 0), seasonal =
list(order = c(0, 0, 0), period = 52), xreg = lern.design, include.mean =
TRUE)
for which I need to estimate the next (105th) value. Xreg=lern.design is -
at this time - 104 rows long. I
2009 Jul 15
2
storing lm() results and other objects in a list
to clean up some code I would like to make a list of arbitrary length
to store?various objects for use in a loop
sample code:
############ BEGIN SAMPLE ##############
# You can see the need for a loop already
linearModel1=lm(modelSource ~ .,mcReg)
linearModel2=step(linearModel1)
linearModel3=lm(modelSource ~ .-1,mcReg)
linearModel4=step(linearModel3)
#custom
linearModel5=lm(modelSource ~ .
2005 Jul 08
1
help with ARIMA and predict
I'm trying to do the following out of sample
regression with autoregressive terms and additional x
variables:
y(t+1)=const+B(L)*y(t)+C(1)*x_1(t)...+C(K)*x_K(t)
where:
B(L) = lag polynom. for AR terms
C(1..K) = are the coeffs. on K exogenous variables
that have only 1 lag
Question 1:
-----------
Suppose I use arima to fit the model:
2009 Jan 21
1
forecasting issue
Hello everybody!
I have a problem when I try to perform a forecast of an ARIMA model
produced by an auto.arima function. Here is what I'm doing:
c<-auto.arima(fil[[1]],start.p=0,start.q=0,start.P=0,start.Q=0,stepwise=TRUE,stationary=FALSE,trace=TRUE)
# fil[[1]] is time series of monthly data
ARIMA(0,0,0)(0,1,0)[12] with drift : 1725.272
ARIMA(0,0,0)(0,1,0)[12] with drift
2008 May 22
1
How to account for autoregressive terms?
Hi,
how to estimate a the following model in R:
y(t)=beta0+beta1*x1(t)+beta2*x2(t)+...+beta5*x5(t)+beta6*y(t-1)+beta7*y(t-2)+beta8*y(t-3)
1) using "lm" :
dates <- as.Date(data.df[,1])
selection<-which(dates>=as.Date("1986-1-1") & dates<=as.Date("2007-12-31"))
dep <- ts(data.df[selection,c("dep")])
indep.ret1
2010 May 04
1
How to make predictions with the predict() method on an arimax object using arimax() from TSA library
Hi R Users,
I'm fairly new to R (about 3 months use thus far.)
I wanting to use the arimax function from the TSA library to incorporate some exogenous inputs into the basic underllying arima model.Then with that newly model of type arimax, I would like to make a prediction.
To avoid being bogged down with issues specific to my own work, I would like to refer to readers to the example
2003 Dec 18
0
Help with predict.Arima with external regressor values
Hi all there
I am enjoying R since 2 weeks and I come to my first deadlock, il am trying
to use predict.Arima in the ts package.
I get a "Error in cbind(...) : cannot create a matrix from these types"
-- Start R session -----------------------------------------------------
> fitdiv <- arima(data, c(2, 0, 3), xreg = y ) ; print(fitdiv)
Call:
arima(x = data, order = c(2, 0, 3),
2003 Dec 18
1
Help with predict.Arima with external regressor values [Repalced]
Hi all there
I am enjoying R since 2 weeks and I come to my first deadlock, il am trying
to use predict.Arima in the ts package.
I get a "Error in cbind(...) : cannot create a matrix from these types"
-- Start R session -----------------------------------------------------
> fitdiv <- arima(data, c(2, 0, 3), xreg = y ) ; print(fitdiv)
Call:
arima(x = data, order = c(2, 0, 3),
2008 Jan 11
1
question about xreg of arima
Hi,
I am trying to understand exactly what xreg does in arima. The documentation
for xreg says:"xreg Optionally, a vector or matrix of external regressors,
which must have the same number of rows as x." What does this mean with
regard to the action of xreg in arima?
Apparently somehow xreg made the following two arima fit equivalent in R:
arima(x, order=c(1,1,1), xreg=1:length(x))
is