Description Details Author(s) References Examples
Constructs the smallest Density Ratio Class for elicited probability-quantile points (or intervals) given a lower and upper distributional shape. Used optimisation algorithms are the methods Nelder-Mead
and L-BFGS-B
implemented in the standard R function optim
. The package is easily customizable by using templates from the example section for distributions and transformations that are not implemented yet.
Package: | fitDRC |
Type: | Package |
Version: | 1.1.1 |
Date: | 2018-06-08 |
License: | GPL-2 |
LazyLoad: | yes |
The most important functions producing objects or results are:
(1) dist.distributionfamily.create(...) | see for the class description distribution |
(2) trans.transformationkind.create(...) | see for the class description transformation |
(3) dist.trans.create(...) | see for the constructor description dist.trans.create |
(4) process.elidat(...) | see for the processing description process.elidat |
(1) creates an object of the class distribution
that is used to design lower
and upper distribution of the Density Ratio Class whereby the implemented distributions are:
Normal | dist.normal.create |
Student | dist.student.create |
Weibull | dist.weibull.create |
Lognormal | dist.lognormal.create |
Beta | dist.beta.create |
Gamma | dist.gamma.create |
F | dist.f.create |
Uniform | dist.uniform.create |
Logistic | dist.logistic.create |
(2) creates an object of the class transformation
that is used to
transform the distribution(s) with (3) (see dist.trans.create
) returning again an object of
the class distribution
. However, implemented transformations are:
Arctan | trans.arctan.create |
Tan | trans.tan.create |
Log | trans.log.create |
Exponential | trans.exp.create |
Dilation | trans.dil.create |
(4) processes the probability-quantile intervals/points in combination with the lower and upper distribution and returns
an object of the class drclass
that is the Density Ratio Class one wants to obtain (see process.elidat
).
Several methods are implemented for each class described above. Use the templates from the example sections for the implementation of distributions and transformations that are not implemented yet.
Simon L. Rinderknecht and Peter Reichert.
Rinderknecht, S.L., Borsuk, M.E. and Reichert, P. Eliciting Density Ratio Classes. International Journal of Approximate Reasoning 52, 792-804, 2011. doi10.1016/j.ijar.2011.02.002. \ Rinderknecht, S. L., Borsuk, M. E. and Reichert, P. Bridging Uncertain and Ambiguous Knowledge with Imprecise Probabilities, Environmental Modelling & Software 36, 122-130, 2012.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | ################# Example 01 ################
# Demonstration of the construction of a very narrow Density Ratio Class
# for a case where the input quantiles correspond to the quantiles of the
# parametric distribution used for the lower and upper densities (in this
# case both are Normal distributions).
# Definition of quantiles:
p <- c(0.05, 0.25, 0.5, 0.75, 0.95)
q <- qnorm(p)
# Definition of parametric shapes of lower and upper densities (Normal):
dist.lower <- dist.normal.create(par=c(1,2))
dist.upper <- dist.normal.create(par=c(3,4))
# Parameter estimation (attention: runtime several minutes):
#res <- process.elidat(p = p,
# q = q,
# dist.lower,
# dist.upper,
# start.dist.lower.par = c("Mean"=2,"StDev"=3),
# start.dist.upper.par = c("Mean"=4,"StDev"=5))
# Extract density ratio class, print and plot results:
#drc01 <- res$drc
#print(drc01)
#plot(drc01)
################# Example 02 ################
# Demonstration of the construction of a Density Ratio Class using tans-
# formed beta distributions for lower and upper densities.
# Definition of quantiles:
p <- c(0.05, 0.25, 0.5, 0.75, 0.95)
q <- c(80, 145, 200, 240, 280)
# Definition of parametric shapes of lower and upper densities (transf. beta):
dist.beta <- dist.beta.create(par=c(2.5,2.5))
trans.dil <- trans.dil.create(c(60, 305, 0, 1))
dist.lower <- dist.trans.create(dist.beta,trans.dil)
dist.upper <- dist.lower
# Parameter estimation (attention: runtime several minutes):
#res <- process.elidat(p = p,
# q = q,
# dist.lower,
# dist.upper,
# start.dist.lower.par =c("Shape1"=2.5,"Shape2"=2.5),
# start.dist.upper.par = c("Shape1"=2.5,"Shape2"=2.5))
# Extract density ratio class, print and plot results:
#drc02 <- res$drc
#print(drc02)
#plot(drc02)
# Note, due to the transformation, mean, standard deviation, median and mode
# cannot be calculated analytically (print(drc02 returns NA)). However, these
# characteristics can be calculated numerically, using a sample from the
# distribution (demonstrated for the lower density):
# Mean:
#mean(CDFinv(drc02$dist.lower,runif(100000,0,1),drc02$dist.lower$par))
# Standard Deviation:
#sd(CDFinv(drc02$dist.lower,runif(100000,0,1),drc02$dist.lower$par))
# Median:
#CDFinv(drc02$dist.lower,0.5)
# Mode:
#samp <- runif(100000,0,1)
#ind.max <- which.max(PDF(drc02$dist.lower,
# CDFinv(drc02$dist.lower,samp,drc02$dist.lower$par),
# drc02$dist.lower$par))
#CDFinv(drc02$dist.lower,samp[ind.max],drc02$dist.lower$par)
################# Example 03 ################
# Demonstration of the construction of a Density Ratio Class using different
# parametric shapes for lower (Normal) and upper (Student t) distributions.
# Definition of quantiles:
p <- c(0.05, 0.25, 0.5, 0.75, 0.95, 0.05, 0.25, 0.5, 0.75, 0.95)
q <- log(c(1, 2, 4, 6, 10, 2, 3, 5, 9, 14))
# Definition of parametric shapes of lower and upper densities (Normal and
# Student t):
dist.lower <- dist.normal.create(par=c(1,1))
dist.upper <- dist.student.create(par=c(1,1,3))
# Parameter estimation (attention: runtime several minutes):
#res <- process.elidat(p = p,
# q = q,
# dist.lower,
# dist.upper,
# start.dist.lower.par = c("Mean"=1,"StDev"=1),
# start.dist.upper.par = c("Mean"=1,"StDev"=1))
# Extract density ratio class, print and plot results:
#drc03 <- res$drc
#print(drc03)
#plot(drc03,range=c(0.001,15))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.