Plots the fit of the model

        Parameters
        ----------
        intervals : Boolean
            Whether to plot 95% confidence interval of states

        Returns
        ----------
        None (plots data and the fit)

def plot_fit(self, intervals=True, **kwargs):
        """ Plots the fit of the model

        Parameters
        ----------
        intervals : Boolean
            Whether to plot 95% confidence interval of states

        Returns
        ----------
        None (plots data and the fit)
        """
        import matplotlib.pyplot as plt
        import seaborn as sns

        figsize = kwargs.get('figsize',(10,7))

        if self.latent_variables.estimated is False:
            raise Exception("No latent variables estimated!")
        else:
            date_index = copy.deepcopy(self.index)
            date_index = date_index[:self.y.shape[0]+1]

            mu = self.states
            var = self.states_var
            # Create smoothed/filtered aggregate series
            _, Z, _, _ = self._ss_matrices(self.latent_variables.get_z_values())
            smoothed_series = np.zeros(self.y.shape[0])

            for t in range(0,self.y.shape[0]):
                smoothed_series[t] = np.dot(Z[t],mu[:,t])

            plt.figure(figsize=figsize) 
            
            plt.subplot(self.state_no+1, 1, 1)
            plt.title(self.y_name + " Raw and Smoothed")    
            plt.plot(date_index,self.data,label='Data')
            plt.plot(date_index,self.link(smoothed_series),label='Smoothed Series',c='black')
            plt.legend(loc=2)
            
            for coef in range(0,self.state_no):
                V_coef = self.states_var[coef]
                plt.subplot(self.state_no+1, 1, 2+coef)
                plt.title("Beta " + self.X_names[coef]) 
                states_upper_95 = self.states[coef] + 1.98*np.sqrt(V_coef)
                states_lower_95 = self.states[coef] - 1.98*np.sqrt(V_coef)

                if intervals == True:
                    alpha =[0.15*i/float(100) for i in range(50,12,-2)]
                    plt.fill_between(date_index, states_lower_95, states_upper_95, alpha=0.15,label='95% C.I.') 

                plt.plot(date_index,mu[coef,:],label='Coefficient')
                plt.legend(loc=2)               
            
            plt.show()