Title: | A Button-Based GUI for Financial and Economic Data Analysis |
---|---|
Description: | A GUI designed to support the analysis of financial-economic time series data. |
Authors: | Ho Tsung-wu |
Maintainer: | Ho Tsung-wu <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.5 |
Built: | 2024-12-02 06:57:53 UTC |
Source: | CRAN |
A Output GUI designed to simplfy the use of R packages and functions by clicking.
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
Maintainer: Ho Tsung-wu <[email protected]>
This function generates plot by iClick.VisOneReturns.
boxPlotX(X, col = "indianred2", title = TRUE)
boxPlotX(X, col = "indianred2", title = TRUE)
X |
A timeSeries object, single time series returns. |
col |
String for color. |
title |
Whether to generate title of graph. |
This function is an internal function of iClick GUI, which is executed on iClick.VisOneReturns GUI.
Plot a graph
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
Functions in fBasics.
This function generates calendar heatmap plot up to six year, due to visibility.
calendarHeat(values, ncolors = 99, color = "r2b", date.form = "%Y-%m-%d")
calendarHeat(values, ncolors = 99, color = "r2b", date.form = "%Y-%m-%d")
values |
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. |
This function is within the iClick GUI, is executed within iClick.VisAssetPrice().
Plot
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
This function generates plot by iClick.VisOneReturns().
cumulatedPlotX(x, index = 100, labels = TRUE, type = "l", col = "indianred2", ylab = "Values", title = TRUE, grid = TRUE, box = TRUE, rug = TRUE)
cumulatedPlotX(x, index = 100, labels = TRUE, type = "l", col = "indianred2", ylab = "Values", title = TRUE, grid = TRUE, box = TRUE, rug = TRUE)
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. |
This function is an internal function of iClick GUI, which is executed on iClick.VisOneReturns GUI.
Plot
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
This function calls cut() to cut tiimeseries into several equal periods and plots over time.
cutAndStack(x, number, overlap = 0.1, type = "l", xlab = "Time", ylab = deparse(substitute(x)))
cutAndStack(x, number, overlap = 0.1, type = "l", xlab = "Time", ylab = deparse(substitute(x)))
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. |
This function is within the iClick GUI, is executed within iClick.VisAssetprice().
Plot
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
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.
drawdownPlotX(x, labels = TRUE, type = "l", col = "darkgreen", title = TRUE, ylab = "Down returns", grid = TRUE, box = TRUE, rug = TRUE)
drawdownPlotX(x, labels = TRUE, type = "l", col = "darkgreen", title = TRUE, ylab = "Down returns", grid = TRUE, box = TRUE, rug = TRUE)
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. |
This function is an internal function of iClick GUI, which is executed on iClick.VisOneReturns GUI.
Plot
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
Functions in fBasics.
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.
drawupPlotX(x, labels = TRUE, type = "l", col = "indianred2", title = TRUE, ylab = "Up Returns", grid = TRUE, box = TRUE, rug = TRUE)
drawupPlotX(x, labels = TRUE, type = "l", col = "indianred2", title = TRUE, ylab = "Up Returns", grid = TRUE, box = TRUE, rug = TRUE)
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. |
This function is an internal function of iClick GUI, which is executed on iClick.VisOneReturns GUI.
Plot
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
Functions in fBasic and fAssets.
This function calculates drawup returns for plotting.
drawups(x)
drawups(x)
x |
A timeSeries object, single time series returns. |
This function is an internal function for drawplot of iClick GUI, which is executed on iClick.VisOneReturns GUI.
Returns of draw up periods.
Ho Tsung-wu <[email protected]>
Average data of 811 listed companies of SSEC, 2001/1/03~2012
data("FFplusMOM")
data("FFplusMOM")
A data frame with 811 observations on the following 4 variables.
company
company code
RET
company-specific average returns
MK_BETA
CAPM factor beta
HML_BETA
High-Minus-Low factor beta
SMB_BETA
Small-Minus-Big factor beta
MOM_BETA
Momemtum factor beta
Daily stock returns of 24 world national markets.
Yahoo finance.
data(FFplusMOM)
data(FFplusMOM)
Daily price data of IBM, 2007/4/24~2017/4/21
data("IBM")
data("IBM")
A xts object with 2518 observations on the following 5 variables.
Open
A numeric vector, open price
High
A numeric vector, maximum price
Low
A numeric vector, minimum price
Close
A numeric vector, close price
Volume
A numeric vector, trading volume
Daily stock price data of IBM.
Yahoo finance.
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.
iClick.ARIMA(dat, AR = 1, MA = 1, n.ahead = 24, ic = "aic")
iClick.ARIMA(dat, AR = 1, MA = 1, n.ahead = 24, ic = "aic")
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. |
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
Fitted ARMA regression output.
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
arima() and auto.arima() of package forecast.
##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) iClick.ARIMA(y) #More iClick.ARIMA(y,AR = 2, MA = 2, n.ahead = 12, ic = "bic")
##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) iClick.ARIMA(y) #More iClick.ARIMA(y,AR = 2, MA = 2, n.ahead = 12, ic = "bic")
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.
iClick.GARCH(dat, meanEQ = meanEQ, garchEQ = garchEQ, n.ahead = 15)
iClick.GARCH(dat, meanEQ = meanEQ, garchEQ = garchEQ, n.ahead = 15)
dat |
Time series object, xts. |
meanEQ |
Specification of mean equation. |
garchEQ |
Specification of variance equation. |
n.ahead |
Number of out-of-sample forecasting period. |
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.
Fitted GARCH regression output.
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
library(rugarch)
##==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.
##==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.
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.
iClick.lm(dep,indep,data,Formula=NULL,bootrep=99)
iClick.lm(dep,indep,data,Formula=NULL,bootrep=99)
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 |
This GUI fits equaiton into lm regression.
Fitted lm regression output.
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
lm()
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)
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)
This GUI conducts plots of daily asset price, including calendar heatmap and many plots which are not easy to use for new users.
iClick.VisAssetPrice(dat, color4 = "r2b", color5 = "jet")
iClick.VisAssetPrice(dat, color4 = "r2b", color5 = "jet")
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". |
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.
Output GUI
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
#data("IBM") #assetPrice=IBM[,1] #iClick.VisAssetPrice(assetPrice)
#data("IBM") #assetPrice=IBM[,1] #iClick.VisAssetPrice(assetPrice)
This GUI conducts plots of daily asset returns, including ACF, PACF, drawdowns, and Talyor effects.
iClick.VisOneReturns(dat)
iClick.VisOneReturns(dat)
dat |
Time series object,xts. |
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.
Output GUI
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
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)
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)
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.
qqnormPlotX(X, labels = TRUE, col = "indianred2", pch = 19, title = TRUE, mtext = TRUE, grid = FALSE, rug = TRUE, scale = TRUE)
qqnormPlotX(X, labels = TRUE, col = "indianred2", pch = 19, title = TRUE, mtext = TRUE, grid = FALSE, rug = TRUE, scale = TRUE)
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. |
This function is an internal function of iClick GUI, which is executed on iClick.VisOneReturns GUI.
Plot
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
Functions in fBasics.
Daily returns data of 24 world national market index, 2001/1/03~2013/9/24
data("returnsDaily24")
data("returnsDaily24")
A data frame with 3320 observations on the following 24 variables.
Dates
Time string
AEX
a numeric vector of national market
AORD
a numeric vector of national market
ATX
a numeric vector of national market
BFX
a numeric vector of national market
BVSP
a numeric vector of national market
FCHI
a numeric vector of national market
FTSE
a numeric vector of national market
FTSEMIB.MI
a numeric vector of national market
GD.AT
a numeric vector of national market
GDAXI
a numeric vector of national market
GSPC
a numeric vector of national market
GSPTSE
a numeric vector of national market
HSI
a numeric vector of national market
JKSE
a numeric vector of national market
KLSE
a numeric vector of national market
KS11
a numeric vector of national market
MERV
a numeric vector of national market
MXX
a numeric vector of national market
N225
a numeric vector of national market
OMX
a numeric vector of national market
SSEC
a numeric vector of national market
SSMI
a numeric vector of national market
STI
a numeric vector of national market
TWII
a numeric vector of national market
Daily stock returns of 24 world national markets.
Yahoo finance.
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.
seriesPlotX(x,labels=TRUE,type="l",col="indianred2", ylab="Value", title=TRUE, grid=TRUE, box=TRUE, rug=TRUE)
seriesPlotX(x,labels=TRUE,type="l",col="indianred2", ylab="Value", title=TRUE, grid=TRUE, box=TRUE, rug=TRUE)
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. |
This function is an internal function of iClick GUI, which is executed on iClick.VisOneReturns GUI.
Plot
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
fBasics
This function tests for mullticolinearity.
VIF_no(obj)
VIF_no(obj)
obj |
A lm object |
This function is an internal function of iClick GUI, which is executed on iClick.lm GUI.
Test statistic
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University
Daily close price data of world20, 2007/4/24~2017/4/21
data("world20")
data("world20")
A xts object with 2518 observations of twenty national market indices.
A xts object with 2518 observations of twenty national market indices.
Yahoo finance.