predict | R Documentation |
Predict using the fitted model from MGLMreg
when given a new set of covariates.
## S4 method for signature 'MGLMreg' predict(object, newdata)
object |
model object. |
newdata |
new covariates data matrix. |
Outputs the probabilities of each category.
This helps answer questions such as whether certain features increase the probability of observing category j.
n <- 200 p <- 5 d <- 4 X <- matrix(runif(p * n), n, p) alpha <- matrix(c(0.6, 0.8, 1), p, d - 1, byrow=TRUE) alpha[c(1, 2),] <- 0 Alpha <- exp(X %*% alpha) beta <- matrix(c(1.2, 1, 0.6), p, d - 1, byrow=TRUE) beta[c(1, 2),] <- 0 Beta <- exp(X %*% beta) m <- runif(n, min=0, max=25) + 25 Y <- rgdirmn(n, m, Alpha, Beta) gdmReg <- MGLMreg(Y~0+X, dist="GDM") newX <- matrix(runif(1*p), 1, p) pred <- predict(gdmReg, newX)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.