Description Usage Arguments Details Value Author(s) References See Also Examples
Lower and upper distributions of the Density Ratio Class must be in the form of an object of the class distribution
such as described in this sheet. Objects of the class distribution
can be used in a second step in function process.elidat
that finally yields the smallest Density Ratio Class given the the probability-quantile intervals/poins. The described functions below create distribution
objects for wich some methods are implemented too. The distributional parameter(s) (at least one) that finally shall be optimized for the smallest Density Ratio Class must be specified with name. For transformed distributions see transformation
and dist.trans.create
.
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 | dist.normal.create(par = NA)
dist.student.create(par = NA)
dist.weibull.create(par = NA)
dist.lognormal.create(par = NA)
dist.beta.create(par = NA)
dist.gamma.create(par = NA)
dist.f.create(par = NA)
dist.uniform.create(par= NA)
dist.logistic.create(par = NA)
## S3 method for class 'distribution'
print(x = dist,...)
## S3 method for class 'distribution'
summary(object = dist,...)
## S3 method for class 'distribution'
plot(x = dist, par = dist$par, range = NA, what = "PDF", plot = TRUE, length = 101, ...)
## S3 method for class 'distribution'
PDF(dist, x, par = dist$par, log = FALSE,...)
## S3 method for class 'distribution'
CDF(dist, x, par = dist$par,...)
## S3 method for class 'distribution'
CDFinv(dist, p, par = dist$par,...)
## S3 method for class 'distribution'
RANGE(dist, par = dist$par,...)
## S3 method for class 'distribution'
MEAN(dist, par = dist$par, ...)
## S3 method for class 'distribution'
SD(dist, par = dist$par, ...)
## S3 method for class 'distribution'
MEDIAN(dist, par = dist$par, ...)
## S3 method for class 'distribution'
MODE(dist, par = dist$par, ...)
|
par |
vector of the parameters of the distribution, if not named in the implemented order as shown in the list below for each implemented distribution. At least one parameter value has to be specified. Unspecified parameter values will take the default values (see list below).
| |||||||||||||||||||
dist |
object of class | |||||||||||||||||||
x |
in dependence of the function either an object of the class | |||||||||||||||||||
object |
object of the class | |||||||||||||||||||
p |
probability of where the inverse distribution has to be evaluated. | |||||||||||||||||||
range |
used in the method | |||||||||||||||||||
what |
determines what to plot or calculate, can be set to: | |||||||||||||||||||
plot |
argument used in the method | |||||||||||||||||||
length |
plot resolution. | |||||||||||||||||||
log |
if TRUE the logarithm of the PDF is returned, default is FALSE. | |||||||||||||||||||
... |
further arguments that can be passed to a function. |
Implement your own distribution using the template from the example section below if the distribution you are looking for is not implemented.
name |
the name of the distribution |
range |
the range of the distribution |
par.names |
the names of the parameters of the distribution |
par.ranges |
the ranges of the parameters of the distribution |
par |
the values of the parameters of the distribution |
mean |
a function to calculate the mean of the distribution |
sd |
a function to calculate the standard deviation of the distribution |
median |
a function to calculate the median of the normal distribution |
mode |
a function to calculate the mode of the distribution (does not exist for e.g. the Uniform distribution) |
pdf |
a function to calculate the pdf (probability density function) of the distribution |
cdf |
a function to calculate cdf (cumulative distribution function) of the distribution |
cdf.inv |
a function to calculate the inverse cdf of the distribution |
Simon L. Rinderknecht
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.
See also fitDRC
for general information and transformation
, dist.trans.create
for transformed distributions.
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 | print(dist.normal.create(c(Mean = 0, StDev = 1)))
print(dist.student.create(c(DF=99)))
dist.weibull.create(c(Shape=2,Scale=99))
summary(dist.lognormal.create(c(StDev=2)))
plot(dist.beta.create(c(2,1)),plot=FALSE)
plot(dist.gamma.create(c(2,1)),main="myGamma",xlab="x",ylab="pdf")
plot(dist.f.create(c(ncp=99)),main="F",what="CDF",xlab="x",ylab="cdf")
plot(dist.uniform.create(c(-1,1)),main="Uniform",what="CDFinv",xlab="p",ylab="inv-cdf")
plot(dist.logistic.create(c(2,1)),par=c(Scale=5))
dist.normal <- dist.normal.create(c(StDev=2))
is(dist.normal) # element of class distribution
plot(dist.normal,par=c(StDev=3))
dist.normal$par <- c(2,2) # "permanent" parameter change
plot(dist.normal)
plot(dist.normal, par = c(Mean = 0)) # "temporary" parameter change
# Default setting of the parameters:
dist.normal.create(par = c(Mean = 0, StDev = 1))
dist.student.create(par = c("Mean" = 0, "StDev" = 1, "DF" = 3))
dist.weibull.create(par = c( "Shape" = 2, "Scale" = 2 ))
dist.lognormal.create(par = c("Mean" = 1, "StDev" = 1))
dist.beta.create(par = c("Shape1" = 1, "Shape2" = 1))
dist.gamma.create(par = c("shape" = 1, "rate" = 1))
dist.f.create(par = c("df1" = 3,"df2" = 5, "ncp" = 0))
dist.uniform.create(par= c("Min" = 0, "Max" = 1))
dist.logistic.create(par = c("Location" = 0,"Scale" = 1))
##############################################################################
### if you want to create your own distribution read this ###
##############################################################################
# use the template below and replace the code in between *<* ... *>*
# accordingly. Do not forget to delete the *<* and *>* that are only used to
# indicate the custom fields.
# type 'dist.normal.create' to see an already implemented distribution.
##############################################################################
### if you want to create your own distribution use the following template ###
##############################################################################
# dist.*<*YourDistributionFamilyName*>*.create <- function(par=NA)
# {
# # set default parameter values:
# par.default <- c(*<*YourFirstParamterDefaulValue, ...*>*)
# names(par.default) <- c( *<*"YourParameterNameOfYourFirstParamter", "..."*>* )
# p <- mergePar(par,par.default)
# # construct class:
# dist <- list()
# dist$name <- "*<*YourDistributionName*>*"
# dist$range <- function(par) # range of the distribution
# {
# return(c(*<*YourLowerRange,YourUperRange*>*))
# }
# dist$par.names <- names(p)
# dist$par.ranges <- matrix(
# c(*<*-NA, +NA,*>* # ranges of par01
# *<*-NA, +NA*>*), # ...
# byrow=TRUE,ncol=2)
# dist$par <- p
# dist$mean <- function(par)
# {
# mean <- *<*MeanFormula(par)*>*
# names(mean) <- "Mean"
# return(mean)
# }
# dist$sd <- function(par)
# {
# sd <- *<*StandardDevFormula(par)*>*
# names(sd) <- "StDev"
# return(sd)
# }
# dist$median <- function(par)
# {
# median <- *<*MedianFormula(par)*>*
# names(median) <- "Median"
# return(median)
# }
# dist$mode <- function(par)
# {
# mode <- *<*ModeFormula(par)*>*
# names(mode) <- "Mode"
# return(mode)
# }
# dist$pdf <- function(x,par) { return( *<*dyourdist(x, par)*>* ) }
# dist$cdf <- function(x,par) { return( *<*pyourdist(x, par)*>* ) }
# dist$cdf.inv <- function(p,par) { return( *<*qyourdist(p, par)*>* ) }
# class(dist) <- "distribution"
# return(dist)
#}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.