Free Access Week-  Data Engineering + BI
Data engineering and BI courses are free!
Free AI Access Week from June 2-8

ifs (version 0.1.10)

ifs: IFS estimator

Description

Distribution function estimator based on sample quantiles.

Usage

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"))

Value

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.

Arguments

x

where to estimate the distribution function

p

the vector of coefficients pi

s

the vector of coefficients si in: wi=six+ai

a

the vector of coefficients ai in: wi=six+ai

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 q * length(y).

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

Author

S. M. Iacus

Details

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.

References

Iacus, S.M, La Torre, D. (2005) Approximating distribution functions by iterated function systems, Journal of Applied Mathematics and Decision Sciences, 1, 33-46.

See Also

Examples

Run this code
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*xx-3)
     
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((ww-ss)^2)
mean((tt-ss)^2)

plot(xx,(ww-ss)^2,main="MSE",type="l",xlab="x",ylab="MSE(x)")
lines(xx,(tt-ss)^2,col="red")

Run the code above in your browser using DataLab