R/setup.R

Defines functions uws

#' @export
uws <- function(){
  appDir <- system.file('shiny-examples', 'uws_app', package = 'uws')
  if (appDir == '') {
    stop("Could not find app directory. Try re-installing package 'uws'",
         call. = FALSE)
  }

  shiny::runApp(appDir, display.mode = 'normal')
}



# # --- Lee carter Models
# load('data/dx.rda')
# load('data/dy.rda')
# dx <- as.matrix(dx)
# dy <- as.matrix(dy)
# load('data/ex.rda')
# load('data/ey.rda')
# ex <- as.matrix(ex)
# ey <- as.matrix(ey)
#
# rownames(dx) <- dx[, 1]
# dx <- dx[, -1]
# rownames(dy) <- dy[, 1]
# dy <- dy[, -1]
#
# rownames(ex) <- ex[, 1]
# ex <- ex[, -1]
# rownames(ey) <- ey[, 1]
# ey <- ey[, -1]
#
# ages <- 60:104
# years <- 1960:2016
#
# dx <- t(dx[as.character(ages), as.character(years)])
# dy <- t(dy[as.character(ages), as.character(years)])
# ex <- t(ex[as.character(ages), as.character(years)])
# ey <- t(ey[as.character(ages), as.character(years)])
#
#
#
# lc_x <- fit701(ages,years,ex,dx, 1)
# lc_y <- fit701(ages,years,ey,dy, 1)
# devtools::use_data(lc_x, overwrite= T)
# devtools::use_data(lc_y, overwrite = T)
#


# # --- Zinskurve
# # Quelle: https://data.snb.ch/de/topics/ziredev#!/chart/rendstrukch
# i_10_future <- c(-0.6236386195,
# -0.6718767877,
# -0.6776969241,
# -0.6183084285,
# -0.5196957907,
# -0.4073273617,
# -0.2969496234,
# -0.1961378645,
# -0.1074387639,
# -0.0307936798,
# 0.0349856077,
# 0.0914305831,
# 0.1400447307,
# 0.1821561006,
# 0.2188798688,
# 0.2511291976,
# 0.2796434099,
# 0.3050191626,
# 0.3277387842,
# 0.3481939744)
# names(i_10_future) <- 2017 + 1:20
# devtools::use_data(i_10_future, overwrite=T)
#
#
# # 10 year yields from www.investing.com
# i_10 <- rev(setNames(c(
# -0.005,
# 0.036,
# -0.577,
# -0.036,
# 0.552,
# 1.035,
# 0.462,
# 1.413,
# 1.481,
# 2.013,
# 3.056,
# 3.144,
# 2.701,
# 1.951,
# 2.808,
# 2.52,
# 3.065,
# 3.315,
# 3.972,
# 2.902,
# 3.06,
# 3.433,
# 4.368,
# 4.704,
# 5.181), 2018:1994))
# devtools::use_data(i_10, overwrite=T)
#
# # Mindestzinssatz (BVV2)
# # https://www.admin.ch/opc/de/classified-compilation/19840067/201710010000/831.441.1.pdf
# i_min <- setNames(c(rep(2.5, 3), 2.75, 2, 2, 2, 1.5, 1.5, 1.75, 1.75, 1.25, 1), 2005:2017)
# devtools::use_data(i_min, overwrite=T)
o1i/UWS documentation built on Sept. 16, 2019, 6:25 p.m.