hilo

Travis-CI Build Status Coverage Status CRAN_Status_Badge

knitr::opts_chunk$set(
  collapse = TRUE, comment = "#>", fig.path = "man/figure/"
)
options(scipen = 1, digits = 1)
set.seed(2017)

A simple class for ranges/intervals. Upon the S3 class range, one could define confidence/prediction intervals in a compact way, i.e. one column instead of three (including lower, upper and level). It provides the back-end for tbl_forecast in the tsibble package.

Installation

You could install the development version from Github using

# install.packages("devtools")
devtools::install_github("earowang/hilo")

How it works

library(hilo)
x <- rnorm(15)
y <- x + rnorm(15)
newdat <- data.frame(x = seq(-3, 3, length.out = 10))
pred <- as.data.frame(predict(lm(y ~ x), newdat, interval = "prediction"))
pred$PI <- bind_rng(lower = pred$lwr, upper = pred$upr, level = 95L)
pred


earowang/hilo documentation built on May 18, 2019, 8:07 p.m.