Description Usage Arguments Details Value Author(s) See Also Examples
This function plots coefficient build-ups for GLMs that can be estimated with lqa
.
1 2 3 4 |
x |
the augmented design matrix. It must contain a column of ones if an intercept is included in the model. |
y |
the vector of observed responses. |
family |
a description of the error distribution and link function to
be used in the model. This can be a character string naming a
family function, a family function or the result of a call to
a family function. (See |
penalty.family |
a function argument identifying the penalty family. See examples below. |
intercept |
a logical object whether the model should include an intercept (this is recommended) or not. The default value is TRUE. |
standardize |
a logical object, whether the regressors should be standardized (this is recommended) or not. The default value is TRUE. |
lambdaseq |
a sequence of tuning parameter candidates for the dimension you want to plot. |
offset.values |
a vector of the same dimension as your tuning parameter. At the position of the dimension you want to plot there must be entry ‘NA’.
The other positions should be filled with given (and fixed) tuning parameter values, as e.g. returned from |
show.standardized |
logical. If ‘TRUE’ the standardized coefficients are plotted, otherwise the unstandardized coefficients are plotted. |
add.MLE |
logical. If ‘TRUE’ the unrestricted MLE is also plotted. Note this only works for ‘n > p’ settings. Otherwise this argument is set to ‘FALSE’ automatically. |
control |
list of control parameters as returned by |
plot.type |
determines the line type. |
ret.true |
logical. If ‘TRUE’ then |
really.plot |
logical. If ‘FALSE’ then |
... |
further arguments. |
This function plots coefficient build-ups for a given dimension of your tuning parameter(s). The argument lambdaseq
can be omitted.
In this case a default sequence lambdaseq <- exp (seq (-10, 6, length = 60)
is used.
If your penalty consists of more than one tuning parameter you must identify the relevant dimension to plot
using offset.values
where you state the fixed values for the other tuning parameters.
See examples below for further details.
This returns a plot
object, if really.plot = TRUE
, or ret.obj
, if really.plot = FALSE
.
Jan Ulbricht
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | set.seed (434534)
family <- binomial ()
nobs <- 50
nvars <- 5
beta.true <- c (1, 2, 0, 0, -1)
intercept <- TRUE
standardize <- TRUE
x <- matrix (rnorm (nvars * nobs), ncol = nvars)
x[,2] <- x[,1] + rnorm (nobs, sd = 0.1)
x[,3] <- x[,1] + rnorm (nobs, sd = 0.2)
eta.true <- drop (x %*% beta.true)
mu.true <- family$linkinv (eta.true)
vec1 <- 1 : nobs
y <- sapply (mu.true, function (vec1) {rbinom (1, 1, vec1)})
pdf ("fusedlasso_lambda1.pdf", width = 6, height = 6)
# here lambda1 'lambda1' is getting varied:
plot.lqa (y = y, x = x, family = binomial (), penalty.family = fused.lasso,
offset.values = c (NA, 0.2), add.MLE = FALSE, really.plot = TRUE)
dev.off ()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.