Truncate-methods
From distr v2.6
by Peter Ruckdeschel
Methods for function Truncate in Package `distr'
Truncate-methods
- Keywords
- methods, distribution
Usage
Truncate(object, ...)
"Truncate"(object, lower = -Inf, upper = Inf)
"Truncate"(object, lower= -Inf, upper = Inf)
"Truncate"(object, lower= -Inf, upper = Inf)
"Truncate"(object, lower = -Inf, upper = Inf, withSimplify = getdistrOption("simplifyD"))
Arguments
- object
- distribution object
- ...
- not yet used; takes up
lower
,upper
,withSimplify
. - lower
- numeric; lower truncation point
- upper
- numeric; upper truncation point
- withSimplify
- logical; is result to be piped through a call to
simplifyD
?
Value
Methods
- Truncate
signature(object = "AbscontDistribution")
: returns the distribution ofmin(upper,max(X,lower))
conditioned tolower<=x<=upper< code="">, if
X
is distributed according toobject
; if slot.logExact
of argumentobject
isTRUE
and if either there is only one-sided truncation or both truncation points lie on the same side of the median, we use this representation to enhance the range of applicability, in particular, for slotr
, we profit from Peter Dalgaard's clever log-tricks as indicated in http://article.gmane.org/gmane.comp.lang.r.general/126112. To this end we use the internal functions (i.e.; non exported to namespace).trunc.up
and.trunc.low
which provide functional slotsr,d,p,q
for one-sided truncation. In case of two sided truncation, we simply use one-sided truncation successively --- first left and then right in case we are right of the median, and the other way round else; the result is again of class"AbscontDistribution"
; =x<=upper<>- Truncate
signature(object = "DiscreteDistribution")
: returns the distribution ofmin(upper,max(X,lower))
conditioned tolower<=x<=upper< code="">, if
X
is distributed according toobject
; the result is again of class"DiscreteDistribution"
=x<=upper<>- Truncate
signature(object = "LatticeDistribution")
: if length of the corresp.lattice
is infinite and slot.logExact
of argumentobject
isTRUE
, we proceed similarly as in case ofAbscontDistribution
, also using internal functions.trunc.up
and.trunc.low
; else we use the corresponding"DiscreteDistribution"
method; the result is again of class"LatticeDistribution"
- Truncate
signature(object = "UnivarLebDecDistribution")
: returns the distribution ofmin(upper,max(X,lower))
conditioned tolower<=x<=upper< code="">, if
X
is distributed according toobject
; the result is again of class"UnivarLebDecDistribution"
=x<=upper<>
See Also
Examples
plot(Truncate(Norm(),lower=-1,upper=2))
TN <- Truncate(Norm(),lower=15,upper=15.7) ### remarkably right!
plot(TN)
r(TN)(30)
TNG <- Truncate(Geom(prob=0.05),lower=325,upper=329) ### remarkably right!
plot(TNG)
Community examples
Looks like there are no examples yet.