[Yuima-commits] r460 - in pkg/yuimaGUI: . inst/yuimaGUI

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jul 27 19:30:45 CEST 2016


Author: phoenix844
Date: 2016-07-27 19:30:44 +0200 (Wed, 27 Jul 2016)
New Revision: 460

Modified:
   pkg/yuimaGUI/DESCRIPTION
   pkg/yuimaGUI/inst/yuimaGUI/global.R
   pkg/yuimaGUI/inst/yuimaGUI/server.R
   pkg/yuimaGUI/inst/yuimaGUI/ui.R
Log:
Final update before conference

Modified: pkg/yuimaGUI/DESCRIPTION
===================================================================
--- pkg/yuimaGUI/DESCRIPTION	2016-07-21 22:52:22 UTC (rev 459)
+++ pkg/yuimaGUI/DESCRIPTION	2016-07-27 17:30:44 UTC (rev 460)
@@ -1,9 +1,9 @@
 Package: yuimaGUI
 Type: Package
 Title: A Graphical User Interface for the Yuima Package
-Version: 0.7.0
+Version: 0.7.1
 Author: YUIMA Project Team
 Maintainer: Emanuele Guidotti <emanuele.guidotti at studenti.unimi.it>
 Description: Provides a graphical user interface for the yuima package.
 License: GPL-2
-Depends: R(>= 3.0.0), shiny, DT, shinydashboard, shinyBS, yuima, quantmod, shinyjs, sde, corrplot
+Depends: R(>= 3.0.0), shiny, DT, shinydashboard, shinyBS, yuima, quantmod, shinyjs, sde

Modified: pkg/yuimaGUI/inst/yuimaGUI/global.R
===================================================================
--- pkg/yuimaGUI/inst/yuimaGUI/global.R	2016-07-21 22:52:22 UTC (rev 459)
+++ pkg/yuimaGUI/inst/yuimaGUI/global.R	2016-07-27 17:30:44 UTC (rev 460)
@@ -6,7 +6,7 @@
 require(shinyBS)
 require(yuima)
 require(shinyjs)
-require(corrplot)
+#require(corrplot)
 
 
 if(!exists("yuimaGUItable"))
@@ -228,12 +228,12 @@
   if (name == "Chan-Karolyi-Longstaff-Sanders (CKLS)" | name == "CKLS")
     return(list(lower=list("theta1"=lower, "theta2"=lower, "theta3"=0, "theta4"=ifelse(is.na(lower),NA,-3)),upper=list("theta1"=upper, "theta2"=upper, "theta3"=upper, "theta4"=ifelse(is.na(upper),NA,3))))
   if (name == "Hyperbolic (Barndorff-Nielsen)" | name == "hyp1")
-    return(list(lower=list("delta"=0, "alpha"=0, "beta"=0, "sigma"=lower, "mu"=lower),upper=list("delta"=upper, "alpha"=upper, "beta"=upper, "sigma"=upper, "mu"=upper)))
+    return(list(lower=list("delta"=0, "alpha"=0, "beta"=0, "sigma"=0, "mu"=lower),upper=list("delta"=upper, "alpha"=upper, "beta"=upper, "sigma"=upper, "mu"=upper)))
   if (name == "Hyperbolic (Bibby and Sorensen)" | name == "hyp2")
-    return(list(lower=list("delta"=0, "alpha"=0, "beta"=0, "sigma"=lower, "mu"=lower),upper=list("delta"=upper, "alpha"=upper, "beta"=upper, "sigma"=upper, "mu"=upper)))
+    return(list(lower=list("delta"=0, "alpha"=0, "beta"=0, "sigma"=0, "mu"=lower),upper=list("delta"=upper, "alpha"=upper, "beta"=upper, "sigma"=upper, "mu"=upper)))
   if (name == "Power Low Intensity"){
     boundsJump <- jumpBounds(jumps = jumps, lower = lower, upper = upper)
-    return(list(lower=c(list("alpha"=0, "beta"=0), boundsJump$lower),upper=c(list("alpha"=upper, "beta"=upper), boundsJump$upper)))
+    return(list(lower=c(list("alpha"=0, "beta"=ifelse(is.na(lower),NA,-3)), boundsJump$lower),upper=c(list("alpha"=upper, "beta"=ifelse(is.na(upper),NA,3)), boundsJump$upper)))
   }
   if (name == "Constant Intensity"){
     boundsJump <- jumpBounds(jumps = jumps, lower = lower, upper = upper)
@@ -245,11 +245,11 @@
   }
   if (name == "Exponentially Decaying Intensity"){
     boundsJump <- jumpBounds(jumps = jumps, lower = lower, upper = upper)
-    return(list(lower=c(list("alpha"=0, "beta"=0), boundsJump$lower),upper=c(list("alpha"=upper, "beta"=upper), boundsJump$upper)))
+    return(list(lower=c(list("alpha"=0, "beta"=0), boundsJump$lower),upper=c(list("alpha"=upper, "beta"=ifelse(is.na(upper),NA,3)), boundsJump$upper)))
   }
   if (name == "Periodic Intensity"){
     boundsJump <- jumpBounds(jumps = jumps, lower = lower, upper = upper)
-    return(list(lower=c(list("a"=0, "b"=0, "omega"=lower, "phi"=lower), boundsJump$lower),upper=c(list("a"=upper, "b"=upper, "omega"=upper, "phi"=upper), boundsJump$upper)))
+    return(list(lower=c(list("a"=0, "b"=0, "omega"=0, "phi"=0), boundsJump$lower),upper=c(list("a"=upper, "b"=upper, "omega"=upper, "phi"=2*pi), boundsJump$upper)))
   }
 }
 
