ifs  R Documentation 
Distribution function estimator based on sample quantiles.
ifs(x, p, s, a, k = 5) ifs.flex(x, p, s, a, k = 5, f = NULL) IFS(y, k = 5, q = 0.5, f = NULL, n = 512, maps = c("quantile", "wl1", "wl2"))
x 
where to estimate the distribution function 
p 
the vector of coefficients p_i 
s 
the vector of coefficients s_i in: w_i = s_i *x + a_i 
a 
the vector of coefficients a_i in: w_i = s_i *x + a_i 
k 
number of iterations, default = 5 
y 
a vector of sample observations 
q 
the proportion of quantiles to use in the construction of the
estimator, default = 0.5. The number of quantiles is the

f 
the starting point in the space of distribution functions 
n 
the number of points in which to calculate the IFS 
maps 
type of affine maps 
This estimator is intended to estimate the continuous distribution function of a random variable on [0,1]. The estimator is a continuous function not everywhere differentiable.
The estimated value of the distribution function for ifs
and ifs.flex
or
a list of ‘x’ and ‘y’ coordinates of the IFS(x) graph for IFS
.
It is asymptotically as good as the empirical distribution function
(see Iacus and La Torre, 2001).
This function is called by IFS. If you need to call the function
several times, you should better use ifs
providing the
points and coefficients once instead of IFS
.
Empirical evidence shows that the IFSestimator is better than the edf (even
for very small samples) in the supnorm metric. It is also better in the MSE
sense outside of the distribution's tails if the sample quantiles are used
as points.
S. M. Iacus
Iacus, S.M, La Torre, D. (2005) Approximating distribution functions by iterated function systems, Journal of Applied Mathematics and Decision Sciences, 1, 3346.
ecdf
require(ifs) y<rbeta(50,.5,.1) # uncomment if you want to test the normal distribution # y<sort(rnorm(50,3,1))/6 IFS.est < IFS(y) xx < IFS.est$x tt < IFS.est$y ss < pbeta(xx,.5,.1) # uncomment if you want to test the normal distribution # ss < pnorm(6*xx3) par(mfrow=c(2,1)) plot(ecdf(y),xlim=c(0,1),main="IFS estimator versus EDF") lines(xx,ss,col="blue") lines(xx,tt,col="red") # calculates MSE ww < ecdf(y)(xx) mean((wwss)^2) mean((ttss)^2) plot(xx,(wwss)^2,main="MSE",type="l",xlab="x",ylab="MSE(x)") lines(xx,(ttss)^2,col="red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.