Learn R Programming

TextForecast (version 0.1.3)

text_forecast: Text Forecast function

Description

Text Forecast function

Usage

text_forecast(x, y, h, intercept)

Arguments

x

the input matrix x.

y

the response variable

h

the forecast horizon

intercept

TRUE for include intercept in the forecast equation.

Value

The h step ahead forecast

Examples

Run this code
# NOT RUN {
set.seed(1)
data("stock_data")
data("news_data")
y=as.matrix(stock_data[,2])
w=as.matrix(stock_data[,3])
data("news_data")
data("optimal_factors")
pc=optimal_factors
z=cbind(w,pc)
fcsts=text_forecast(z,y,1,TRUE)
# }

Run the code above in your browser using DataLab