The goal of solvetruncated is to solve for parameters of truncated distributions given desired mean and value of CDF at a point. It does this by numerical optimization.
This is for example useful for when specifying a prior in Bayesian, where your belief is often with respect to a mean and value of CDF at a point.
You can install the development version of solvetruncated from GitHub with:
# install.packages("devtools")
devtools::install_github("BjarkeHautop/solvetruncated")
Here is an example where we wish to solve for the parameters
library(solvetruncated)
solve_truncated_normal(desired_mean = 0.5, x_value = 0.75, desired_prob = 0.8, a = 0, b = Inf)
#> $mu
#> [1] 0.4208603
#>
#> $sigma
#> [1] 0.3543778
which gives that the parameters should be