ppcc: The Probability Plot Correlation Coefficients Plot

Description Usage Arguments Examples

Description

ppcc() takes a vector of data x and finds correlation coefficients between x and a guessed distribution for several different shape values. The function ppcc() returns a plot of the correlation coefficients against the shape parameters and return the highest correlation and the best estimated shape parameter. The supported distributions are: Weibull, Normal, Log-Normal, Poisson and Exponential.

Usage

1
ppcc(x, distribution = "weibull", minshape = 1, maxshape = 10, steps1 = 30, steps2 = 30, plots = FALSE, brks = 70, bandw = "nrd0", returncor = FALSE))

Arguments

x

The datavector to be analyzed.

distribution

The guessed distribution. Supported distributions are: Weibull, Normal, Log-Normal, Poisson and Exponential. Default is set so Weibull.

minshape

The minimum shape value to use. Default set to 1.

maxhsape

Tha maximum shape value to use. Default set to 10.

steps1

The total number of correlation coefficients to calculate between minshape and maxshape. steps1 is not used in the Weibull case if the shape parameter is smaller than 1. Default set to 30.

steps2

The same as steps1, but steps2 is only used in the Weibull case if the shape parameter is smaller than 1. Default set to 30.

plots

If set to TRUE; returns a histogram with the estimated density and the true density for the best estimated shape parameter. Default is set to FALSE.

brks

The number of breaks in the histogram, which is returned when plots is set to TRUE. Default is set to 70.

bandw

The smoothing bandwidth which R uses when estimating the density of x. Important: use the \itemppcc() function more than once with plots = TRUE and find the best bandwidth, if the results are very unusual. Default is set to "nrd0".

returncor

If set to TRUE, hte ppcc() function returns a matrix with the used shape parameters and the corresponding correlation coefficients. Deafult is set to FALSE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Simulate a Weibull distributed dataset:
x = rweibull(1000, 2)
# Use the ppcc() function to find the best shape parameter:
ppcc(x)

# Simulate a Poisson distributed dataset:
x = rpois(1000, 3)
# Use th ppcc() function to estimate the best lambda:
ppcc(x, distribution = "poisson")
# Get a histogram with the estimated density and the true density for the best estimated lambda:
ppcc(x, distribution = "poisson", plots = TRUE)

AUMath-AdvancedR2018/StatEngPlots documentation built on May 23, 2019, 6:01 p.m.