Skip to content

Commit

Permalink
Update claim_majRev_size to work with > 3 major revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
melantha-wang committed Mar 2, 2022
1 parent b381666 commit 5a076d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions SPLICE/NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPLICE

# SPLICE 1.0.1

## New features {#new-features-1.0.1}

## Minor improvements and fixes {#bugfixes-1.0.1}

* Updates `claim_majRev_size` default to work with more than 3 major revisions

4 changes: 2 additions & 2 deletions SPLICE/R/features_09_major_revisions.R
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ claim_majRev_time <- function(
payment_delays <- payment_delay_list[[i]][[j]]
no_pmt <- length(payment_delays)
majRev_list[[i]][[j]]$majRev_atP <- ifelse(
majRev_list[[i]][[j]]$majRev_time[k] == sum(payment_delays[1:(no_pmt - 1)]),
k > 0 && majRev_list[[i]][[j]]$majRev_time[k] == sum(payment_delays[1:(no_pmt - 1)]),
1, 0)

curr <- curr + 1
Expand Down Expand Up @@ -456,7 +456,7 @@ claim_majRev_size <- function(
majRev_factor[2] <- stats::rlnorm(n = 1, meanlog = 1.8, sdlog = 0.2)
if (n > 2) {
mu <- 1 + 0.07 * (6 - majRev_factor[2])
majRev_factor[3] <- stats::rlnorm(n = 1, meanlog = mu, sdlog = 0.1)
majRev_factor[3:n] <- stats::rlnorm(n = n - 2, meanlog = mu, sdlog = 0.1)
}
}

Expand Down

0 comments on commit 5a076d0

Please sign in to comment.