check.convergence {convco}R Documentation

Check convergence

Description

This function enables one to investigate the four classical modes of convergence on simulated data: in probability, almost surely, in r-th mean and in law.

Usage

check.convergence(nmax,M,genXn,argsXn=NULL,mode="p",epsilon=0.05,r=2,nb.sp=10,density=TRUE,densfunc=dnorm,probfunc=pnorm,tinf=-3,tsup=3,trace=plot)

Arguments

nmax number of points in each sample path.
M number of sample paths to generate.
mode a character string specifying the mode of convergence to investigate, must be one of "p" (default), "as", "r" or "L".
genXn a function that generates the Xn-X values, or only the Xn values in the law case.
argsXn a list of arguments to genXn.
epsilon a numeric value giving the interval endpoint.
r a numeric value (r>0) if convergence in r-th mean is to be studied.
nb.sp number of sample paths to draw on the left plot.
density if density=TRUE, then the plot of the density of X and the histogram of Xn is returned. If density=FALSE, then the plot of the distribution function F(t) of X and the empirical distribution Fn(t) of Xn is returned.
densfunc function to compute the density of X.
probfunc function to compute the distribution function of X.
tinf lower limit from where you want to investigate convergence in law.
tsup upper limit to where you want to investigate convergence in law.
trace type of function used to draw the plot: plot or points.
... optional arguments to trace.

Details

The objective of this function is to investigate graphically the convergence of some random variable Xn to some random variable X. In order to use it, you should be able to provide generators of Xn and X (or of Xn-X). The four modes of convergence that you can try are: in probability, almost surely, in r-th mean and in law.

Value

a completer

Author(s)

P. Lafaye de Micheaux and B. Liquet

References

Lafaye de Micheaux, P. (plafaye@club.fr), Liquet, B. "Understanding Convergence Concepts: a Visual-Minded and Graphical Simulation Based Approach", The American Statistician , submitted.

See Also

criterion, generate, investigate, law.plot2d, law.plot3d, p.as.plot, visualize.crit, visualize.sp

Examples

########### Exercise 1 from the article ###########

       pnotasgen<-function(n){
       Z<-runif(1)
       k<-floor(log2(1:n))
       m<-1:n-2^k
       res<-(m*2^(-k)<= Z & Z<(m+1)*2^(-k))
       return(as.integer(res))
       }
    
       check.convergence(nmax=1000,M=500,genXn=pnotasgen,mode="as")


[Package convco version 0.4 Index]