@@ -374,7 +374,7 @@
 
 
 ###Function to convert unit of measure of the estimates
-changeBase <- function(param, StdErr, delta, original.data, paramName, modelName, newBase, session, choicesUI, anchorId, alertId){
+changeBase <- function(param, StdErr, delta, original.data, paramName, modelName, newBase, session, choicesUI, anchorId, alertId, allParam){
   if (newBase == "delta")
     return(list("Estimate"= param, "Std. Error"=StdErr))
   if(class(index(original.data))=="Date"){
@@ -424,6 +424,35 @@
     if(paramName == "theta3") return(list("Estimate"= param*sqrt(delta/dt1), "Std. Error"=StdErr*sqrt(delta/dt1)))
     if(paramName == "theta4") return(list("Estimate"= param, "Std. Error"=StdErr))
   }
+  if (modelName %in% c("Hyperbolic (Barndorff-Nielsen)", "Hyperbolic (Bibby and Sorensen)")){
+    if(paramName == "sigma") return(list("Estimate"= param*sqrt(delta/dt1), "Std. Error"=StdErr*sqrt(delta/dt1)))
+    if(paramName == "beta") return(list("Estimate"= param, "Std. Error"=StdErr))
+    if(paramName == "alpha") return(list("Estimate"= param, "Std. Error"=StdErr))
+    if(paramName == "mu") return(list("Estimate"= param, "Std. Error"=StdErr))
+    if(paramName == "delta") return(list("Estimate"= param, "Std. Error"=StdErr))
+  }
+  if (modelName %in% c("Constant Intensity")){
+    if(paramName == "lambda") return(list("Estimate"= param*delta/dt1, "Std. Error"=StdErr*delta/dt1))
+    if(paramName %in% c("mu_jump", "sigma_jump", "a_jump", "b_jump")) return(list("Estimate"= param, "Std. Error"=StdErr))
+  }
+  if (modelName %in% c("Linear Intensity")){
+    if(paramName == "alpha") return(list("Estimate"= param*delta/dt1, "Std. Error"=StdErr*delta/dt1))
+    if(paramName == "beta") return(list("Estimate"= param*(delta/dt1)^2, "Std. Error"=StdErr*(delta/dt1)^2))
+    if(paramName %in% c("mu_jump", "sigma_jump", "a_jump", "b_jump")) return(list("Estimate"= param, "Std. Error"=StdErr))
+  }
+  if (modelName %in% c("Power Low Intensity")){
+    beta <- as.numeric(allParam["beta"])
+    if(paramName == "alpha") return(list("Estimate"= param*(delta/dt1)^(beta+1), "Std. Error"=StdErr*(delta/dt1)^(beta+1)))
+    if(paramName %in% c("beta", "mu_jump", "sigma_jump", "a_jump", "b_jump")) return(list("Estimate"= param, "Std. Error"=StdErr))
+  }
+  if (modelName %in% c("Exponentially Decaying Intensity")){
+    if(paramName %in% c("alpha", "beta")) return(list("Estimate"= param*delta/dt1, "Std. Error"=StdErr*delta/dt1))
+    if(paramName %in% c("mu_jump", "sigma_jump", "a_jump", "b_jump")) return(list("Estimate"= param, "Std. Error"=StdErr))
+  }
+  if (modelName %in% c("Periodic Intensity")){
+    if(paramName %in% c("a", "b", "omega")) return(list("Estimate"= param*delta/dt1, "Std. Error"=StdErr*delta/dt1))
+    if(paramName %in% c("phi", "mu_jump", "sigma_jump", "a_jump", "b_jump")) return(list("Estimate"= param, "Std. Error"=StdErr))
+  }
   closeAlert(session, alertId)
   createAlert(session = session, anchorId = anchorId, alertId = alertId, content = paste("No parameters conversion available for this model. Parameters have been obtained using delta = ", delta), style = "warning")
   shinyjs::hide(choicesUI)
@@ -472,7 +501,7 @@
     QMLE <- try(qmle(model, start = start, fixed = fixed, method = method, lower = lower, upper = upper, #REMOVE# joint = joint, aggregation = aggregation,
                  threshold = threshold))
     if (class(QMLE)=="try-error"){
-      createAlert(session = session, anchorId = anchorId, content = paste("Unable to estimate", modName,"on", symbName), style = "danger")
+      createAlert(session = session, anchorId = anchorId, content = paste("Unable to estimate ", modName," on ", symbName, ". Try to use 'Advanced Settings' and customize estimation.", sep = ""), style = "danger")
       return()
     }
   }
@@ -487,7 +516,7 @@
       QMLE <- try(qmle(model, start = start, fixed = fixed, method = method, lower = lower, upper = upper, #REMOVE# joint = joint, aggregation = aggregation,
                    threshold = threshold))
       if (class(QMLE)=="try-error"){
-        createAlert(session = session, anchorId = anchorId, content = paste("Unable to estimate", modName,"on", symbName), style = "danger")
+        createAlert(session = session, anchorId = anchorId, content =  paste("Unable to estimate ", modName," on ", symbName, ". Try to use 'Advanced Settings' and customize estimation.", sep = ""), style = "danger")
         return()
       }
     #} else if (modName == "Brownian Motion" | modName == "Bm") {
@@ -546,7 +575,7 @@
             }
           }
           if (iter==tries & class(QMLEtemp)=="try-error" & !exists("QMLE")){
-            createAlert(session = session, anchorId = anchorId, content = paste("Unable to estimate", modName,"on", symbName), style = "danger")
+            createAlert(session = session, anchorId = anchorId, content =  paste("Unable to estimate ", modName," on ", symbName, ". Try to use 'Advanced Settings' and customize estimation.", sep = ""), style = "danger")
             return()
           }
         }

