Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove convenience wrapper functions for shock (size) arrival parameter #114

Merged
merged 14 commits into from
Apr 4, 2024
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rmo
Title: A package for the Marshall-Olkin distribution
Version: 0.8.4
Version: 0.8.5
Authors@R:
person(given = "Henrik",
family = "Sloot",
Expand Down Expand Up @@ -36,7 +36,6 @@ Collate:
'RcppExports.R'
'catch-routine-registration.R'
'error.R'
'parameter.R'
'rmo-package.R'
's4-BernsteinFunction.R'
's4-LevyBernsteinFunction.R'
Expand Down
18 changes: 0 additions & 18 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,7 @@ export(ScaledBernsteinFunction)
export(SumOfBernsteinFunctions)
export(exIntensities)
export(exQMatrix)
export(ex_intensities_alpha_stable)
export(ex_intensities_armageddon)
export(ex_intensities_constant)
export(ex_intensities_exponential)
export(ex_intensities_gamma)
export(ex_intensities_inverse_gaussian)
export(ex_intensities_linear)
export(ex_intensities_pareto)
export(ex_intensities_poisson)
export(intensities)
export(intensities_alpha_stable)
export(intensities_armageddon)
export(intensities_constant)
export(intensities_exponential)
export(intensities_gamma)
export(intensities_inverse_gaussian)
export(intensities_linear)
export(intensities_pareto)
export(intensities_poisson)
export(levyDensity)
export(rexmo)
export(rextmo)
Expand Down
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

- Remove outdated rmarkdown notebooks from development phase (#115)

- Remove convenience wrapper functions for generating shock arrival intensity
and shock-size arrival intensity parameter (#114)

- Add `ConvexCombinationOfBernsteinFunctions` to represent convex combinations
of Bernstein functions compactly.
of Bernstein functions compactly

# rmo 0.8.2

Expand Down
264 changes: 0 additions & 264 deletions R/parameter.R

This file was deleted.

10 changes: 7 additions & 3 deletions bench/armageddon-15.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' ## Only killing and drift ##
#'
#' For the CPP LFM parametrisation with *no* jump, but drift and killing, we
#' For the CPP LFM parametrization with *no* jump, but drift and killing, we
#' chose the parameters \( \alpha = 0.6 \) (drift) and \( \beta = 0.2 \) (rate
#' killing). #+ r parameters
n <- 1e3
Expand All @@ -9,8 +9,12 @@ d <- 15
alpha <- 0.6
beta <- 0.2

intensities <- rmo::intensities_armageddon(d, alpha, beta)
ex_intensities <- rmo::ex_intensities_armageddon(d, alpha, beta)
bf <- rmo::SumOfBernsteinFunctions(
first = rmo::ConstantBernsteinFunction(constant = alpha),
second = rmo::LinearBernsteinFunction(scale = beta)
)
intensities <- rmo::intensities(bf, d)
ex_intensities <- rmo::exIntensities(bf, d)

#+ r bench
bench::mark(
Expand Down
12 changes: 8 additions & 4 deletions bench/pareto-125.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' ## Pareto jump CPP ##
#'
#' For the CPP LFM parametrisation with *Pareto* jumps, we chose the parameters \( \lambda = 1 \),
#' \( \alpha = 0.5 \), and \( x_0 = 5e-4 \). This corresponds to a
#' mean-jump-value of approximately \( 0.07 \).
#' For the CPP LFM parametrization with *Pareto* jumps, we chose the parameters
#' \( \lambda = 1 \), \( \alpha = 0.5 \), and \( x_0 = 5e-4 \). This corresponds
#' to a mean-jump-value of approximately \( 0.07 \).
#+ r parameters
n <- 1e3
d <- 125
Expand All @@ -11,7 +11,11 @@ lambda <- 1
alpha <- 0.5
x0 <- 5e-4

ex_intensities <- lambda * rmo::ex_intensities_pareto(d, alpha, x0)
bf <- rmo::ScaledBernsteinFunction(
scale = lambda,
original = rmo::ParetoBernsteinFunction(alpha = alpha, x0 = x0)
)
ex_intensities <- rmo::exIntensities(bf, d)

#+ r bench
bench::mark(
Expand Down
15 changes: 10 additions & 5 deletions bench/pareto-15.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' ## Pareto jump CPP ##
#'
#' For the CPP LFM parametrisation with *Pareto* jumps, we chose the parameters \( \lambda = 1 \),
#' \( \alpha = 0.5 \), and \( x_0 = 5e-4 \). This corresponds to a
#' mean-jump-value of approximately \( 0.07 \).
#' For the CPP LFM parametrization with *Pareto* jumps, we chose the parameters
#' \( \lambda = 1 \), \( \alpha = 0.5 \), and \( x_0 = 5e-4 \). This corresponds
#' to a mean-jump-value of approximately \( 0.07 \).
#+ r parameters
n <- 1e3
d <- 15
Expand All @@ -11,8 +11,13 @@ lambda <- 1
alpha <- 0.5
x0 <- 5e-4

intensities <- lambda * rmo::intensities_pareto(d, alpha, x0)
ex_intensities <- lambda * rmo::ex_intensities_pareto(d, alpha, x0)

bf <- rmo::ScaledBernsteinFunction(
scale = lambda,
original = rmo::ParetoBernsteinFunction(alpha = alpha, x0 = x0)
)
intensities <- rmo::intensities(bf, d)
ex_intensities <- rmo::exIntensities(bf, d)

#+ r bench
bench::mark(
Expand Down