Getting auto.arima working - r

Pls can someone help me with how to get auto.arima working in my r. what package should i download? I tried to download auto.arima package but it was not available.

try this
install.packages("forecast")
library(forecast)
then try using the auto.arima function

Related

Installed caret but still missing createDataPartition function in R

I am new to R so I tried predicting using linear reg model and I am getting the error as shown in the image below, can you help me out?
Libraries included:
library(tidyverse)
library(ggplot2)
library(caret)
library(dplyr)
library(tidypredict)
png
Try running the library(caret) again, if the package is loaded, createDataPartition is there. If you still face the issue, check for Caret updates.

Simples moving average error using the forecast package

When I try to forecast a time series with sma using the forecasting function I get this error:
fc <- forecast(sma(ts),h=3)
Error: The provided model is not Simple Moving Average!
Anyone knows how to fix it?
The forecast is from the fpp2 package and the moving average function is from the smooth package.
This is an example:
library(smooth)
library(fpp2)
library(readxl)
setwd("C:\\Users\\lferreira\\Desktop\\FORECASTING")
data<- read_xlsx("BASE_TESTE.xlsx")
ts <- ts(data$`1740`,start=c(2014,1),frequency=4)
> fc <- forecast(sma(ts),h=3)
Error: The provided model is not Simple Moving Average!
Your example is not reproducible because you have not provided the data.
The following example is reproducible, and does not give an error.
library(smooth)
forecast(sma(USAccDeaths))
Note that the forecast function being used here is not part of the fpp2 package. It is from the smooth package.
To check what's going on with your example:
First check that your data is correctly read in.
Then check that the sma function is returning something sensible. The error message suggests that the function is not returning the model it should.

Error "could not find function nnet" in R

I am trying to use the function nnet after installing neuralnet package and using the code:
library(neuralnet)
and still get this error all the time.
Does anyone can help me to solve the problem?
thanks
Function nnet is not part of the neuralnet package. The function nnet is part of the nnet package. You need to install the package nnet and load it with library(nnet).
Are you sure there is such a function in the package?
It is not mentioned in the manual of CRAN: https://cran.r-project.org/web/packages/neuralnet/neuralnet.pdf.

package required for "mmetric" function in R

I'm trying out Naive Bayes classification using stock dataset in R. Now for displaying the final results I've seen a function mmetric taking testing data and prediction model as arguments. But while I'm trying the same I'm facing the error could not find function "mmetric". I have installed the rminer and list packages which are quotes as reference packages for these. But still I could not resolve it.
Any Suggestions to resolve the error?
I got same error but i updated my Rcpp package that will be needed by rminer to load on the system, hope this helps.

R forecast function error

I am trying to use the forecast function (forecast package in R) and running into problem. Consider the following example:
library(forecast)
fit=arima(WWWusage,order=c(1,1,1))
fcast=forecast(fit)
plot(fcast)
At the forecast step, I am getting the error message:
Error in .forecast.transform(x, xv, a, h, 1) :
argument "xv" is missing, with no default
This happens even if I replace arima by Arima or auto.arima functions in the forecast package.
Thank you Andrie and Rob for your helpful suggestions. I have fixed the problem, but not sure how. I installed an update to RStudio and reinstalled the forecast library and it worked! Maybe something got messed up recently.
Also, I want to take this opportunity to thank you, Rob, for developing this extremely useful R package.

Resources