Description Usage Arguments Details Value Author(s) References Examples

Similar to other predict methods, this function computes predicted values and prediction errors from a mgm model-object (`mgm`

, `mvar`

, `tvmgm`

or `tvmvar`

).

1 2 |

`object` |
An mgm model object, i.e. the output of the functions |

`data` |
A n x p data matrix with the same structure (number of variables p and types of variables) as the data used to fit the model. |

`errorCon` |
Either a character vector specifying the types of nodewise error that should be computed, where the two provided error functions for continuous varaibles are Alternatively, |

`errorCat` |
Either a character vector specifying the types of nodewise error that should be computed, where the two provided error functions for categorical varaibles are Alternatively, |

`tvMethod` |
The type of error calculated for time-varying models: |

`consec` |
A integer vector of length |

`...` |
Additional arguments. |

In the case of time-varying model nodewise errors can be computed in two different ways.

First, one computes the predicted value for each of the N cases in the time series for all models (estimated at different estimation points, see `?tvmgm`

or `?tvmvar`

). Then the error of each of the N cases for each of the models is weighted by the weight that has been used to estimate a given model at its estimation point. This means that the error of a case in the end of a time-series gets a high weight for models estimated in the end of the time-series and a low weight for models estimated in the beginning of the time series.

Second, we determine for each case in the time-series the closest estmation point, and use the model estimated at that estimation point to make predictions for that case.

Note that the error function normalized accuracy (nCC) is negative, if the full model performs worse than the intercept model. This can happen if the model overfits the data.

A list with the following entries:

`call` |
Contains all provided input arguments. |

`predicted` |
A n x p matrix with predicted values, matching the dimension of the true values in |

`probabilities` |
A list with p entries corresponding to p nodes in the data. If a variable is categorical, the corresponding entry contains a n x k matrix with predicted probabilities, where k is the number of categories of the categorical variable. If a variable is continuous, the corresponding entry is empty. |

`true` |
Contains the true values. For |

`errors` |
A matrix containing the all types of errors specified via |

`tverrors` |
If |

Jonas Haslbeck <[email protected]>

Haslbeck, J., & Waldorp, L. J. (2016). mgm: Structure Estimation for time-varying Mixed Graphical Models in high-dimensional Data. arXiv preprint arXiv:1510.06871.

Haslbeck, J., & Waldorp, L. J. (2015). Structure estimation for mixed graphical models in high-dimensional data. arXiv preprint arXiv:1510.05677.

1 2 3 4 5 6 7 | ```
## Not run:
# See examples in ?mgm, ?tvmgm, ?mvar and ?tvmvar.
## 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.