Description Usage Arguments Details Value Author(s) References See Also Examples
To transform a lower or upper distribution in order to find even a better fit for a Density Ratio Class, one has firstly to specify an object of the class transformation
due to the constructors trans.transformationkind.create(par)
that are described in this help sheet.
Secondly, once an object of the class transformation
is created use the function dist.trans.create
to obtain an object of the class distribution
that is finally used for fitting the Density Ratio Class with the help of the function process.elidat
.
Implemented tranformations are the arctan
, tan
, dilation
, log
and a particular trans.exp.create
transformation. They are defined as follows:
arctan: | 0.5*(Min+Max) + (Max-Min)/pi*atan(x) |
tan: | tan(0.5*pi*(2*x-Max-Min)/(Max-Min)) |
dil: | (x-Min1) * (Max2-Min2)/(Max1-Min1) + Min2 |
log: | log(x) |
exp: | -(a/b^2) * exp(-b*x) + c*x + (a/b^2) |
It is also possible to implement an own object of the class transformation
. Do this by using the template below from the example section.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | trans.arctan.create(par = NA)
trans.tan.create(par = NA)
trans.dil.create(par = NA)
trans.log.create(par = NA)
trans.exp.create(par = NA)
## S3 method for class 'transformation'
print(x = trans,...)
## S3 method for class 'transformation'
summary(object,...)
## S3 method for class 'transformation'
plot(x = trans, par = trans$par,
range.x = NA, range.y = NA, what = "TRANS.FORW", plot = TRUE,
length = 101,...)
|
par |
vector of the parameters of the transformation, if not named in the implemented order. At least one parameter value has to be specified. Unspecified values will be default values as in the list below:
| |||||||||||
x |
object of the class | |||||||||||
object |
object of the class | |||||||||||
plot |
used in the method | |||||||||||
what |
used in the method | |||||||||||
range.x |
specifies the x-range of the plot in the method | |||||||||||
range.y |
specifies the y-range of the plot in the method | |||||||||||
length |
specifies the number of evaluations within the range for the plot in the method | |||||||||||
... |
further arguments that can be passed to the function. |
Implemented methods for objects of the class transformation
are: print
summary
plot
.
name |
the name of the transformation |
range.x |
the x-range of the transformation |
range.y |
the y-range of the transformation |
par.names |
the names of the transformation parameters |
par.ranges |
the ranges of the transformation parameters |
par |
the values of the transformation parameters |
trans.forw |
a function to calculate the forward transformation |
trans.backw |
a function to calculate the backward transformation |
trans.deriv |
a function to calculate the derivation of the transformation |
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.
fitDRC
, distribution
, dist.trans.create
and process.elidat
.
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 | trans.arctan <- trans.arctan.create(c(0,10))
print(trans.arctan)
summary(trans.arctan)
#x11()
#plot(trans.arctan)
#plot(trans.arctan,what = "TRANS.BACKW")
#plot(trans.arctan,what = "TRANS.DERIV")
trans.tan <- trans.tan.create(c(0,10))
#x11()
#plot(trans.tan)
#plot(trans.tan,what = "TRANS.BACKW")
#plot(trans.tan,what = "TRANS.DERIV")
trans.log <- trans.log.create()
#x11()
#plot(trans.log,range.x=c(-1,1))
#plot(trans.log,what = "TRANS.BACKW",range.y=c(-1,1))
#plot(trans.log,what = "TRANS.DERIV",range.x=c(-1,1))
trans.dil <- trans.dil.create(c(0,1,4,5))
#x11()
#plot(trans.dil,range.x=c(-1,1))
#plot(trans.dil,what = "TRANS.BACKW", range.y = c(-1,1))
#plot(trans.dil,what = "TRANS.DERIV", range.x = c(-1,1))
trans.exp <- trans.exp.create(c(3, 2, 1))
#x11()
#plot(trans.exp,range.x=c(-1,1))
#plot(trans.exp,what = "TRANS.BACKW", range.y = c(-4,3))
#plot(trans.exp,what = "TRANS.DERIV", range.x = c(-1,1))
# implemented default values are:
trans.arctan.create(par = c(Min = 0, Max = 1))
trans.tan.create(par = c(Min = 0, Max = 1))
trans.dil.create(par = c("Min1" = 0, "Max1" = 1, "Min2" = 0, "Max2" = 1))
trans.log.create(par = c("-" = NA))
trans.exp.create(par = c("a" = 0, "b" = 1, "c" = 0))
##############################################################################
### if you want to create your own transformation 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 'trans.exp.create' to see an already implemented transformation.
################################################################################
### if you want to create your own transformation use the following template ###
################################################################################
# trans.*<*yournameofyourtransformation*>*.create <- function(par=c(NA)
# {
# # set default parameter values:
# par.default <- c(*<*NA,...*>*)
# names(par.default) <- c(*<*"a",...*>*)
# p <- mergePar(par,par.default)
# # construct class:
# trans <- list()
# trans$name <- "*<*yourname"*>*
# trans$range.x <- function(par){*<*return(c(min.x,max.x))*>*}
# trans$range.y <- function(par){*<*return(c(min.y,max.y))*>*}
# trans$par.names <- names(p)
# # ranges of the parameters of the transformation
# trans$par.ranges <- matrix(
# c(*<*-NA, +NA*>*, # range of 1st parameter
# *<*-NA, +NA*>*), # range of 2nd par.....
# byrow=TRUE,ncol=2)
# trans$par <- p
# trans$trans.forw <- function(x,par)
# { y <- *<*yourForwardFormula(x,par)*>*
# return(as.numeric(y))
# }
# trans$trans.backw <- function(y,par)
# { x <- *<*yourBackwardFormula(y,par)*>*
# return(as.numeric(x)) }
# trans$trans.deriv <- function(x,par)
# { dydx <- *<*yourDerivationFormula(x,par)*>*
# return(as.numeric(dydx)) }
# class(trans) <- "transformation"
# return(trans)
# }
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.