This function takes a fitted mvgam object and returns plots and summary statistics for the latent dynamic factors
plot_mvgam_factors(object, plot =TRUE)
Arguments
object: list object returned from mvgam. See mvgam()
plot: logical specifying whether factors should be plotted
Returns
A data.frame of factor contributions and, optionally, a ggplot object
Details
If the model in object was estimated using dynamic factors, it is possible that not all factors contributed to the estimated trends. This is due to the regularisation penalty that acts independently on each factor's Gaussian precision, which will squeeze un-needed factors to a white noise process (effectively dropping that factor from the model). In this function, each factor is tested against a null hypothesis of white noise by calculating the sum of the factor's 2nd derivatives. A factor that has a larger contribution will have a larger sum due to the weaker penalty on the factor's precision. If plot == TRUE, the factors are also plotted.