Modified: pkg/yuimaGUI/inst/yuimaGUI/server.R
===================================================================
--- pkg/yuimaGUI/inst/yuimaGUI/server.R	2016-07-21 22:52:22 UTC (rev 459)
+++ pkg/yuimaGUI/inst/yuimaGUI/server.R	2016-07-27 17:30:44 UTC (rev 460)
@@ -74,11 +74,11 @@
 
   ###Display chart of last clicked symbol
   observeEvent(input$database1_rows_selected, priority = -1, {
-    range_finDataPlot$x <- NULL
-    range_finDataPlot$y <- NULL
     symb <- tail(input$database1_rows_selected,1)
     shinyjs::show("finDataPlot")
     shinyjs::show("scale_finDataPlot")
+    valid_data <- NULL
+    range_finDataPlot$x <- c(NULL, NULL)
     output$finDataPlot <- renderPlot({
       if (length(yuimaGUItable$series)==0){
         shinyjs::hide("finDataPlot")
@@ -90,8 +90,10 @@
           shinyjs::hide("scale_finDataPlot")
         }
         else {
+          data <- window(getData(symb), start = range_finDataPlot$x[1], end = range_finDataPlot$x[2])
+          if(is.null(valid_data) | length(index(data))>3) valid_data <<- data
           par(bg="black")
-          plot.zoo(window(getData(symb), start = range_finDataPlot$x[1], end = range_finDataPlot$x[2]), main=symb, log=ifelse(input$scale_finDataPlot=="Linear","","y"), xlab="Index", ylab=NA, col="green", col.axis="grey", col.lab="grey", col.main="grey", fg="black")
+          plot.zoo(valid_data, main=symb, log=ifelse(input$scale_finDataPlot=="Linear","","y"), xlab="Index", ylab=NA, col="green", col.axis="grey", col.lab="grey", col.main="grey", fg="black")
           grid(col="grey")
         }
       }
@@ -387,9 +389,13 @@
   ###Interactive range of selectRange chart
   range_selectRange <- reactiveValues(x=NULL, y=NULL)
   observe({
-    if (!is.null(input$selectRange_brush)){
-      range_selectRange$x <- c(as.Date(input$selectRange_brush$xmin), as.Date(input$selectRange_brush$xmax))
-      range_selectRange$y <- c(input$selectRange_brush$ymin, input$selectRange_brush$ymax)
+    if (!is.null(input$selectRange_brush) & !is.null(input$plotsRangeSeries)){
+      data <- getData(input$plotsRangeSeries)
+      test <- (length(index(window(data, start = input$selectRange_brush$xmin, end = input$selectRange_brush$xmax))) > 3)
+      if (test==TRUE){
+        range_selectRange$x <- c(as.Date(input$selectRange_brush$xmin), as.Date(input$selectRange_brush$xmax))
+        range_selectRange$y <- c(input$selectRange_brush$ymin, input$selectRange_brush$ymax)
+      }
     }
   })
 
@@ -816,7 +822,7 @@
     if(length(start)==0) start[1,params[1]] <- NA
     if(length(startMin)==0) startMin[1,params[1]] <- NA
     if(length(startMax)==0) startMax[1,params[1]] <- NA
-    table <- rbind.fill(coef, fixed, start, startMin, startMax, lower, upper)
+    table <- rbind.fill(coef[,unique(colnames(coef))], fixed, start, startMin, startMax, lower, upper)
     rownames(table) <- c("Estimate", "Std. Error", "fixed", "start", "startMin", "startMax", "lower", "upper")
     return(table)
   })
@@ -840,7 +846,7 @@
       table <- t(summary(yuimaGUIdata$model[[symb]][[modN]]$qmle)@coef)
       outputTable <- data.frame()
       for (param in unique(colnames(table))){
-        temp <- changeBase(param = as.numeric(table["Estimate",param]), StdErr = as.numeric(table["Std. Error",param]), delta = yuimaGUIdata$model[[symb]][[modN]]$model at sampling@delta, original.data = yuimaGUIdata$model[[symb]][[modN]]$model at data@original.data, paramName = param, modelName = yuimaGUIdata$model[[symb]][[modN]]$info$modName, newBase = input$baseModels, session = session, choicesUI="baseModels", anchorId = "modelsAlert", alertId = "modelsAlert_conversion")
+        temp <- changeBase(param = as.numeric(table["Estimate",param]), StdErr = as.numeric(table["Std. Error",param]), delta = yuimaGUIdata$model[[symb]][[modN]]$model at sampling@delta, original.data = yuimaGUIdata$model[[symb]][[modN]]$model at data@original.data, paramName = param, modelName = yuimaGUIdata$model[[symb]][[modN]]$info$modName, newBase = input$baseModels, session = session, choicesUI="baseModels", anchorId = "modelsAlert", alertId = "modelsAlert_conversion", allParam = table["Estimate",])
         outputTable["Estimate",param] <- as.character(signifDigits(temp[["Estimate"]],temp[["Std. Error"]]))
         outputTable["Std. Error",param] <- as.character(signifDigits(temp[["Std. Error"]],temp[["Std. Error"]]))
       }
@@ -1334,7 +1340,9 @@
             }
             if(class(index(data))=="numeric" | class(index(data))=="integer"){
               info <- list(
+                "class" = yuimaGUIdata$model[[id[1]]][[as.numeric(id[2])]]$info$class,
                 "model" = yuimaGUIdata$model[[id[1]]][[as.numeric(id[2])]]$info$modName,
+                "jumps" = yuimaGUIdata$model[[id[1]]][[as.numeric(id[2])]]$info$jumps,
                 "estimate.from" = as.numeric(start(data)),
                 "estimate.to" = as.numeric(end(data)),
                 "simulate.from" = as.numeric(simulateSettings[[modID]][["t0"]]),
@@ -1799,29 +1807,45 @@
       })
   })
   
