This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This gist demonstrate the use of a linear algorithm to compute exponentially weighted rolling linear regression between two time-series. | |
# benchmark rolling linear model using R's lm function | |
# output 2 regression coefficients + R2, ie 3 value per row | |
# alpha: decay coefficient (last weight = (1 - alpha) * previous weight) | |
# miny: minimum number of sample required to calculate an output value | |
rlm <- function(y, x, alpha, miny=10) { | |
n <- length(y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
testModuleInput <- function (id) { | |
ns <- NS(id) | |
uiOutput(ns("inputUI")) | |
} | |
testModule <- function (input, output, session, label) { | |
ns <- session$ns | |
value <- reactiveValues(value="") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
appUI <- pageWithSidebar( | |
# Application title | |
headerPanel("New Application"), | |
sidebarPanel( | |
"Progress: ", | |
textOutput("counter"), |