View source: R/returns_diagnostics.R
returns_diagnostics | R Documentation |
Download financial time series from https://stooq.pl/ in .csv format.
returns_diagnostics(returns, lags = 10, significance = 0.05, plot = TRUE)
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) |
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.
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.