Skip to content
Snippets Groups Projects
Select Git revision
  • b241abc87e9e6102ba4a7ccd4854a19a327e5edc
  • master default protected
  • 6.x protected
  • madysson
  • 5.x protected
  • asm
  • time-varying-information-set
  • 4.6 protected
  • dynare_minreal
  • dragonfly
  • various_fixes
  • 4.5 protected
  • clang+openmp
  • exo_steady_state
  • declare_vars_in_model_block
  • julia
  • error_msg_undeclared_model_vars
  • static_aux_vars
  • slice
  • aux_func
  • penalty
  • 6.4 protected
  • 6.3 protected
  • 6.2 protected
  • 6.1 protected
  • 6.0 protected
  • 6-beta2 protected
  • 6-beta1 protected
  • 5.5 protected
  • 5.4 protected
  • 5.3 protected
  • 5.2 protected
  • 5.1 protected
  • 5.0 protected
  • 5.0-rc1 protected
  • 4.7-beta3 protected
  • 4.7-beta2 protected
  • 4.7-beta1 protected
  • 4.6.4 protected
  • 4.6.3 protected
  • 4.6.2 protected
41 results

forcst.m

Blame
  • forcst.m 1.22 KiB
    function [yf,int_width]=forcst(dr,y0,k,var_list)
      global M_  oo_ options_ 
      
      make_ex_;
      yf = simult_(y0,dr,zeros(k,M_.exo_nbr),1);
      nstatic = dr.nstatic;
      npred = dr.npred;
      nc = size(dr.ghx,2);
      endo_nbr = M_.endo_nbr;
      inv_order_var = dr.inv_order_var;
      [A,B] = kalman_transition_matrix(dr,nstatic+(1:npred),1:nc,dr.transition_auxiliary_variables);
      
      nvar = size(var_list,1);
      if nvar == 0
        nvar = M_.endo_nbr;
        ivar = [1:nvar];
      else
        ivar=zeros(nvar,1);
        for i=1:nvar
          i_tmp = strmatch(var_list(i,:),M_.endo_names,'exact');
          if isempty(i_tmp)
    	disp(var_list(i,:));
    	error (['One of the variable specified does not exist']) ;
          else
    	ivar(i) = i_tmp;
          end
        end
      end
    
      ghx1 = dr.ghx(inv_order_var(ivar),:);
      ghu1 = dr.ghu(inv_order_var(ivar),:);
    
      sigma_u = B*M_.Sigma_e*B';
      sigma_u1 = ghu1*M_.Sigma_e*ghu1';
      sigma_y = 0;
      
      for i=1:k
        sigma_y1 = ghx1*sigma_y*ghx1'+sigma_u1;
        var_yf(i,:) = diag(sigma_y1)';
        if i == k
          break
        end
        sigma_u = A*sigma_u*A';
        sigma_y = sigma_y+sigma_u;
      end
    
      fact = qnorm((1-options_.conf_sig)/2,0,1);
      
      int_width = zeros(k,M_.endo_nbr);
      for i=1:nvar
        int_width(:,i) = fact*sqrt(var_yf(:,i));
      end
    
      yf = yf(ivar,:);