我想学习 ARMA 预测,我正在尝试使用从比特币下载的比特币数据集进行预测
我正在努力使用以下代码。图书馆(Quandl)
library(forecast)
library(tseries)
library(shiny)
ui <- shinyUI(fluidPage(
titlePanel("Simple ARMA Bitcoin Forecasting"),
sidebarLayout(
sidebarPanel("Please choose the number of periods",
numericInput("num",h3("Numeric input"), value = 1)),
mainPanel(plotOutput("plot")))
)
)
server <- shinyServer(function(input,output) {
output$plot <- plotOutput({
bitcoin <- Quandl("BITSTAMP/USD",type = "xts")
bitcoin_price <- bitcoin[,3]
barplottest <- diff(log(bitcoin_price))
fit <- auto.arima(dataInput)
fit %>% forecast(h="input$num") %>% autoplot()
})
})
shinyApp(ui,server)
这是我收到的错误:
Warning: Error in as.ts: object 'dataInput' not found
Stack trace (innermost first):
44: as.ts
43: auto.arima
42: imageOutput [#11]
41: plotOutput
40: server [#3]
4: <Anonymous>
3: do.call
2: print.shiny.appobj
1: <Promise>
Error in as.ts(x) : object 'dataInput' not found