R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("normalp-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('normalp') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "dnormp" > > ### * dnormp > > flush(stderr()); flush(stdout()) > > ### Name: dnormp > ### Title: Density function of an exponential power distribution > ### Aliases: dnormp > ### Keywords: distribution > > ### ** Examples > > ## Compute the density for a vector x with mu=0, sigmap=1 and p=1.5 > ## At the end we have the graph of the exponential power distribution > ## density function with p=1.5 > x <- c(-1, 1) > f <- dnormp(x, p=1.5) > print(f) [1] 0.2170106 0.2170106 > plot(function(x) dnormp(x, p=1.5) , -4, 4, + main = "Exponential power distribution density function (p=1.5)", ylab="f(x)") > > > > cleanEx(); ..nameEx <- "estimatep" > > ### * estimatep > > flush(stderr()); flush(stdout()) > > ### Name: estimatep > ### Title: Estimation of p > ### Aliases: estimatep > ### Keywords: univar > > ### ** Examples > > x<-rnormp(300,mu=1,sigmap=2,p=4) > p<-estimatep(x,mu=1,p=2) > p [1] 5.531964 > > > > cleanEx(); ..nameEx <- "graphnp" > > ### * graphnp > > flush(stderr()); flush(stdout()) > > ### Name: graphnp > ### Title: Plot of exponential power distributions > ### Aliases: graphnp > ### Keywords: aplot > > ### ** Examples > > ## Plot four different curves with p=1,2,3,4 > ## and 50 (it will plot an uniform distribution) > graphnp(c(1:4,50)) > > > > cleanEx(); ..nameEx <- "kurtosis" > > ### * kurtosis > > flush(stderr()); flush(stdout()) > > ### Name: kurtosis > ### Title: Indices of kurtosis > ### Aliases: kurtosis > ### Keywords: univar > > ### ** Examples > > kurtosis(p=2) VI B2 Bp 1.253314 3.000000 3.000000 > x<-rnormp(50,mu=0,sigmap=2,p=1.5) > kurtosis(x,p=2) VI B2 Bp 1.281927 3.956532 2.412952 > > > > cleanEx(); ..nameEx <- "lmp" > > ### * lmp > > flush(stderr()); flush(stdout()) > > ### Name: lmp > ### Title: Fitted linear model with exponential power distribution errors > ### Aliases: lmp lmp.default > ### Keywords: regression > > ### ** Examples > > e<-rnormp(n=100,mu=0,sigmap=4,p=3,method="d") > x<-runif(100) > y<-0.5+2*x+e > lmp(y~x) Call: lmp(formula = y ~ x) Coefficients: (Intercept) x 0.6961 1.3703 > > > > cleanEx(); ..nameEx <- "paramp" > > ### * paramp > > flush(stderr()); flush(stdout()) > > ### Name: paramp > ### Title: Estimation of location and scale parameters > ### Aliases: paramp paramp.default print.paramp > ### Keywords: univar > > ### ** Examples > > x<-rnormp(1000,2,3,4.2) > paramp(x) Mean Mp Sd Sp p 1.975826 2.033102 2.478101 3.071740 4.364924 no.conv = FALSE > > > > cleanEx(); ..nameEx <- "plot.lmp" > > ### * plot.lmp > > flush(stderr()); flush(stdout()) > > ### Name: plot.lmp > ### Title: Diagnostic plots for a lmp object > ### Aliases: plot.lmp > ### Keywords: hplot > > ### ** Examples > > x<-1:20 > z<-runif(20) > e<-rnormp(20,mu=0,sigmap=1,p=3) > y<-0.5+x+z+e > lmp.res<-lmp(y~x+z) > plot(lmp.res) Hit to see next plot: Hit to see next plot: Hit to see next plot: > cleanEx(); ..nameEx <- "plot.simul.lmp" > > ### * plot.simul.lmp > > flush(stderr()); flush(stdout()) > > ### Name: plot.simul.lmp > ### Title: Plots of the results of a simulation plan on a linear regression > ### model > ### Aliases: plot.simul.lmp > ### Keywords: hplot > > ### ** Examples > > sim<-simul.lmp(n=10,m=50,q=1,data=1.5,int=0,sigmap=1,p=3.5) > plot(sim) Hit to see next plot: Hit to see next plot: Hit to see next plot: > cleanEx(); ..nameEx <- "plot.simul.mp" > > ### * plot.simul.mp > > flush(stderr()); flush(stdout()) > > ### Name: plot.simul.mp > ### Title: Plots of the results of a simulation plan on the parameters of > ### an exponential power distribution > ### Aliases: plot.simul.mp > ### Keywords: hplot > > ### ** Examples > > ## The histograms of all the computed estimates > a<-simul.mp(100,50,mu=0,sigmap=1,p=3) > plot(a) Hit to see next plot: Hit to see next plot: Hit to see next plot: Hit to see next plot: cleanEx(); ..na> meEx <- "pnormp" > > ### * pnormp > > flush(stderr()); flush(stdout()) > > ### Name: pnormp > ### Title: Probability function of an exponential power distribution > ### Aliases: pnormp > ### Keywords: distribution > > ### ** Examples > > ## Compute the distribution function for a vector x with mu=0, sigmap=1 and p=1.5 > ## At the end we have the graph of the exponential power distribution function with p=1.5. > x <- c(-1, 1) > pr <- pnormp(x, p=1.5) > print(pr) [1] 0.1699012 0.8300988 > plot(function(x) pnormp(x, p=1.5), -4, 4, + main = "Exponential Power Distribution Function (p=1.5)", ylab="F(x)") > > > > cleanEx(); ..nameEx <- "qnormp" > > ### * qnormp > > flush(stderr()); flush(stdout()) > > ### Name: qnormp > ### Title: Quantiles of an exponential power distribution > ### Aliases: qnormp > ### Keywords: distribution > > ### ** Examples > > ## Compute the quantiles for a vector of probabilities x > ## with mu=1, sigmap=2 and p=1.5 > x <- 0.3 > q <- qnormp(x, 1, 2, 1.5) > q [1] -0.0434479 > > > > cleanEx(); ..nameEx <- "qqnormp" > > ### * qqnormp > > flush(stderr()); flush(stdout()) > > ### Name: qqnormp > ### Title: Quantile-Quantile plot for an exponential power distribution > ### Aliases: qqnormp qqnormp.default qqlinep > ### Keywords: hplot > > ### ** Examples > > ## Exponential power distribution Q-Q plot for a sample of 100 observations. > e<-rnormp(100,mu=0,sigmap=1,p=3) > qqnormp(e,p=3) > qqlinep(e,p=3) > > > > cleanEx(); ..nameEx <- "rnormp" > > ### * rnormp > > flush(stderr()); flush(stdout()) > > ### Name: rnormp > ### Title: Pseudo-random numbers from an exponential power distribution > ### Aliases: rnormp > ### Keywords: distribution > > ### ** Examples > > ## Generate a random sample x from an exponential power distribution > ## At the end we have the histogram of x > x <- rnormp(1000, 1, 2, 1.5) > hist(x, main="Histogram of the random sample") > > > > cleanEx(); ..nameEx <- "simul.lmp" > > ### * simul.lmp > > flush(stderr()); flush(stdout()) > > ### Name: simul.lmp > ### Title: Simulation planning for a linear regression model with errors > ### distributed as an exponential power distribution > ### Aliases: simul.lmp > ### Keywords: regression > > ### ** Examples > > ## Simulation of 50 samples of size 10 for a linear regression model with 1 regressor. > simul.lmp(10,50,1,data=1.5,int=1,sigmap=1,p=3,lp=FALSE) (intercept) x1 Sp p Mean 0.8869702 1.664769 0.93954806 3.545009 Variance 0.4414876 1.367305 0.07136779 14.023322 Number of samples with a difficult convergence: 1 > > > > cleanEx(); ..nameEx <- "simul.mp" > > ### * simul.mp > > flush(stderr()); flush(stdout()) > > ### Name: simul.mp > ### Title: Simulation planning for the parameters of an exponential power > ### distribution > ### Aliases: simul.mp print.simul.mp simul.mp.default > ### Keywords: univar > > ### ** Examples > > ## Simulation plan for 100 samples of size 20, with mu=0, sigmap=1, p=3. > simul.mp(20,100,mu=0,sigmap=1,p=3) Mean Mp Sd Sp p Mean -0.001455832 -0.002005936 0.85957678 0.91897954 2.621267 Variance 0.043359067 0.056024484 0.01065886 0.04360268 5.159214 Number of samples with a difficult convergence: 2 > > > > cleanEx(); ..nameEx <- "summary.lmp" > > ### * summary.lmp > > flush(stderr()); flush(stdout()) > > ### Name: summary.lmp > ### Title: Summarize linear model fits with exponential power distribution > ### errors > ### Aliases: summary.lmp print.summary.lmp > ### Keywords: regression > > ### ** Examples > > x<-runif(30) > e<-rnormp(30,0,3,1.25) > y<-0.5+x+e > L<-lmp(y~x) > summary(L) Call: lmp(formula = y ~ x) Residuals: Min 1Q Median 3Q Max -7.0304 -2.3054 -0.2569 2.7494 5.7489 Coefficients: (Intercept) x 0.893 1.001 Estimate of p `2.386026` Power deviation of order p: 3.391 > > > > cleanEx(); ..nameEx <- "summary.simul.lmp" > > ### * summary.simul.lmp > > flush(stderr()); flush(stdout()) > > ### Name: summary.simul.lmp > ### Title: Summarize simulation results on linear regression model > ### Aliases: summary.simul.lmp print.summary.simul.lmp > ### Keywords: regression > > ### ** Examples > > ris<-simul.lmp(100,20,2,data=c(3,2),int=0,sigmap=1,p=3) > summary(ris) Results: (intercept) x1 x2 Sp p Mean 0.01693667 2.94269215 2.044959 0.98760052 3.245725 Variance 0.08861216 0.07691343 0.131576 0.01651496 2.023159 Coefficients: (intercept) x1 x2 0 3 2 Formula: y ~ +x1 + x2 Number of samples: `20` Value of p: `3` Number of samples with problems on convergence `0` > > > > ### *