# predict.vinereg: Predict conditional mean and quantiles from a D-vine... In vinereg: D-Vine Quantile Regression

## Description

Predict conditional mean and quantiles from a D-vine regression model

## Usage

 ```1 2 3 4 5``` ```## S3 method for class 'vinereg' predict(object, newdata, alpha = 0.5, cores = 1, ...) ## S3 method for class 'vinereg' fitted(object, alpha = 0.5, ...) ```

## Arguments

 `object` an object of class `vinereg`. `newdata` matrix of covariate values for which to predict the quantile. `alpha` vector of quantile levels; `NA` predicts the mean based on an average of the `1:10 / 11`-quantiles. `cores` integer; the number of cores to use for computations. `...` unused.

## Value

A data.frame of quantiles where each column corresponds to one value of `alpha`.

`vinereg`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21``` ```# simulate data x <- matrix(rnorm(200), 100, 2) y <- x %*% c(1, -2) dat <- data.frame(y = y, x = x, z = as.factor(rbinom(100, 2, 0.5))) # fit vine regression model (fit <- vinereg(y ~ ., dat)) # inspect model summary(fit) plot_effects(fit) # model predictions mu_hat <- predict(fit, newdata = dat, alpha = NA) # mean med_hat <- predict(fit, newdata = dat, alpha = 0.5) # median # observed vs predicted plot(cbind(y, mu_hat)) ## fixed variable order (no selection) (fit <- vinereg(y ~ ., dat, order = c("x.2", "x.1", "z.1"))) ```

### Example output

```D-vine regression model: y | x.2, x.1
nobs = 100, edf = 2, cll = 82.91, caic = -161.82, cbic = -156.61
var edf        cll      caic      cbic      p_value
1   y   0 -218.26300  436.5260  436.5260           NA
2 x.2   1   83.39339 -164.7868 -162.1816 3.723935e-38
3 x.1   1  217.78132 -433.5626 -430.9575 1.000452e-96
`geom_smooth()` using method = 'loess' and formula 'y ~ x'
D-vine regression model: y | x.2, x.1, z.1
nobs = 100, edf = 2, cll = 82.91, caic = -161.82, cbic = -156.61
```

vinereg documentation built on Nov. 24, 2021, 1:08 a.m.