evepan {epandist} | R Documentation |
Calculate expected value of censored variable
Description
This function calculates the expected value of a random censored epanechnikov-distributed variable with a given censoring point.
The inverse of this function is cepan
.
Usage
evepan(c = 0, mu = 0, r = 5^0.5, side_censored = "left")
Arguments
c |
censoring point. |
mu |
mean of distribution prior to censoring. |
r |
half the range of the distribution, ie the distance from the mean to the smallest/largest value supported by the distribution. |
side_censored |
indicates whether the variable is |
Value
the expected value associated with c
, mu
and r
.
Examples
#Expected value of an epan-distributed variable left-censored at 100 (given mu=100 and r=10):
evepan(c=100,mu=100,r=10)
#Expected value as a function of censoring point, epanechnikov distribution:
curve(evepan(c=x),col='blue',xlim=c(-sqrt(5),sqrt(5)),yaxs='i',xaxs='i',
main='Expected value as a function of censoring point',xlab='Censoring point',ylab='Expected value')
#Expected value as a function of censoring point, normal distribution:
curve(dnorm(x)+pnorm(x)*x,col='green',add=TRUE)
#Expected value as a function of censoring point, no uncertainty:
curve(1*x,col='grey',add=TRUE)
#Legend
legend(x=-sqrt(5),y=sqrt(5),legend=c('Epanechnikov','Normal distribution','No uncertainty'),
lty=c(1,1),col=c('blue','green','grey'))
[Package epandist version 1.1.1 Index]