Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to change the confidence level #199

Open
FelipeCarrillo opened this issue Mar 2, 2020 · 7 comments
Open

how to change the confidence level #199

FelipeCarrillo opened this issue Mar 2, 2020 · 7 comments

Comments

@FelipeCarrillo
Copy link

I am trying to change the confidence level but conf.int.value gets ignored. Is there a workaround?
No matter what level I put, it gets ignored.

library(forecast)
library(ggfortify)
d.arima <- auto.arima(AirPassengers)
autoplot(d.arima, predict=predict(d.arima,n.ahead=3),ts.colour = 'blue', predict.colour = 'blue',
predict.linetype = 'dashed', conf.int = TRUE,conf.int.value=0.99)

@terrytangyuan
Copy link
Collaborator

Thanks for filing the issue! Have you observed similar behavior for other arguments as well?

@MonicaFialho
Copy link

Hi

I'm having the same issue with the parameter conf.int.type.

autoplot(acf(AirPassengers, plot = FALSE), conf.int.type = 'ma')

returns the following warning message:
Ignoring unknown parameters: conf.int.type

@FelipeCarrillo
Copy link
Author

Any update on this question?

@terrytangyuan
Copy link
Collaborator

@MonicaFialho I am not able to reproduce your issue. autoplot(acf(AirPassengers, plot = FALSE), conf.int.type = 'ma') works as expected. Could you try again and share the version of ggfortify and related packages if this is still an issue?

@terrytangyuan
Copy link
Collaborator

@FelipeCarrillo Looks like the confidence interval cannot be specified as part of autoplot(). Instead, it should be specified in level argument as part of forecast::forecast(level=c(85)), for example:

d.arima <- forecast::auto.arima(AirPassengers)
# Use different (confidence) levels
autoplot(forecast::forecast(d.arima, level = c(85), h = 10))
autoplot(forecast::forecast(d.arima, level = c(99), h = 10))

You should be able to see different plots by modifying the confidence levels through level argument.

@MonicaFialho
Copy link

@terrytangyuan , I tried again, with ggfortify v0.4.10 and v0.4.11, and the result now is:

autoplot(acf(AirPassengers, plot = FALSE), conf.int.type = 'ma')
Warning message:
In confint.acf(model, ci = conf.int.value, ci.type = conf.int.type) :
can use ci.type="ma" only if first lag is 0

@terrytangyuan
Copy link
Collaborator

@MonicaFialho I guess the issue is that your model does not work with that particular confidence type then as it requires to have first lag that's equal to 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants