Package: mhpfilter
Type: Package
Title: Modified and Fully Modified Hodrick-Prescott Filters
Version: 1.0.0
Date: 2026-11-05
Authors@R: c(
      person("Muhammad", "Yaseen", email = "myaseen208@gmail.com", role = c("aut", "cre", "cph"),
             comment = c(ORCID = "0000-0002-5923-1714"))
    , person("Javed", "Iqbal", email = "Javed.iqbal6@sbp.org.pk", role = "ctb",
             comment = "Original methodology author")
    , person(c("M.", "Nadim"), "Hanif", email = "Nadeem.hanif@sbp.org.pk", role = c("ctb", "cph"),
             comment = "Original methodology author; author of the MATLAB code of the fully modified HP filter")
    , person(c("M.", "Ali"), "Choudhary", role = "ctb", comment = "Original methodology author")
    )
Description: Decomposes macroeconomic time series into trend and cycle with
    the Hodrick-Prescott (HP) filter and two data-driven versions of it. The
    modified HP filter of McDermott (1997), assessed by Choudhary, Hanif and
    Iqbal (2014) <doi:10.1080/00036846.2014.894631>, chooses the smoothing
    parameter of every series by generalised cross-validation (as described
    in Coe and McDermott (1997) <doi:10.2307/3867497>). The fully modified HP
    filter of Hanif, Iqbal and Choudhary (2017, State Bank of Pakistan
    Working Paper 88) also reduces the end-point bias of the HP filter: it
    raises the smoothing parameter at the first and last observations, with
    linear or quadratic weights chosen to minimise the loss of Bloechl (2014,
    University of Munich Discussion Paper 2014-1). Every filter is a banded
    linear solve, so the searches are fast; batch processing of many series,
    comparisons of the filters, the filter weights, gain functions and
    end-point loss, simulation of trend-plus-cycle series and the power
    comparison of the paper, 'ggplot2' graphics, a plain-language
    interpretation of every result and a built-in 'shiny' application.
License: MIT + file LICENSE
URL: https://myaseen208.com/mhpfilter/,
        https://github.com/myaseen208/mhpfilter
BugReports: https://github.com/myaseen208/mhpfilter/issues
Encoding: UTF-8
Language: en-US
LazyData: true
Depends: R (>= 4.2)
Imports: data.table, ggplot2, grDevices, Rcpp, scales, stats, utils
LinkingTo: Rcpp, RcppArmadillo
Suggests: bslib, DT, knitr, magick, pkgload, quarto, ragg, R.rsp,
        shiny, svglite, testthat (>= 3.0.0), withr
VignetteBuilder: quarto, R.rsp
Config/testthat/edition: 3
Config/skill/prefix: mhp
RoxygenNote: 7.3.1
NeedsCompilation: yes
Packaged: 2026-11-09 02:26:15 UTC; myaseen208
Author: Muhammad Yaseen [aut, cre, cph] (ORCID:
    <https://orcid.org/0000-0002-5923-1714>),
  Javed Iqbal [ctb] (Original methodology author),
  M. Nadim Hanif [ctb, cph] (Original methodology author; author of the
    MATLAB code of the fully modified HP filter),
  M. Ali Choudhary [ctb] (Original methodology author)
Maintainer: Muhammad Yaseen <myaseen208@gmail.com>
Repository: CRAN
Date/Publication: 2026-11-09 08:50:09 UTC
