GF: Perform a Goodness of Fit test for a fitted copula model.

Description Usage Arguments Value Examples

View source: R/GF.r

Description

Resamples from the fitted model (parametric bootstrap) and calculates the loss with respect to this model. Compares the loss of the resamples with the observed data.

Usage

1
GF(model, size = 10000, fitLoss = "modelLoss")

Arguments

model

a correlation object as returned by the function PC.

size

the number of resamples from the fitted model.

fitLoss

the loss function used to calculate the loss of the observed and resampled data with respect to the model. Should be one of "modelLoss", "MH" or "SS". Defaults to "modelLoss", which means the same loss function is used as was used to fit the model.

Value

model

A copy of the model argument

fitLossValue

The loss value for the observed data with respect to the model

fitLossDist

A vector with fitLoss values for the resampled data with respect to the model

p

The p value for the model fit; i.e. the proportion of resamples with a higher loss than the observed data

Examples

1
2
3
4
5
6
7
8
#load contingency table
 data(table4);

#fit a copula correlation
 myOC <- PC(table4,"gauss","MH");
 
#perform goodness of fit:
 GF(myOC,fitLoss="SS");

jeroenooms/JJcorr documentation built on May 19, 2019, 6:10 a.m.