Learn R Programming

truelies (version 0.2.0)

difference_dist: Find density of the difference of two distributions

Description

Given two probability density functions dist1 and dist2, difference_dist returns the density of ``dist1 - dist2`.

Usage

difference_dist(dist1, dist2)

Arguments

dist1, dist2

Probability density functions

Value

A probability density function defined on [-1, 1].

Details

At the moment this only works when dist1 and dist2 are defined on [0, 1].

Examples

Run this code
# NOT RUN {
d1 <- update_prior(30, 50, P = 0.5, prior = stats::dunif)
d2 <- update_prior(32, 40, P = 0.5, prior = stats::dunif)
dd <- difference_dist(d1, d2)
dist_hdr(dd, 0.95)
# }

Run the code above in your browser using DataLab