-
-  output$changepoint_plot_series <- renderPlot({
-    if(!is.null(input$changepoint_symb))
-      if ((input$changepoint_symb %in% rownames(yuimaGUItable$series))){
-        par(bg="black")
-        plot(getData(input$changepoint_symb), main=input$changepoint_symb, xlab="Index", ylab=NA, log=switch(input$changepoint_scale,"Linear"="","Logarithmic (Y)"="y", "Logarithmic (X)"="x", "Logarithmic (XY)"="xy"), col="green", col.axis="grey", col.lab="grey", col.main="grey", fg="black")
-        abline(v=yuimaGUIdata$cp[[input$changepoint_symb]]$tau, col = "yellow")
-        grid(col="grey")
+  range_changePoint <- reactiveValues(x=NULL, y=NULL)
+  observe({
+    if (!is.null(input$changePoint_brush) & !is.null(input$changepoint_symb)){
+      data <- getData(input$changepoint_symb)
+      test <- (length(index(window(data, start = input$changePoint_brush$xmin, end = input$changePoint_brush$xmax))) > 3)
+      if (test==TRUE){
+        range_changePoint$x <- c(as.Date(input$changePoint_brush$xmin), as.Date(input$changePoint_brush$xmax))
+        range_changePoint$y <- c(input$changePoint_brush$ymin, input$changePoint_brush$ymax)
       }
+    }
   })
   
-  output$changepoint_plot_incr <- renderPlot({
-    if(!is.null(input$changepoint_symb))
-      if ((input$changepoint_symb %in% rownames(yuimaGUItable$series))){
-        x <- Delt(getData(input$changepoint_symb))
-        x <- x[x[,1]!="Inf"]
-        par(bg="black")
-        plot(x, main=paste(input$changepoint_symb, " - Percentage Increments"), xlab="Index", ylab=NA, log=switch(input$changepoint_scale,"Linear"="","Logarithmic (Y)"="", "Logarithmic (X)"="x", "Logarithmic (XY)"="x"), col="green", col.axis="grey", col.lab="grey", col.main="grey", fg="black")
-        abline(v=yuimaGUIdata$cp[[input$changepoint_symb]]$tau, col = "yellow")
-        grid(col="grey")
-      }
+  observeEvent(input$changePoint_dbclick,{
+    range_changePoint$x <- c(NULL, NULL)
   })
   
+  observeEvent(input$changepoint_symb, {
+    range_changePoint$x <- c(NULL, NULL)
+    output$changepoint_plot_series <- renderPlot({
+      if(!is.null(input$changepoint_symb))
+        if ((input$changepoint_symb %in% rownames(yuimaGUItable$series))){
+          par(bg="black")
+          plot(window(getData(input$changepoint_symb), start = range_changePoint$x[1], end = range_changePoint$x[2]), main=input$changepoint_symb, xlab="Index", ylab=NA, log=switch(input$changepoint_scale,"Linear"="","Logarithmic (Y)"="y", "Logarithmic (X)"="x", "Logarithmic (XY)"="xy"), col="green", col.axis="grey", col.lab="grey", col.main="grey", fg="black")
+          abline(v=yuimaGUIdata$cp[[input$changepoint_symb]]$tau, col = "yellow")
+          grid(col="grey")
+        }
+    })
+    output$changepoint_plot_incr <- renderPlot({
+      if(!is.null(input$changepoint_symb))
+        if ((input$changepoint_symb %in% rownames(yuimaGUItable$series))){
+          x <- Delt(getData(input$changepoint_symb))
+          x <- x[x[,1]!="Inf"]
+          par(bg="black")
+          plot(window(x, start = range_changePoint$x[1], end = range_changePoint$x[2]), main=paste(input$changepoint_symb, " - Percentage Increments"), xlab="Index", ylab=NA, log=switch(input$changepoint_scale,"Linear"="","Logarithmic (Y)"="", "Logarithmic (X)"="x", "Logarithmic (XY)"="x"), col="green", col.axis="grey", col.lab="grey", col.main="grey", fg="black")
+          abline(v=yuimaGUIdata$cp[[input$changepoint_symb]]$tau, col = "yellow")
+          grid(col="grey")
+        }
+    })
+  })
   
   
   
@@ -1834,6 +1858,7 @@
   
   
   
+  
   ########################Lead Lag
   ########################
   ########################
@@ -2000,7 +2025,7 @@
           session = session,
           anchorId = "hedging_alert"
         )
-        updateTabsetPanel(session = session,  inputId = "panel_hedging", selected = "Hedging")
+        updateTabsetPanel(session = session,  inputId = "panel_hedging", selected = "Profit&Loss")
       }
       else createAlert(session, anchorId = "hedging_alert", alertId = "hedging_alert_selectRow" , content = "Please select a model to simulate the evolution of the underlying asset", style = "error")
     }

Modified: pkg/yuimaGUI/inst/yuimaGUI/ui.R
===================================================================
--- pkg/yuimaGUI/inst/yuimaGUI/ui.R	2016-07-21 22:52:22 UTC (rev 459)
+++ pkg/yuimaGUI/inst/yuimaGUI/ui.R	2016-07-27 17:30:44 UTC (rev 460)
@@ -1,5 +1,5 @@
 header<-dashboardHeader(
-  title = "yuima"
+  title = "yuimaGUI"
 )
 
 sidebar<-dashboardSidebar(
@@ -14,7 +14,7 @@
              menuSubItem("Clustering", tabName = "cluster")
              #REMOVE# menuSubItem("Lead-Lag Analysis", tabName = "llag")
              ),
-    menuItem("Modelling", tabName = "models_section", icon = icon("sliders"),
+    menuItem("Modeling", tabName = "models_section", icon = icon("sliders"),
              menuSubItem("Univariate", tabName = "models")
              ),
     menuItem("Simulate", tabName = "simulate_section", icon = icon("area-chart"),
@@ -22,7 +22,7 @@
              ),
     hr(),
     menuItem("Finance", tabName = "finance",
-             menuSubItem("Hedging", tabName = "hedging")
+             menuSubItem("P&L distribution", tabName = "hedging")
             )
   )
 )
@@ -33,13 +33,41 @@
   withMathJax(),
 
   tabItems(
-    tabItem(tabName = "home"
+    tabItem(tabName = "home",
+      fluidRow(
+        column(12,
+          h1("Welcome on yuimaGUI", style="color:#edeeed", align = "center"),
+          h4("an amazingly powerful tool for your analysis", style="color:#edeeed; font-family: Times New Roman, Georgia, Serif;", align = "center"), 
+          hr(class = "hrHeader"),
+          br(),
+          h4("Get acquainted with yuimaGUI and learn how to best exploit it in a few simple steps:", style="color:#edeeed", align = "center"),
+          h4("Step 1", style="color:#edeeed"),
+          h4("Load data you wish to analyze (section 'Data I/O').", br(), 
+             "An easy way to load economic data (i.e. GDP) or financial series (stocks and shares) directly from the Internet is provided. Otherwise you can load data from your own files.",br(),
+             "Once data are loaded, you can go and use sections 'Explorative Data Analysis' and 'Modeling'.", style="color:#CDCECD; font-family: Times New Roman, Georgia, Serif;"),
+          h4("Step 2", style="color:#edeeed"),
+          h4("Model your data in section 'Modeling'.", br(),
+             "Here you can fit models to your data choosing between some default options but also defining and using your own model.", br(),
+             "Now you are ready to use the estimated models for simulation purposes in section 'Simulate'.", style="color:#CDCECD; font-family: Times New Roman, Georgia, Serif;"),
+          h4("Step 3", style="color:#edeeed"),
+          h4("Read the short explanation at the beginning of every (sub)section.", style="color:#CDCECD; font-family: Times New Roman, Georgia, Serif;")
+        )
+      ),
+      fluidRow(
+        column(8),
+        column(4,
+          h3(em("Developed by"), style="color:#edeeed", align = "center"),
+          h4("Emanuele Guidotti", style="color:#CDCECD; font-family: Times New Roman, Georgia, Serif;", align = "center"),
+          h3(em("in collaboration with"), style="color:#edeeed", align = "center"),
+          h4("Stefano M. Iacus & Lorenzo Mercuri", style="color:#CDCECD; font-family: Times New Roman, Georgia, Serif;", align = "center")
+        )
+      )
     ),
     #########################
     tabItem(tabName="finData",
       fluidRow(
         column(12,
-          h3("In this section you can load financial and economic data.",style="color:#edeeed"),
+          h3("Here you can load financial and economic data.",style="color:#edeeed"),
           h4("For stock data choose Yahoo source using symbols you can find ",
              a("here", href="http://finance.yahoo.com/lookup", target = "_blank"), ".",
              br(),
@@ -50,7 +78,7 @@
              "Find symbols as shown in this ", a("example",href="example.jpg", target = "_blank"), ".",
              br(),
              "Multiple symbols are allowed if divided by empty space and/or commas (i.e. AAPL FB CSCO or AAPL,FB,CSCO).",
-             style="color:#CDCECD"),
+             style="color:#CDCECD; font-family: Times New Roman, Georgia, Serif;"),
           hr(class = "hrHeader")
         )
       ),
@@ -89,7 +117,7 @@
     tabItem("yourData",
       fluidRow(
         column(12,
-          h3("In this section you can load data from your own files.",style="color:#edeeed"),
+          h3("Here you can load data from your own files.",style="color:#edeeed"),
           h4("Please upload your file and specify its structure. A preview will be shown below.",
              br(),
              "First, declare if the file contains raw and/or column headers and specify what kind of field separator has to be used to read data.",
@@ -97,7 +125,7 @@
              "Each column will be uploaded as a different series. So you might want to switch columns with rows if your file is organized differently.",
              br(),
              "Finally specify what column to use to index series and its format.",
-              style="color:#CDCECD"),
+              style="color:#CDCECD; font-family: Times New Roman, Georgia, Serif;"),
           hr(class = "hrHeader")
         )
       ),
@@ -141,13 +169,15 @@
     tabItem(tabName="models", fluidRow(column(12,
       fluidRow(
         column(12,
-          h3("In this section you can estimate models and/or define new ones.",style="color:#edeeed"),
-          h4("To estimate models simply click those you are interested in and select data you wish to model. You can customize the estimation process by clicking on buttons 'Set Range' and 'Advanced Settings'.",
+          h3("Here you can estimate models and/or define new ones.",style="color:#edeeed"),
+          h4("To estimate models simply click those you are interested in and select data you wish to model.",
              br(),
+             " You can customize the estimation process by clicking on buttons 'Set Range' and 'Advanced Settings'.",
+             br(),
              "Some default models are available but you can set your own model (tab 'Set model') and use it for estimation and/or simulation purposes.",
              br(),
              "Estimated models are shown in tab 'Estimates'.",
-             style="color:#CDCECD"),
+             style="color:#CDCECD; font-family: Times New Roman, Georgia, Serif;"),
           hr(class = "hrHeader")
         )
       ),
@@ -328,7 +358,7 @@
     tabItem(tabName = "simulate",
       fluidRow(
         column(12,
-          h3("In this section you can perform simulations.",style="color:#edeeed"),
+          h3("Here you can perform simulations.",style="color:#edeeed"),
           h4("To simulate models that have been estimated on data simply select those you are interested in from table 'Available Models'.",
              br(),
              "If you want to simulate a model that has not been estimated you can specify its parameters values in tab 'Simuate equation' and select it.",
@@ -336,7 +366,7 @@
              "You can customize the simulation process by clicking on buttons 'Set Simulation' and 'Advanced Settings'.",
              br(),
              "Simulations are shown in tab 'Simulations'",
-             style="color:#CDCECD"),
+             style="color:#CDCECD; font-family: Times New Roman, Georgia, Serif;"),
           hr(class = "hrHeader")
         )
       ),
@@ -418,7 +448,7 @@
           bsTooltip("simulation_button_deleteModels", title = "Delete selected models", placement = "top"),
           column(4,actionButton("simulation_button_deleteAllModels",label = "Delete All", align = "center")),
           bsTooltip("simulation_button_deleteAllModels", title = "Delete all models that are displayed", placement = "top"),
-          column(4,actionButton("simulate_simulateModels", label = "Start Models Simulation", align = "center"))
+          column(4,actionButton("simulate_simulateModels", label = "Start Simulation", align = "center"))
         )
       ),
       bsModal(id="simulate_showSimulation", trigger = "simulate_monitor_button_showSimulation", title = div(h4(em("Simulation")), align="center"), size = "large",
@@ -491,11 +521,11 @@
     tabItem(tabName = "cluster",
       fluidRow(
         column(12,
-          h3("In this section you can perform clustering.",style="color:#edeeed"),
+          h3("Here you can perform clustering.",style="color:#edeeed"),
           h4("Select data you want to cluster from table 'Available Data'.", br(),
              "Then choose the distance you are interested in and the kind of linkage for the hierarchical cluster analysis.", br(),
              "Results will be shown below by plotting dendrogram and multidimensional scaling output.",
-                        style="color:#CDCECD"),
+                        style="color:#CDCECD; font-family: Times New Roman, Georgia, Serif;"),
           hr(class = "hrHeader")
         )
       ),
@@ -512,7 +542,7 @@
         column(4,br(),br(),
           div(align="center",
             selectInput("cluster_linkage", "Linkage", choices = c("Complete"="complete", "Single"="single", "Average"="average", "Ward"="ward.D", "Ward squared"="ward.D2", "McQuitty"="mcquitty", "Median"="median", "Centroid"="centroid")),
-            selectInput("cluster_distance", "Distance", choices = c("Markov Operator"="MOdist", "My distance"="MYdist", "Euclidean"="euclidean", "Maximum"="maximum", "Manhattan"="manhattan", "Canberra"="canberra", "Minkowski"="minkowski")),
+            selectInput("cluster_distance", "Distance", choices = c("Markov Operator"="MOdist", "Distribution of Returns"="MYdist", "Euclidean"="euclidean", "Maximum"="maximum", "Manhattan"="manhattan", "Canberra"="canberra", "Minkowski"="minkowski")),
             shinyjs::hidden(numericInput("cluster_distance_minkowskiPower", label = "Power", value = 2, width = "30%")))
         )
       )),
@@ -549,11 +579,11 @@
     tabItem(tabName = "changepoint",
       fluidRow(
         column(12,
-          h3("In this section you can estimate change points.",style="color:#edeeed"),
+          h3("Here you can estimate change points.",style="color:#edeeed"),
           h4("Select data for which you want to estimate change points from table 'Available Data'.", br(),
             "Then choose the algorithm you want to use for the estimation.", br(),
             "Results will be shown below by plotting series and detected change points.",
-            style="color:#CDCECD"),
+            style="color:#CDCECD; font-family: Times New Roman, Georgia, Serif;"),
           hr(class = "hrHeader")
         )
       ),
@@ -589,8 +619,8 @@
         hr(class = "hrHeader"),
         uiOutput("changepoint_symb", align="center"),
         selectInput("changepoint_scale", label = "Scale", choices=c("Linear","Logarithmic (Y)","Logarithmic (X)", "Logarithmic (XY)"), width = "150px"),
-        column(6,plotOutput("changepoint_plot_series")),
-        column(6,plotOutput("changepoint_plot_incr"))
+        column(6,plotOutput("changepoint_plot_series", brush = brushOpts(id = "changePoint_brush", delayType = "debounce", delay = 10000, resetOnNew = TRUE), dblclick = "changePoint_dbclick")),
+        column(6,plotOutput("changepoint_plot_incr", brush = brushOpts(id = "changePoint_brush", delayType = "debounce", delay = 10000, resetOnNew = TRUE), dblclick = "changePoint_dbclick"))
       ))))
     ),
     tabItem(tabName = "llag",
@@ -630,11 +660,11 @@
     tabItem(tabName = "hedging",
       fluidRow(
         column(12,
-          h3("In this section you can manage risk originated by buying options and the underlying asset.",style="color:#edeeed"),
-          h4("The evolution of the underlying asset is simulated by models you estimated in section Modelling.", br(),
-             "After performing the simulation click on rows of the table in tab Hedging, in order to choose the number of options and assets to buy/sell.",br(),
+          h3("Here you can manage risk deriving from buying options and the underlying asset.",style="color:#edeeed"),
+          h4("The evolution of the underlying asset is simulated by models you estimated in section Modeling.", br(),
+             "After performing the simulation click on rows of the table in tab 'Profit&Loss' in order to choose the number of options and assets to buy/sell.",br(),
              "The Profit&Loss distribution of your position will be displayed (it includes transaction costs that you can customize).",
-            style="color:#CDCECD"),
+            style="color:#CDCECD; font-family: Times New Roman, Georgia, Serif;"),
           hr(class = "hrHeader")
         )
       ),
@@ -672,7 +702,7 @@
             )
           )))
         ),
