R/set_getClpindepX_amp.R

setMethod("getClpindepX", signature(model = "amp"), function(model,
                                                             multimodel, theta, returnX, rawtheta, dind) {
  if (returnX) {
    theta <- getThetaCl(rawtheta, multimodel)[[dind]]
  }
  x <- matrix(0,
    nrow = length(theta@amps[[1]]),
    ncol = length(theta@amps[[1]])
  )
  diag(x) <- theta@amps[[1]]
  for (i in 2:length(theta@amps)) {
    xn <- matrix(0,
      nrow = length(theta@amps[[i]]),
      ncol = length(theta@amps[[i]])
    )
    diag(xn) <- theta@amps[[i]]
    x <- rbind(x, xn)
  }
  if (returnX) {
    x <- as.vector(x)
  }
  x
})

Try the TIMP package in your browser

Any scripts or data that you put into this service are public.

TIMP documentation built on Dec. 28, 2022, 3:06 a.m.