This is a static copy of a profile report

Home

Function details for mytauchen_zThis is a static copy of a profile report

Home

mytauchen_z (Calls: 1, Time: 0.009 s)
Generated 28-Jun-2020 22:32:33 using performance time.
function in file /Users/sidhantkhanna/Documents/GitHub/BKS modified/code/mytauchen_z.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
hhsave_VFI_2OCfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
35
close all;
10.002 s21.5%
58
mt_Pi      = zeros(it_zgridno,...
10.001 s10.0%
74
mt_Pi(j,k) = cdf_normal((ar_z(...
100.001 s9.2%
44
[fl_mu_z, fl_rho_z, fl_sig_z, ...
10.001 s6.7%
78
mt_Pi(j,k) = cdf_normal((ar_z(...
800.001 s5.9%
All other lines  0.004 s46.7%
Totals  0.009 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
closefunction10.002 s18.8%
mytauchen_z>cdf_normalsubfunction1800.001 s11.4%
Self time (built-ins, overhead, etc.)  0.007 s69.8%
Totals  0.009 s100% 
Code Analyzer results
Line numberMessage
38This statement (and possibly following ones) cannot be reached.
42IF might not be aligned with its matching END (line 55).
96This statement (and possibly following ones) cannot be reached.
98Use of brackets [] is unnecessary. Use parentheses to group, if needed.
Coverage results
Show coverage for parent directory
Total lines in function69
Non-code lines (comments, blank lines)18
Code lines (lines that can run)51
Code lines that did run29
Code lines that did not run22
Coverage (did run/can run)56.86 %
Function listing
time 
Calls 
 line
  32 
function [ar_z, mt_Pi] = mytauchen_z(varargin)
  33 

  34 
%% Function default parameters setting
  0.002 
      1 
  35
close all; 
< 0.001 
      1 
  36
bl_profile = false;      % Switch off profile if running a tester/calling from another function 
< 0.001 
      1 
  37
if(bl_profile) 
  38 
profile off;
  39 
profile on;
  40 
end
  41 

< 0.001 
      1 
  42
if ~isempty(varargin) 
  43 

< 0.001 
      1 
  44
        [fl_mu_z, fl_rho_z, fl_sig_z, it_zgridno, fl_lambda_z]      = varargin{:}; 
< 0.001 
      1 
  45
         bl_display_param = false; 
  46 

  47 
    else
  48 
         fl_mu_z            = 0;
  49 
         fl_rho_z           = 0.9;
  50 
         fl_sig_z           = 0.2;
  51 
         it_zgridno         = 10;
  52 
         fl_lambda_z        = 3; 
  53 
         bl_display_param = true;
  54 

< 0.001 
      1 
  55
    end 
  56 

< 0.001 
      1 
  57
ar_z       = zeros(it_zgridno,1); 
< 0.001 
      1 
  58
mt_Pi      = zeros(it_zgridno,it_zgridno); 
< 0.001 
      1 
  59
ar_z(1)    = fl_mu_z/(1-fl_rho_z) - fl_lambda_z*sqrt(fl_sig_z^2/(1-fl_rho_z^2)); 
< 0.001 
      1 
  60
ar_z(it_zgridno)    = fl_mu_z/(1-fl_rho_z) + fl_lambda_z*sqrt(fl_sig_z^2/(1-fl_rho_z^2)); 
< 0.001 
      1 
  61
step    = (ar_z(it_zgridno)-ar_z(1))/(it_zgridno-1); 
  62 

  63 
%% Constructing entrepreneurial productivity array
  64 

< 0.001 
      1 
  65
for i=2:(it_zgridno-1) 
< 0.001 
      8 
  66
   ar_z(i) = ar_z(i-1) + step;  
< 0.001 
      8 
  67
end 
  68 

  69 
%% Constructing transition matrix
  70 

< 0.001 
      1 
  71
for j = 1:it_zgridno 
< 0.001 
     10 
  72
    for k = 1:it_zgridno 
< 0.001 
    100 
  73
        if k == 1 
< 0.001 
     10 
  74
            mt_Pi(j,k) = cdf_normal((ar_z(1) - fl_mu_z - fl_rho_z*ar_z(j) + step/2) / fl_sig_z); 
< 0.001 
     90 
  75
        elseif k == it_zgridno 
< 0.001 
     10 
  76
            mt_Pi(j,k) = 1 - cdf_normal((ar_z(it_zgridno) - fl_mu_z - fl_rho_z*ar_z(j) - step/2) / fl_sig_z); 
< 0.001 
     80 
  77
        else 
  0.001 
     80 
  78
            mt_Pi(j,k) = cdf_normal((ar_z(k) - fl_mu_z - fl_rho_z*ar_z(j) + step/2) / fl_sig_z) - ... 
     80 
  79
                      cdf_normal((ar_z(k) - fl_mu_z - fl_rho_z*ar_z(j) - step/2) / fl_sig_z); 
< 0.001 
     90 
  80
        end 
< 0.001 
    100 
  81
    end 
< 0.001 
     10 
  82
end 
  83 

  84 
 %% Displaying entreprenurial productivity array and transition matrix
  85 

< 0.001 
      1 
  86
if (bl_display_param == true) 
  87 
        fprintf (2, 'log entrepreneurial Productivity array  \n');   
  88 
        disp ('----------------------------------');
  89 
        disp (ar_z');
  90 
        fprintf (2, 'Transition Matrix \n');    
  91 
        disp ('------------------');
  92 
        disp (mt_Pi);
  93 
end  
  94 

< 0.001 
      1 
  95
if(bl_profile) 
  96 
profile off;
  97 
profile viewer;
  98 
st_file_name = ['/Users/sidhantkhanna/Documents/GitHub/BKS modified/code/Profile/mytauchen_z_profile'];
  99 
profsave(profile('info'), st_file_name);
 100 
end

Other subfunctions in this file are not included in this listing.