Showing 3 of 7 files from the diff.

@@ -50,6 +50,9 @@
Loading
50 50
#' predict(fit, s = 0.45) # predicted response for a single lambda value
51 51
#' predict(fit, s = c(2.15, 0.32, 0.40), type="nonzero") # nonzero coefficients
52 52
#' @seealso \code{\link{predict.cv.sail}}
53 +
#' @note When the coef method is called, the alpha values, which represent the
54 +
#'   interaction term are returned. This alpha is the product of beta_e,gamma_j
55 +
#'   and theta_j
53 56
#' @rdname predict.sail
54 57
#' @export
55 58
predict.sail <- function(object, newx, newe, s = NULL,

@@ -60,7 +60,7 @@
Loading
60 60
  # this is used for the predict function
61 61
  design <- expansion$design
62 62
63 -
  nulldev <- as.numeric(crossprod(y - mean(y)))
63 +
  nulldev <- as.numeric(crossprod(sqrt(weights)*(y - mean(y))))
64 64
65 65
  # Initialize -------------------------------------------------------------
66 66
  # the initial values here dont matter, since at Lambda_max everything is 0
@@ -430,7 +430,7 @@
Loading
430 430
      if (abs(environ[lambdaIndex]) > 0) "E"
431 431
    )
432 432
433 -
    deviance <- crossprod(R.star)
433 +
    deviance <- crossprod(sqrt(weights)*R.star)
434 434
    devRatio <- 1 - deviance / nulldev
435 435
    dfbeta <- sum(abs(betaMat[, lambdaIndex]) > 0) / ifelse(expand, ncols, 1)
436 436
    dfalpha <- sum(abs(alphaMat[, lambdaIndex]) > 0) / ifelse(expand, ncols, 1)

@@ -59,7 +59,7 @@
Loading
59 59
  # this is used for the predict function
60 60
  design <- expansion$design
61 61
62 -
  nulldev <- as.numeric(crossprod(y - mean(y)))
62 +
  nulldev <- as.numeric(crossprod(sqrt(weights)*(y-mean(y))))
63 63
64 64
  # Initialize -------------------------------------------------------------
65 65
  # the initial values here dont matter, since at Lambda_max everything is 0
@@ -253,9 +253,6 @@
Loading
253 253
      #
254 254
      # R.star <- R.star + Delta
255 255
256 -
257 -
258 -
259 256
      # converged_theta <- FALSE
260 257
      # k <- 1
261 258
      # while (!converged_theta && k < maxit){
@@ -269,7 +266,7 @@
Loading
269 266
              gglasso = coef(gglasso::gglasso(
270 267
                x = x_tilde_2[[j]],
271 268
                y = R,
272 -
                weights=weights,
269 +
                weight=diag(weights),
273 270
                # eps = 1e-12,
274 271
                maxit = 100000,
275 272
                group = if (expand) rep(1, ncols) else rep(1, ncols[j]),
@@ -315,8 +312,9 @@
Loading
315 312
            gglasso = coef(gglasso::gglasso(
316 313
              x = x_tilde_2[[j]],
317 314
              y = R,
315 +
318 316
              # eps = 1e-12,
319 -
              weights=weights,
317 +
              weight=diag(weights),
320 318
              group = if (expand) rep(1, ncols) else rep(1, ncols[j]),
321 319
              pf = wj[j],
322 320
              lambda = LAMBDA * (1 - alpha),
@@ -448,7 +446,7 @@
Loading
448 446
      if (abs(environ[lambdaIndex]) > 0) "E"
449 447
    )
450 448
451 -
    deviance <- crossprod(R.star)
449 +
    deviance <- crossprod(sqrt(weights)*R.star)
452 450
    devRatio <- 1 - deviance / nulldev
453 451
    dfbeta <- sum(abs(betaMat[, lambdaIndex]) > 0) / ifelse(expand, ncols, 1)
454 452
    dfalpha <- sum(abs(alphaMat[, lambdaIndex]) > 0) / ifelse(expand, ncols, 1)
Files Coverage
R 53.53%
Project Totals (11 files) 53.53%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
    patch:
10
      default:
11
        target: auto
12
        threshold: 1%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading