Forecast Input

Description

Adds given metric as an explanatory variable to forecast model

Usage

1
forecast_input(forecast,metric)

Arguments

forecast

Object of class forecast

metric

Object of class metric

Value

Object of class forecast

Author(s)

Kostin Andrey <andrey.kostin@portfolioeffect.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
dateStart = "2014-11-17 09:30:00"
dateEnd = "2014-11-17 16:00:00"
portfolio=portfolio_create(dateStart,dateEnd)
portfolio_settings(portfolio,portfolioMetricsMode="price",windowLength = '360s',
                   resultsSamplingInterval='60s')
positionAAPL=position_add(portfolio,'AAPL',100)
positionC=position_add(portfolio,'C',300) 
positionGOOG=position_add(portfolio,'GOOG',150) 

forecastVariance_1=forecast_builder(variance(positionAAPL),window="1d")
# plot(forecast_apply(forecastVariance),variance(positionAAPL),legend=c('Forecast','Simple'))

forecastVariance_2=forecast_builder(variance(positionAAPL),window="1d")
forecastVariance_2=forecast_input(forecastVariance_2,beta(positionAAPL))
plot(forecast_apply(forecastVariance_1),forecast_apply(forecastVariance_2),
     variance(positionAAPL),legend=c('Forecast,without input','Forecast,with input','Simple'))

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.