Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fin-periodical

End-of-Period Series, Stats, and Benchmarks


Description

Computes perodical statistics back to a given period.

Usage

endOfPeriodSeries(x, 
    nYearsBack = c("1y", "2y", "3y", "5y", "10y", "YTD"))

endOfPeriodStats(x, 
    nYearsBack = c("1y", "2y", "3y", "5y", "10y", "YTD"))
    
endOfPeriodBenchmarks(x, benchmark = ncol(x),
    nYearsBack = c("1y", "2y", "3y", "5y", "10y", "YTD"))

Arguments

x

an end-of-month recorded multivariate 'timeSeries' object. One of the columns holds the benchmark series specified by the argument benchmark, By defauklt this is the last column of x.

nYearsBack

a period string. How long back should the series be treated? Options include values from 1 year to 10 years, and year-to-date: "1y", "2y", "3y", "5y", "10y", "YTD".

benchmark

an integer giving the position of the benchmar series in x.

Details

The function endOfPeriodSeries returns series back to a given period.
The function endOfPeriodStats returns statistics back to a given period.
The function endOfPeriodBenchmarks returns benchmarks back to a given period.

x must be end of month data. Note you can create such series using for example the functions: align, alignDailySeries, daily2monthly.

Examples

## Load Series: Column 1:3 Swiss Market, Column 8 (4) Benchmark
   x <- 100 * LPP2005REC[, c(1:3, 8)]
   colnames(x)
   x <- daily2monthly(x)
   x
   
## Get the Monthly Series - 
   endOfPeriodSeries(x, nYearsBack="1y")
   
## Compute the Monthly Statistics - 
   endOfPeriodStats(x, nYearsBack="1y")
   
## Compute the Benchmark - 
   endOfPeriodBenchmarks(x, benchmark=4)

timeSeries

Financial Time Series Objects (Rmetrics)

v3062.100
GPL (>= 2)
Authors
Diethelm Wuertz [aut] (original code), Tobias Setz [cre], Yohan Chalabi [ctb], Martin Maechler [ctb] (<https://orcid.org/0000-0002-8685-9910>)
Initial release
2020-01-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.