Package 'iClick'

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

Help Index


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 <[email protected]>, College of Management, National Taiwan Normal University

Maintainer: Ho Tsung-wu <[email protected]>


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 <[email protected]>, 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

calendarHeat(values, ncolors = 99, color = "r2b", date.form = "%Y-%m-%d")

Arguments

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.

Details

This function is within the iClick GUI, is executed within iClick.VisAssetPrice().

Value

Plot

Author(s)

Ho Tsung-wu <[email protected]>, 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 <[email protected]>, 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 = "l", 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 <[email protected]>, College of Management, National Taiwan Normal University


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 <[email protected]>, 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 <[email protected]>, 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 <[email protected]>


Data of Fama-French beta of 811 listed companies of SSEC

Description

Average data of 811 listed companies of SSEC, 2001/1/03~2012

Usage

data("FFplusMOM")

Format

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

Details

Daily stock returns of 24 world national markets.

Source

Yahoo finance.

Examples

data(FFplusMOM)

Daily Price Data of IBM

Description

Daily price data of IBM, 2007/4/24~2017/4/21

Usage

data("IBM")

Format

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

Details

Daily stock price data of IBM.

Source

Yahoo finance.


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 <[email protected]>, College of Management, National Taiwan Normal University

See Also

arima() and auto.arima() of package forecast.

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)

iClick.ARIMA(y)

#More
iClick.ARIMA(y,AR = 2, MA = 2, n.ahead = 12, ic = "bic")

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 <[email protected]>, 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.

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 <[email protected]>, 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)

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 <[email protected]>, 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 <[email protected]>, 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)

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 <[email protected]>, College of Management, National Taiwan Normal University

See Also

Functions in fBasics.


Daily Returns Data of 24 Markets

Description

Daily returns data of 24 world national market index, 2001/1/03~2013/9/24

Usage

data("returnsDaily24")

Format

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

Details

Daily stock returns of 24 world national markets.

Source

Yahoo finance.


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 <[email protected]>, College of Management, National Taiwan Normal University

See Also

fBasics


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 <[email protected]>, College of Management, National Taiwan Normal University


Close Price Data of twenty national market indices

Description

Daily close price data of world20, 2007/4/24~2017/4/21

Usage

data("world20")

Format

A xts object with 2518 observations of twenty national market indices.

Details

A xts object with 2518 observations of twenty national market indices.

Source

Yahoo finance.