returns_diagnostics: Return Diagnostics function

View source: R/returns_diagnostics.R

returns_diagnosticsR Documentation

Return Diagnostics function

Description

Download financial time series from https://stooq.pl/ in .csv format.

Usage

returns_diagnostics(returns, lags = 10, significance = 0.05, plot = TRUE)

Arguments

returns

Numeric vector of asset returns

lags

Number of lags for ACF plot and Ljung-box test. Default set to 10

significance

Significance level for hypothesis testing. Deafult set to 0.05

plot

If TRUE plot diagnostics plots (histogram with fitted densities, qq-plots, ACF)

Value

List of fitted normal and t-student parameters. Results of stationarity tests (Ljung-Box and ADF). Additionaly 2x2 plot is generated with histogram of returns and fitted densities, qq-plots and ACF function.

Examples

files <- list.files('datasets\\')
close_prices <- df_prices(files = files
                          ,source = 'datasets\\')
weights <- c(0.40, 0.40, 0.20)
portfolio_returns(close_prices, weights) %>%
 returns_diagnostics()

pawel-wieczynski/PolishStock documentation built on March 23, 2022, 3:32 p.m.