goodness.of.fit: Goodness of fit for the general GMCM

Description Usage Arguments Value Examples

View source: R/goodness.of.fit.R

Description

Compute goodness of fit as described in AIC. The number of parameters used correspond to the number of variables free to vary in the general model.

Usage

1
goodness.of.fit(theta, u, method = c("AIC", "BIC"), k = 2)

Arguments

theta

A list of parameters as defined in rtheta. For t this function, it will usually be the output of fit.full.GMCM.

u

An n by d matrix of marginally uniform observations. Rows corresponds to observations and columns to the dimensions of the variables. I.e. these are often ranked and scaled test statistics or other observations.

method

A character of length 1 which specifies the goodness of fit to compute. Default is "AIC". "BIC" is also a option.

k

A integer specifying the default used constant "k" in AIC. See AIC.

Value

A single number giving the goodness of fit as requested.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
set.seed(2)
data(u133VsExon)
u <- Uhat(u133VsExon[sample(19577, 500), ])  # Subset for faster fitting
theta1 <- fit.full.GMCM(u, m = 2, method = "L-BFGS")
goodness.of.fit(theta1, u)  # AIC
goodness.of.fit(theta1, u, method = "BIC")
## Not run: 
theta2 <- fit.full.GMCM(u, m = 3, method = "L-BFGS")
goodness.of.fit(theta2, u)
goodness.of.fit(theta2, u, method = "BIC")

## End(Not run)

GMCM documentation built on Nov. 6, 2019, 1:08 a.m.