Skip to content

Commit ba8c1e2

Browse files
committed
updated functions
1 parent 477148b commit ba8c1e2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

R/Functions.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ rate_to_prob <- function(r, t = 1){
3434
return(p)
3535
}
3636

37+
#---------------------------------------------------------------------------------------------#
38+
#### Function to convert convert probabilities to probabilities with a different frequency ####
39+
#---------------------------------------------------------------------------------------------#
40+
#' Convert a probability to a probability with a different frequency
41+
#'
42+
#' \code{rate_to_prob} convert a probability to a probability with a different frequency.
43+
#'
44+
#' @param p probability
45+
#' @param t time/ frequency
46+
#' @return a number - converted probability
47+
#'
48+
# Function to convert probabilities to probabilities with a different frequency
49+
ProbProb <- function(p, t = 1){
50+
p_new <- RateProb(ProbRate(p, t))
51+
return(p_new)
52+
}
53+
3754
#----------------------------------------------------------------------------#
3855
#### Function to check if transition probability array/matrix is valid ####
3956
#----------------------------------------------------------------------------#

0 commit comments

Comments
 (0)