https://github.com/hughparsonage/grattaninflators
https://github.com/hughparsonage/grattaninflators
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/hughparsonage/grattaninflators
- Owner: HughParsonage
- Created: 2022-06-22T06:56:52.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-20T13:02:18.000Z (about 2 years ago)
- Last Synced: 2024-04-21T14:55:54.106Z (about 2 years ago)
- Language: C
- Size: 213 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
---
title: "README"
author: "Hugh Parsonage"
date: "`r Sys.Date()`"
output:
md_document:
variant: markdown_github
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(bench)
library(data.table)
library(grattanInflators)
```
## grattanInflators
Utility package for CPI and other inflators.
### Benchmarks
```{r bench1}
x <- rep_len(fy::yr2fy(1999:2020), 1e7)
system_time(grattan::cpi_inflator(, x, "2019-20"))
system_time(cpi_inflator(x, "2019-20"))
system_time(cpi_inflator(x, "2019-20", nThread = 4L))
y <- dqrng::dqsample(x)
system_time(grattan::cpi_inflator(, x, y))
system_time(cpi_inflator(x, y, nThread = 4L))
x <- rep_len(x, 1e8)
system_time(cpi_inflator(x, "2019-20", nThread = 4L))
x <- y <- NULL
```
```{r bench2}
x <- seq(as.Date("1999-01-01"), as.Date("2020-01-01"), by = "1 day")
x <- rep_len(x, 1e7)
system_time(cpi_inflator(x, "2019-01-01"))
```
```{r bench3}
x <- rep_len(x, 1e8)
system_time(cpi_inflator(x, "2019-01-01", nThread = 4L))
x <- as.IDate(x)
system_time(cpi_inflator(x, as.IDate("2019-01-01"), nThread = 4L))
```