search for: narma

Displaying 13 results from an estimated 13 matches for "narma".

Did you mean: carma
2009 Mar 06
0
modifying a built in function from the stats package (fixing arima) (CONCLUSIONS)
...n, as.integer(0), TRUE) } armafn <- function(p, trans) { par <- coef par[mask] <- p trarma <- .Call(R_ARIMA_transPars, par, arma, trans) Z <- upARIMA(mod, trarma[[1]], trarma[[2]]) if (ncxreg > 0) x <- x - xreg %*% par[narma + (1:ncxreg)] res <- .Call(R_ARIMA_Like, x, Z$phi, Z$theta, Z$Delta, Z$a, Z$P, Z$Pn, as.integer(0), FALSE) s2 <- res[1]/res[3] 0.5 * (log(s2) + res[2]/res[3]) } armaCSS <- function(p) { par <- as.double(fixed) par[mask] <- p...
2009 Feb 17
0
What's the predict procedure of ARIMA in R?
...LL ncxreg <- myNCOL(xreg) if (myNCOL(newxreg) != ncxreg) stop("'xreg' and 'newxreg' have different numbers of columns") class(xreg) <- NULL xtsp <- tsp(rsd) n <- length(rsd) arma <- object$arma coefs <- object$coef narma <- sum(arma[1:4]) if (length(coefs) > narma) { if (names(coefs)[narma + 1] == "intercept") { xreg <- cbind(intercept = rep(1, n), xreg) newxreg <- cbind(intercept = rep(1, n.ahead), newxreg) ncxreg <- ncxreg + 1 }...
2013 Mar 22
0
predict.Arima error "'xreg' and 'newxreg' have different numbers of columns"
...ULL ncxreg <- myNCOL(xreg) if (myNCOL(newxreg) != ncxreg) stop("'xreg' and 'newxreg' have different numbers of columns") class(xreg) <- NULL xtsp <- tsp(rsd) n <- length(rsd) arma <- object$arma coefs <- object$coef narma <- sum(arma[1L:4L]) if (length(coefs) > narma) { if (names(coefs)[narma + 1L] == "intercept") { xreg <- cbind(intercept = rep(1, n), xreg) newxreg <- cbind(intercept = rep(1, n.ahead), newxreg) ncxreg <- ncxreg + 1L }...
2025 Jan 02
1
Possible issue in stats/arima.R package
...l. Could someone please clarify if the current logic is > correct? > In the R-devel source I see mod being used in the next statement: mod <- makeARIMA(trarma[[1L]], trarma[[2L]], Delta, kappa, SSinit) val <- if(ncxreg > 0L) arimaSS(x - xreg %*% coef[narma + (1L:ncxreg)], mod) else arimaSS(x, mod) It appears in both alternatives of the if statement. This one is strange though: the code in the github mirror (https://github.com/wch/r-source/blob/4a1ed749271c52e60a85e794e6f34b0831efb1ae/src/library/stats/R/arima.R#L256-L258) is different:...
2025 Jan 02
1
Possible issue in stats/arima.R package
...urrent logic is >> correct? >> > > In the R-devel source I see mod being used in the next statement: > > mod <- makeARIMA(trarma[[1L]], trarma[[2L]], Delta, kappa, SSinit) > val <- if(ncxreg > 0L) > arimaSS(x - xreg %*% coef[narma + (1L:ncxreg)], mod) > else arimaSS(x, mod) > > It appears in both alternatives of the if statement. > > This one is strange though: the code in the github mirror > (https://github.com/wch/r-source/blob/4a1ed749271c52e60a85e794e6f34b0831efb1ae/src/library/stats/R/arim...
2010 Mar 31
1
predict.Arima: warnings from xreg magic
...lt;- myNCOL(xreg) if (myNCOL(newxreg) != ncxreg) stop("'xreg' and 'newxreg' have different numbers of columns") class(xreg) <- NULL xtsp <- tsp(rsd) n <- length(rsd) arma <- object$arma coefs <- object$coef narma <- sum(arma[1L:4L]) if (length(coefs) > narma) { if (names(coefs)[narma + 1L] == "intercept") { xreg <- cbind(intercept = rep(1, n), xreg) newxreg <- cbind(intercept = rep(1, n.ahead), newxreg) ncxreg <- ncxreg + 1L...
2025 Jan 02
1
Possible issue in stats/arima.R package
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 ("\'seasonal\' is of the wrong length") it should be rather: if
2025 Jan 02
2
Possible issue in stats/arima.R package
...; correct? >>> >> >> In the R-devel source I see mod being used in the next statement: >> >> mod <- makeARIMA(trarma[[1L]], trarma[[2L]], Delta, kappa, SSinit) >> val <- if(ncxreg > 0L) >> arimaSS(x - xreg %*% coef[narma + (1L:ncxreg)], mod) >> else arimaSS(x, mod) >> >> It appears in both alternatives of the if statement. >> >> This one is strange though: the code in the github mirror >> (https://github.com/wch/r-source/blob/4a1ed749271c52e60a85e794e6f...
2004 Aug 02
3
help(arima) return value typo?
in ?arima (R-1.9.1), the return value component 'convergence' should be 'code'? (it's a pity there is no reliable way to check return value documentation consistency with the code, or is there?) h. ---------------------------------- Hiroyuki Kawakatsu School of Management and Economics 25 University Square Queen's University, Belfast Belfast BT7 1NN Northern Ireland
2009 Mar 01
0
Variable scope.
...uch as Z$a also passed as reference hence changes to Z$a should also be seen in mod$a? In the arima code the references to x and mod seem to be essentially global variables as armafn is 'nested' in arima. Will changes to x also be reflected in the original x? (Like x <- x - (xreg %*% par[narma + (1:ncxreg))) Thank you. Kevin
2004 Aug 02
3
help(arima) return value typo?
in ?arima (R-1.9.1), the return value component 'convergence' should be 'code'? (it's a pity there is no reliable way to check return value documentation consistency with the code, or is there?) h. ---------------------------------- Hiroyuki Kawakatsu School of Management and Economics 25 University Square Queen's University, Belfast Belfast BT7 1NN Northern Ireland
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)
2009 Dec 03
0
Problem with predict() and factors
...####### # END FOR EACH MODEL #################### dev.off() return("AUTOBOT") } -- End Script -- The problem exists in the line: newForecast[[i]] <-predict(newFit[[i]],n.ahead=modLength-modMax,newxreg=newmfReg[[i]]) resulting in the error: Error in as.matrix(newxreg) %*% coefs[-(1:narma)] : requires numeric matrix/vector arguments In addition: Warning message: In if (class(fit) != "try-error") offset <- -2 * fit$loglik - length(x) * : the condition has length > 1 and only the first element will be used I know that if I do not transform my 0/1 dummy regressor...