-        tabPanel(title = "Hedging",
+        tabPanel(title = "Profit&Loss",
           shinyjs::hidden(div(id="hedging_body",align="center",br(),
             fluidRow(
               column(3,numericInput("hedging_maxCapital", label = "Available Capital", value = 10000)),
@@ -691,7 +721,7 @@
                 textOutput("hedging_capital_text"),
                 textOutput("hedging_meanPerc_text"),
                 br(),br(),br(),
-                actionButton("hedging_button_commissionPlan", label = "Transaction Costs")
+                actionButton("hedging_button_commissionPlan", label = "Transaction Costs", width = "80%")
               )
             ),
             br(),
@@ -699,7 +729,7 @@
               column(3,selectInput("hedging_type2", label="Modify Option Type", c(" "="default", Call="call", Put="put"))),
               column(3,numericInput("hedging_strike2", label = "Modify Strike", min = 0, value = NA)),
               column(3,numericInput("hedging_optMarketPrice2", label = "Modify Option Price", min = 0, value = NA)),
-              column(3,br(),actionButton("hedging_button_saveHedging", "Save Changes"))
+              column(3,br(),actionButton("hedging_button_saveHedging", "Save Changes", width = "80%"))
             ),
             bsModal(id="hedging_commissionPlan", trigger = "hedging_button_commissionPlan", title = div(h4(em("Commission Plan")), align="center"), size = "small",
               div(align = "center",



More information about the Yuima-commits mailing list