Learn R Programming

pguIMP (version 0.0.0.3)

pgu.normDist: pgu.normDist

Description

Compares the distribution of a single attribute's values to normal distribution by using several statistic tests.

Arguments

Format

R6::R6Class object.

Active bindings

featureName

Returns the instance variable featureName. (character)

rawData

Returns the instance variable rawData. (tibble::tibble)

setRawData

Sets the instance variable rawData. (tibble::tibble)

histogram

Returns the instance variable histogram. (tibble::tibble)

expMu

Returns the instance variable expMu. (numeric)

expSigma

Returns the instance variable expSigma. (numeric)

dataPoints

Returns the instance variable dataPoints. (numeric)

logLikelihood

Returns the instance variable logLikelihood. (numeric)

degOfFreedom

Returns the instance variable degOfFreedom. (numeric)

n

Returns the instance variable n. (integer)

bic

Returns the instance variable bic. (numeric)

aic

Returns the instance variable aic. (numeric)

aicc

Returns the instance variable aicc. (numeric)

rmse

Returns the instance variable rmse. (numeric)

fitSuccess

Returns the instance variable fitSuccess. (logical)

testNames

Returns the instance variable testNames. (character)

testParameterNames

Returns the instance variable testParameterNames. (character)

alpha

Returns the instance variable alpha. (numeric)

w.shapiro

Returns the instance variable w.shapiro. (numeric)

p.shapiro

Returns the instance variable p.shapiro. (numeric)

d.kolmogorow

Returns the instance variable d.kolmogorow. (numeric)

p.kolmogorow

Returns the instance variable p.kolmogorow. (numeric)

a.anderson

Returns the instance variable a.anderson. (numeric)

p.anderson

Returns the instance variable p.anderson. (numeric)

Methods

Public methods

Method new()

Creates and returns a new pgu.normDist object.

Usage

pgu.normDist$new(data = "tbl_df")

Arguments

data

The data to be analyzed. (tibble::tibble)

Returns

A new pgu.normDist object. (pguIMP::pgu.normDist)

Method finalize()

Clears the heap and indicates that instance of pgu.normDist is removed from heap.

Usage

pgu.normDist$finalize()

Method print()

Prints instance variables of a pgu.normDist object.

Usage

pgu.normDist$print()

Returns

string

Method resetNormDist()

Resets instance variables

Usage

pgu.normDist$resetNormDist(data = "tbl_df")

Arguments

data

Dataframe to be analyzed. (tibble::tibble)

Method resetFail()

Resets instance variables in case of a failed analysis.

Usage

pgu.normDist$resetFail()

Method optimize()

Optimizes the logLikelihood between the data and a normal distribution with respect to the expectation value and standard deviation. The quality of the best model ist calculated subsequently.

Usage

pgu.normDist$optimize()

Method createHistogram()

Creates a histogram from the instance variable rawData. The histogram is stored in the instance variable histogram.

Usage

pgu.normDist$createHistogram()

Method normalQQData()

Performes a qq-analysis of the instance variable rawData The qq-analysis is stored in the attributes sample_quantile and theoretical_quantile of the instance variable rawData.

Usage

pgu.normDist$normalQQData()

Method test.shapiro()

Performes Shapiro-Wilk's test for normality on the instance variable rawData. The test result is stored in the instance variable w.shapiro. The p-value of the test is stored in the instance variable p.shapiro

Usage

pgu.normDist$test.shapiro()

Method test.kolmogorow()

Performes Kolmogorow-Smirnow's test for normality on the instance variable rawData. The test result is stored in the instance variable d.kolmogorow. The p-value of the test is stored in the instance variable p.kolmogorow

Usage

pgu.normDist$test.kolmogorow()

Method test.anderson()

Performes Anderson-Darling's test for normality on the instance variable rawData. The test result is stored in the instance variable a.anderson. The p-value of the test is stored in the instance variable p.anderson

Usage

pgu.normDist$test.anderson()

Method fitResult()

Returns the result of the classes optimize function in form of a formated string.

Usage

pgu.normDist$fitResult()

Returns

String of the results of the fitting routine (character)

Method testResult()

Returns the result of the classes test functions in form of a formated string.

Usage

pgu.normDist$testResult(testName = "Shapiro-Wilk")

Arguments

testName

Defines the test which result shall be returned. Can be of type:Shapiro-Wilk, Kolmogorow-Smirnow or Anderson-Darling. (character)

Returns

String of the results of the testing routine (character)

Method testResultCompendium()

Returns the result of the classes test functions Shapiro-Wilk, Kolmogorow-Smirnow and Anderson-Darling in form of a formated string. (character)

Usage

pgu.normDist$testResultCompendium()

Returns

String of the results of the testing routine (character)

Method plotHistogram()

Displays the instance variable histogram in form of a bar plot and overlays the corresponding normal distribution.

Usage

pgu.normDist$plotHistogram()

Returns

A bar plot. (ggplot2::ggplot)

Method plotResiduals()

Displays the residuals between the instance variable histogram and the corresponding normal distribution.

Usage

pgu.normDist$plotResiduals()

Returns

A scatter plot. (ggplot2::ggplot)

Method plotResidualDist()

Displays the distribution of the residuals between the distribution of the instance variable histogram in form of a histogram.

Usage

pgu.normDist$plotResidualDist()

Returns

A bar plot. (ggplot2::ggplot)

Method plotRawResidualDist()

Displays the distribution of the residuals between the distribution of the instance variable rawData in form of a histogram.

Usage

pgu.normDist$plotRawResidualDist()

Returns

A bar plot. (ggplot2::ggplot)

Method plotRawDataDist()

Displays the distribution of the instance variable rawData in form of a histogram.

Usage

pgu.normDist$plotRawDataDist()

Returns

A bar plot. (ggplot2::ggplot)

Method normalQQPlot()

Displays a qqplot of the instance variable rawData.

Usage

pgu.normDist$normalQQPlot()

Returns

A qq-plot. (ggplot2::ggplot)

Method fit()

Runs the optimization process and performs all implemented quality controls. Additionally performs hypothesis tests for nromality.

Usage

pgu.normDist$fit()

Method clone()

The objects of this class are cloneable with this method.

Usage

pgu.normDist$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

The distribution of a single value is tested for normality by Shapiro-Wilk test, Kolmogorov-Smirnov test, Anderson-Darling test. The expectation value and standard deviation of a normal distribution representing the data are determined by maximizing the log Likelihood with respect to the expectation value and standard deviation. This object is used by the shiny based gui and is not for use in individual R-scripts!