Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ Error
This comes from the plotting routine. To get output only
suppressPackageStartupMessages({
library(astsa)
library(quantmod)
})
getSymbols("LOW", src = "yahoo", from = "2020-01-01", to = "2020-06-30")
#> 'getSymbols' currently uses auto.assign=TRUE by default, but will
#> use auto.assign=FALSE in 0.5-0. You will still be able to use
#> 'loadSymbols' to automatically load data. getOption("getSymbols.env")
#> and getOption("getSymbols.auto.assign") will still be checked for
#> alternate defaults.
#>
#> This message is shown once per session and may be disabled by setting
#> options("getSymbols.warning4.0"=FALSE). See ?getSymbols for details.
#> [1] "LOW"
LOW.rtn <- monthlyReturn(LOW$LOW.Adjusted, subset = NULL, type = "log", leading = TRUE)
rtn <- ts(LOW.rtn, frequency = 12, start = c(2020, 1))
arma11_fit <- sarima(rtn, 1, 0, 1, details = FALSE)
arma11_fit
#> $fit
#>
#> Call:
#> stats::arima(x = xdata, order = c(p, d, q), seasonal = list(order = c(P, D,
#> Q), period = S), xreg = xmean, include.mean = FALSE, transform.pars = trans,
#> fixed = fixed, optim.control = list(trace = trc, REPORT = 1, reltol = tol))
#>
#> Coefficients:
#> ar1 ma1 xmean
#> -0.5265 1.0000 0.0159
#> s.e. 0.4508 1.3745 0.0695
#>
#> sigma^2 estimated as 0.01738: log likelihood = 3.12, aic = 1.76
#>
#> $degrees_of_freedom
#> [1] 3
#>
#> $ttable
#> Estimate SE t.value p.value
#> ar1 -0.5265 0.4508 -1.1680 0.3272
#> ma1 1.0000 1.3745 0.7275 0.5196
#> xmean 0.0159 0.0695 0.2280 0.8343
#>
#> $AIC
#> [1] 0.2940397
#>
#> $AICc
#> [1] 2.29404
#>
#> $BIC
#> [1] 0.1552126
Created on 2020-10-01 by the reprex package (v0.3.0.9001)
Thanks, that works without returning the plots. anyway to also get plots?
It does return a plot of the standardized residuals; however, to get all plots, you need the last four parameters, including seasonality. 12 won't work; I'm not sure how to adjust for having only six months
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.