Description Usage Arguments Details Value Examples

View source: R/forecasting_gq.R

Extracts the model-predicted means, variances, and correlations for the fitted data.

1 2 3 4 5 6 7 8 9 |

`object` |
bmgarch object. |

`CrI` |
Numeric vector (Default: |

`digits` |
Integer (Default: 2, optional). Number of digits to round to when printing. |

`weights` |
Takes weights from model_weight function. Defaults to 1 – this parameter is not typically set by user. |

`inc_samples` |
Logical (Default: FALSE). Whether to return the MCMC samples for the fitted values. |

`...` |
Not used. |

Whereas `forecast.bmgarch`

computes the *forecasted* values for future time periods, `fitted.bmgarch`

computes the *backcasted* (model-predicted) values for the observed time periods.

fitted.bmgarch object. List containing `meta`

data and the `backcast`

. Backcast is a list containing three elements:

- mean
`[N, 7, TS]`

array of mean backcasts, where N is the timeseries length, and TS is the number of time series. E.g.,`bc$backcast$mean[3,,"tsA"]`

is the mean backcast for the third observation in time series "tsA".- var
`[N, 7, TS]`

array of variance backcasts, where N is the timeseries length, and TS is the number of time series. E.g.,`bc$backcast$var[3,,"tsA"]`

is the variance backcast for the third observation in time series "tsA".- cor
`[N, 7, TS(TS - 1)/2]`

array of correlation backcasts, where N is the timeseries length, and`TS(TS - 1)/2`

is the number of correlations. E.g.,`bc$backcast$cor[3,, "tsB_tsA"]`

is the backcast for the correlation between "tsB" and "tsA" on the third observation. Lower triangular correlations are saved.- samples
List

. If inc_samples is `TRUE`

, then a list of arrays of MCMC samples for means, vars, and cors. Each array is [Iteration, Period, ..., ...].

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
## Not run:
data(panas)
# Fit CCC(1,1) and constant meanstructure.
fit <- bmgarch(panas, parameterization = "CCC", meanstructure = "constant")
# Obtain fitted values
fit.bc <- fitted(fit)
# Print fitted values
print(fit.bc)
# Plot fitted values (plot.bmgarch calls fitted internally)
plot(fit, type = "var")
# Save fitted values as data frame
fit.bc.df <- as.data.frame(fit.bc)
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.