bb.summary.stat: Prints out the summary statistics of bull-bear states

Description Usage Arguments Value Examples

View source: R/Functions.r

Description

This function prints out (in console window) the summary statistics of bull-bear states. The outcome of this function is a table in LaTeX format.

Usage

1
bb.summary.stat(price, bull)

Arguments

price

a numeric vector of price values

bull

a logical vector that contains the states of the market. This vector is returned by function run_dating_alg or run_filtering_alg.

Value

A data frame that contains the descriptive statistics.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
library(zoo)
library(xtable)
library(ggplot2)
sp500 <- sp500m # choose the monthly data
price <- as.vector(coredata(sp500)) # retrieve prices
setpar_dating_alg(4, 6, 4, 16, 20) # parameters for monthly data
bull <- run_dating_alg(price) # detect the states
bb.summary.stat(price, bull)
}

bbdetection documentation built on April 1, 2021, 5:06 p.m.