Type: | Package |
Title: | A Button-Based GUI for Financial and Economic Data Analysis |
Version: | 1.6 |
Date: | 2025-08-21 |
Author: | Ho Tsung-wu [aut, cre] |
Maintainer: | Ho Tsung-wu <tsungwu@ntnu.edu.tw> |
Description: | A GUI designed to support the analysis of financial-economic time series data. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
LazyData: | TRUE |
LazyLoad: | yes |
Depends: | R (≥ 2.10),fPortfolio,tcltk, lattice |
Imports: | boot, car, coefplot, fBasics, forecast, grid, JFE, FRAPO, lmtest, lubridate, methods, openair, papeR, quantmod, rugarch, sandwich, timeDate, timeSeries, xts, zoo |
NeedsCompilation: | no |
Packaged: | 2025-08-21 09:30:53 UTC; badal |
Repository: | CRAN |
Date/Publication: | 2025-08-21 23:40:02 UTC |
A Button-based GUI for Financial and Economic Data Analysis
Description
A Output GUI designed to simplfy the use of R packages and functions by clicking.
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
Maintainer: Ho Tsung-wu <tsungwu@ntnu.edu.tw>
Display the JFE User Interface
Description
Start the JFE GUI (graphical user interface)
Usage
JFE()
Details
After loading the package, in the command prompt, type JFE() to start it. JFE is a menu-driven GUI designed to support the analysis of financial time series data with the aid of several R packages. The version 1.1 focuses on: Firstly, price visualization, including technical charting(by package quantmod); secondly, assets selection based on Performance index(by package PerformanceAnalytics); thirdly, portfolio optimization (by package "fPORTFOLIO"
).
This command is an internal function to start the JFE GUI. To avoid unexpected problems of time series object, the imported data must be time series object (xts, or timeSeries) loaded by either .RData or .rda, file of .csv or other format is not supported; that is to say, users have only to know how to construct a R time-series object.
If execution of All-in-one from backtesting fails, then it is a problem associated with undocumented functions. Please re-install this package from Github via devtools::install_github("tsungwu/JFE"), detailed are also explained in Github and <"http://web.ntnu.edu.tw/~tsungwu/R_DevOps/R_DevOps.htm">.
Value
Generate a menu-driven GUI
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University.
Examples
JFE()
VIF test for mullticolinearity
Description
This function tests for mullticolinearity.
Usage
VIF_no(obj)
Arguments
obj |
A lm object |
Details
This function is an internal function of iClick GUI, which is executed on iClick.lm GUI.
Value
Test statistic
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
Box-Whisker plot.
Description
This function generates plot by iClick.VisOneReturns.
Usage
boxPlotX(X, col = "indianred2", title = TRUE)
Arguments
X |
A timeSeries object, single time series returns. |
col |
String for color. |
title |
Whether to generate title of graph. |
Details
This function is an internal function of iClick GUI, which is executed on iClick.VisOneReturns GUI.
Value
Plot a graph
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
See Also
Functions in fBasics.
Calendar Heapmap Plot
Description
This function generates calendar heatmap plot up to six year, due to visibility.
Usage
calendar.heat(data, ncolors = 99, color = "r2b", date.form = "%Y-%m-%d", main = NULL)
Arguments
data |
Daily data of price or others. |
ncolors |
Number of color for heatmap. |
color |
Color plate selected, selection includes c("r2b","r2g","w2b"). |
date.form |
Default date form. |
main |
main label of graph. |
Details
This function is within the iClick GUI, is executed within iClick.VisAssetPrice().
Value
Plot
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
Cumulative returns plot.
Description
This function generates plot by iClick.VisOneReturns().
Usage
cumulatedPlotX(x, index = 100, labels = TRUE, type = "l",
col = "indianred2", ylab = "Values", title = TRUE,
grid = TRUE, box = TRUE, rug = TRUE)
Arguments
x |
A timeSeries object, single time series returns. |
index |
Returns index. |
labels |
Whether to generate label for the graph. |
type |
Type of graph. |
col |
Options for color. |
ylab |
String label for Y axis. |
title |
Whether to generate title for the graph. |
grid |
Whether to use grid in plot. |
box |
Whether to put the plot into a box. |
rug |
Whether to add rug. |
Details
This function is an internal function of iClick GUI, which is executed on iClick.VisOneReturns GUI.
Value
Plot
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
Cut and Stack Plotting Function
Description
This function calls cut() to cut tiimeseries into several equal periods and plots over time.
Usage
cutAndStack(x, number, overlap = 0.1, type = c("l","g"), xlab = "Time",
ylab = deparse(substitute(x)))
Arguments
x |
A timeSeries object, single time series price. |
number |
Number of equal cut. |
overlap |
Percentage of overlapping across cuts. |
type |
Type of line. |
xlab |
Label of X axis. |
ylab |
Label of Y axis. |
Details
This function is within the iClick GUI, is executed within iClick.VisAssetprice().
Value
Plot
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
Data Sets
Description
assetReturns contains DJ component stocks returns data. world20 contains index returns of 20 countries.
Usage
data(assetReturns)
data(world20)
Value
assetReturns is a time series object of package xts
.
world20 is index returns time series data.
Drawup Returns Plots
Description
This function is within the iClick GUI, is executed within iClick.VisOneReturns(dat), the data frame dat has two columns, the first column is date index and the second one is numeric time series data.
Usage
drawdownPlotX(x, labels = TRUE, type = "l", col = "darkgreen",
title = TRUE, ylab = "Down returns", grid = TRUE, box = TRUE,
rug = TRUE)
Arguments
x |
A timeSeries object, single time series returns. |
labels |
Whether to generate label for the graph. |
type |
Type of line. |
col |
Options for color. |
title |
Whether to generate title for the graph. |
ylab |
String for Y axis. |
grid |
Whether to use grid in plot. |
box |
Whether to put the plot into a box. |
rug |
Whether to add rug. |
Details
This function is an internal function of iClick GUI, which is executed on iClick.VisOneReturns GUI.
Value
Plot
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
See Also
Functions in fBasics.
Drawup Returns Plots
Description
This function is within the iClick GUI, is executed within iClick.VisOneReturns(dat), the data frame dat has two columns, the first column is date index and the second one is numeric time series data.
Usage
drawupPlotX(x, labels = TRUE, type = "l", col = "indianred2",
title = TRUE, ylab = "Up Returns", grid = TRUE, box = TRUE,
rug = TRUE)
Arguments
x |
A timeSeries object, single time series returns. |
labels |
Whether to generate label for the graph. |
type |
Type of line. |
col |
Options for color. |
title |
Whether to generate title for the graph. |
ylab |
String for Y axis. |
grid |
Whether to use grid in plot. |
box |
Whether to put the plot into a box. |
rug |
Whether to add rug. |
Details
This function is an internal function of iClick GUI, which is executed on iClick.VisOneReturns GUI.
Value
Plot
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
See Also
Functions in fBasic and fAssets.
Calculate Drawup Returns for Drawup Plot
Description
This function calculates drawup returns for plotting.
Usage
drawups(x)
Arguments
x |
A timeSeries object, single time series returns. |
Details
This function is an internal function for drawplot of iClick GUI, which is executed on iClick.VisOneReturns GUI.
Value
Returns of draw up periods.
Author(s)
Ho Tsung-wu <tsungwu@mail.shu.edu.tw>
Download Download 5-second index price from the Taiwan Stock Exchange
Description
It downloads Download 5-second financial index from the Taiwan Stock Exchange.
Usage
getTWSE.fiveSecond(ymd=NULL,skip=2,index.names=NULL)
Arguments
ymd |
The year-month-day format of data retrived, for example, "2022-05-03". If unspecified, the default is the Sys.date(); if Saturday, it moves back to Friday; if Sunday, it moves to Monday. |
skip |
The rows to skip, since the web usually contains empty space or notes in the beginning, currently, skip 2 lines is OK, however, it skipped 1. Therefore, the parameter can be checked if it changes again. |
index.names |
The colnames (names of index price) of the dataset are originally in Chinese characters, to avoid language problem, we changed it to V1~V34. Users may offer your own colnames here. |
Details
This function connects with <"https://www.twse.com.tw/exchangeReport/MI_5MINS_INDEX"> and downloads the specified market data. The rownames of downloaded data embeds the timestamp already.
Value
data |
The data retrieved. |
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University.
Examples
#getTWSE.fiveSecond(ymd="2022-05-03",skip=2,index.names=NULL)$data
iClick GUI for ARIMA
Description
This GUI estimates ARIMA both with automatic lag selection and fixed lag length. The GUI is only only a GUI, but also a output format.
Usage
iClick.ARIMA(dat, AR = 1, MA = 1, n.ahead = 24, ic = "aic")
Arguments
dat |
Time series object, xts. |
AR |
Pre-specified fixed AR order. |
MA |
Pre-specified fixed MA order. |
n.ahead |
Periods of out-of-sample forecast. |
ic |
Information criteria for lag selection,ic=c("aicc", "aic", "bic"). See auto.arima() of package forecast. |
Details
This GUI fits two ARMA, fixed orders and automatically fitted orders, and returns a two-part GUI with output on it. The outputs can be saved as .RData file for later use, the last row is the save button.
The saved filename is automatically generated by selections and results; for example, .aicOrderARIMA_102.RData represents the automatically fits ARIMA(p,d,q) orders are ARIMA(1,0,2) by AIC.
Using load(".aicOrderARIMA_102.RData") to retrieve the file and ls() to list objects, and use names() to show details of objects.
The input returns data must be in percentage form; namely, dlog()*100
Value
Fitted ARMA regression output.
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
See Also
arima() and auto.arima() of package forecast.
Examples
## Simulation data
dat=rnorm(200)
y=ts(dat, end = c(2025, 8), frequency = 12)
iClick.ARIMA(y)
iClick Output GUI for Univariate GARCH Models
Description
This GUI makes GARCH estimation of comparison easy. With a pre-selected GARCH type, it automatically fits eight probability distributions and conducts all diagnostic tests with a Click.
Usage
iClick.GARCH(dat, meanEQ = meanEQ, garchEQ = garchEQ, n.ahead = 15)
Arguments
dat |
Time series object, xts. |
meanEQ |
Specification of mean equation. |
garchEQ |
Specification of variance equation. |
n.ahead |
Number of out-of-sample forecasting period. |
Details
This GUI fits 8 distributions for univariate GARCH with pre-selected GARCH types, and returns a 54-button GUI output. The outputs can be individually saved as .RData file for later use, the last row is the save button.The saved filename is automatically generated once clicked, in addition, corresponding .csv files will be generated also.
The 54-button GUI is divided into 9 panes, and the last pane collects coefficient outputs and diagnostic tests together, which aims to make estimation comparison easy.
Value
Fitted GARCH regression output.
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
See Also
library(rugarch)
Examples
##==External data
data("world20")
y=na.omit(diff(log(world20[,1])))
##== Simulation data
#dat=rnorm(200,5,1)
#y=ts(dat, start = c(1970, 1), frequency = 12)
meanEQ=list(AR=1,MA=0,Exo=NULL, autoFitArma=FALSE,arfimaDiff=FALSE,archM=FALSE)
# If there are external regressors X, put them as Exo=X
# autoFitArma=TRUE, If you want to fit arma automatically.
# arfimaDiff=TRUE,to take ARFIMA difference
# archM=TRUE, to estimate GARCH-in-mean
garchEQ=list(Type="sGARCH",P=1,Q=1, exo=NULL)
# Type: "sGARCH","eGARCH","gjrGARCH","iGARCH","apGARCH"
# please check rugarch for details.
# P is the ARCH order
# Q is the GARCH order
#iClick.GARCH(y,meanEQ, garchEQ, n.ahead=15)
# This computation takes more than 6 seconds, hence I added a # to block it.
Visualize Daily Asset Price
Description
This GUI conducts plots of daily asset price, including calendar heatmap and many plots which are not easy to use for new users.
Usage
iClick.VisAssetPrice(dat, color4 = "r2b", color5 = "jet")
Arguments
dat |
Time series object,xts. |
color4 |
Color choice for annual calendar heatmap, the default is "r2b". |
color5 |
Color choice for 6-year calendar heatmap, the default is "jet". |
Details
This GUI is designed for financial time series, maily daily stock price. Other time series data works also, as long as it has a date column. We call function calendarPlot() from package "openair", and modified the function calendarHeat() to fit daily price, which is limited to 11 years.
Value
Output GUI
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
Examples
#data("IBM")
#assetPrice=IBM[,1]
#iClick.VisAssetPrice(assetPrice)
Visualize Asset Returns
Description
This GUI conducts plots of daily asset returns, including ACF, PACF, drawdowns, and Talyor effects.
Usage
iClick.VisOneReturns(dat)
Arguments
dat |
Time series object,xts. |
Details
This GUI is designed for financial time series, maily daily stock returns. Other time series data works also, as long as it has a date column.
Value
Output GUI
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
Examples
data("world20")
y=na.omit(diff(log(world20[,1])))
## Simulation data
#dat=rnorm(200,5,1)
#y=ts(dat, start = c(1970, 1), frequency = 12)
iClick.VisOneReturns(y)
iClick GUI for linear model
Description
This GUI estimates ARIMA both with automatic lag selection and fixed lag length. The GUI is only only a GUI, but also a output format.
Usage
iClick.lm(dep,indep,data,Formula=NULL,bootrep=99)
Arguments
data |
A R data object for lm() |
dep |
scalar, the number of column as dependent variable |
indep |
scalar, the numbers of column as independent variables |
Formula |
A formula for lm, default is NULL, if specified, dep and indep should leave empty. See example below |
bootrep |
Bootstrap replications, default is 99 |
Details
This GUI fits equaiton into lm regression.
Value
Fitted lm regression output.
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
See Also
lm()
Examples
data("FFplusMOM")
iClick.lm(dep=2,indep=c(3,5:6),data=FFplusMOM, bootrep=9)
#Eq=RET~(MK_BETA+HML_BETA+SMB_BETA)^2
#iClick.lm(Formula=Eq,data=FFplusMOM, bootrep=9)
QQ Plot
Description
This function is within the iClick GUI, is executed within iClick.VisOneReturns(dat), the data frame dat has two columns, the first column is date index and the second one is numeric time series data.
Usage
qqnormPlotX(X, labels = TRUE, col = "indianred2", pch = 19,
title = TRUE, mtext = TRUE, grid = FALSE, rug = TRUE,
scale = TRUE)
Arguments
X |
A timeSeries object, single time series returns. |
labels |
Whether to generate label for the graph. |
col |
String for color. |
pch |
Line options. |
title |
Whether to generate title for the graph. |
mtext |
Whether to generate main text for the graph. |
grid |
Whether to use grid in plot. |
rug |
Whether to add rug. |
scale |
Whether to scale the data. |
Details
This function is an internal function of iClick GUI, which is executed on iClick.VisOneReturns GUI.
Value
Plot
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
See Also
Functions in fBasics.
Compute risk optimal portfolios maxDD, aveDD and CDaR
Description
It calls FRAPO
to compute risk optimal portfolio satisfying the constraint of draw downs and returns a S4 object of class fPORTFOLIO
.
Usage
riskOptimalPortfolio(data, Type="AveDD",value)
Arguments
data |
timeSeries object of price data. Please remember the asset data must be price, not returns. |
Type |
Drawdown types, we call package FRAPO to support three methods:"maxDD","aveDD",and "CDaR". For details, please see document of package FRAPO. |
value |
Positive numerical number for Type. |
Details
The risk optimal portfolio calls FRAPO
and wrapp the results as a S4 object of class fPORTFOLIO
, all get functions of fPORTFOLIO
are applicable.
Value
returns an S4 object of class "fPORTFOLIO"
.
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University.
References
Roncalli Thierry, Introduction to Risk parity and Budgeting, 2014, CRC inc..
See also packages fPORTFOLIO
and FRAPO
Examples
# Risk optimal portfolio takes time, example below is commented.
data(LPP2005,package="fPortfolio")
Data = LPP2005[,1:6]#select 6 assets price
Data.RET=timeSeries::returns(Data) # Transform into returns to compute VALUE below
#VALUE=abs(mean(drawdowns(apply(Data.RET,1,mean))))
#output=riskOptimalPortfolio(Data,Type="AveDD",value=VALUE) # data input must be price.
#show(output)
#getWeights(output)
#getCovRiskBudgets(output)
Compute risk parity portfolio
Description
It calls FRAPO
to compute portfolio weights with equal risk contribution, or equal covariance risk budget, then returns a S4 object of class fPORTFOLIO
.
Usage
riskParityPortfolio(data, covmat="cov", strategy="minrisk",Type="MV")
Arguments
data |
timeSeries object of returns data |
covmat |
Function to compute mltvariate covariance matrix, we support five methods:"cov","ledoitWolf","shrink","shrinkCC","slpm". The default is sample covariance "cov". |
strategy |
strategyPortfolio as in package fPortfolio, we support 5 cases in fPortfolio package: "GMVP","maxreturn","minrisk", "tangency" and "All Assets". The default is "minrisk". |
Type |
portfolio type as in package fPortfolio, the default is "MV". |
Details
The risk parity portfolio has two options: the first is to select a subset of assets and compute risk parity weights. To this end, we implement one of four portfolio strategies: "GMVP","maxreturn","minrisk", "tangency". The idea is that each portfolio strategy will pick the desirable assets by assigning weights, the assets with non-zero weights are selected ones; afterwards, we compute risk parity weights of these assets. Secondly, for "All Assets", all assets are included and compute an optimal weight vector satisfying risk parity condition,namely, equal risk contribution or covariance risk budget.
GMVP or Global minimum risk Portfolio:
The function minvariancePortfolio
returns the portfolio
with the minimal risk on the efficient frontier. To find the
minimal risk point the target risk returned by the function
efficientPortfolio
is minimized.
tangency or maximal returns/risk ratio Portfolio:
The function tangencyPortfolio
returns the portfolio with
the highest return/risk ratio on the efficient frontier. For the
Markowitz portfolio this is the same as the Sharpe ratio. To find
this point on the frontier the return/risk ratio calculated from
the target return and target risk returned by the function .
minrisk or Minumum Risk:
The function minriskPortfolio
is an efficient portfolio which lies on the efficient
frontier. The efficientPortfolio
function returns the properties of
the efficient portfolio as an S4 object of class fPORTFOLIO
maxreturn or Maximum Return Portfolio:
The function maxreturnPortfolio
returns the portfolio
with the maximal return for a fixed target risk.
Risk parity portfolio calls FRAPO
, which requires symmetric covariance matrices, so far we support only five covariance methods.
Value
returns an S4 object of class "fPORTFOLIO"
.
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University.
References
Roncalli Thierry, Introduction to Risk parity and Budgeting, 2014, CRC inc..
See also packages fPORTFOLIO
and FRAPO
Examples
data(assetReturns)
assetReturns=assetReturns[,11:15]
output=riskParityPortfolio(assetReturns, covmat="cov", strategy="minrisk")
show(output)
getWeights(output)
getCovRiskBudgets(output)
Plot Time Series Data
Description
This function is within the iClick GUI, is executed within iClick.VisOneReturns(dat), the data frame dat has two columns, the first column is date index and the second one is numeric time series data.
Usage
seriesPlotX(x,labels=TRUE,type="l",col="indianred2",
ylab="Value", title=TRUE, grid=TRUE, box=TRUE, rug=TRUE)
Arguments
x |
A timeSeries object, single time series returns. |
labels |
Whether to generate label for the graph. |
type |
Type of graph. |
col |
Options for color. |
ylab |
String label for Y axis. |
title |
Whether to generate title for the graph. |
grid |
Whether to generate grid for the graph. |
box |
Whether to put the plot into a box. |
rug |
Whether to add rug. |
Details
This function is an internal function of iClick GUI, which is executed on iClick.VisOneReturns GUI.
Value
Plot
Author(s)
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University
See Also
fBasics