gof.piqr | R Documentation |
Goodness of Fit of an object of class “piqr
”, usefull to select the best tuning parameter.
gof.piqr(object, method=c("BIC","AIC"), Cn="1", plot=TRUE, df.new=TRUE, logi=TRUE, ...)
object |
an object of class “ |
method |
a method to evaluate the goodness of fit and select the best value of the tuning parameter. |
Cn |
It is some positive constant that diverges to infinity as n increase. It is used by the BIC criterion and if Cn = 1 the classical BIC is used. |
df.new |
if TRUE degrees of freedom are evaluated as the number of
. |
logi |
if TRUE the loss function is log-transformed. |
plot |
if TRUE the chosen method is plotted - default is TRUE. |
... |
additional arguments. |
The best value of lambda is chosen minimizing the criterion, i.e., AIC and BIC.
minLambda |
the best value of lambda. |
dfMinLambda |
the number of nonzero parameters associated to the best lambda. |
betaMin |
the parameters associated to the best lambda. |
posMinLambda |
the position of the best lambda along the sequence of lambda. |
call |
the matched call. |
Gianluca Sottile gianluca.sottile@unipa.it
piqr
, for model fitting; summary.piqr
and plot.piqr
, for summarizing and plotting piqr
objects.
# using simulated data
set.seed(1234)
n <- 300
x1 <- rexp(n)
x2 <- runif(n, 0, 5)
x <- cbind(x1,x2)
b <- function(p){matrix(cbind(1, qnorm(p), slp(p, 2)), nrow=4, byrow=TRUE)}
theta <- matrix(0, nrow=3, ncol=4); theta[, 1] <- 1; theta[1,2] <- 1; theta[2:3,3] <- 2
qy <- function(p, theta, b, x){rowSums(x * t(theta %*% b(p)))}
y <- qy(runif(n), theta, b, cbind(1, x))
s <- matrix(1, nrow=3, ncol=4); s[1,3:4] <- 0
obj <- piqr(y ~ x1 + x2, formula.p = ~ I(qnorm(p)) + slp(p, 2), s=s, nlambda=50)
par(mfrow=c(1,2))
best <- gof.piqr(obj, method="AIC", plot=TRUE)
best2 <- gof.piqr(obj, method="BIC", plot=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.