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.010 s)
Generated 01-May-2020 21:57:04 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
91
profile off;
10.004 s46.0%
76
cdf_normal((ar_z(k) - fl_mu_z ...
240.001 s8.5%
71
mt_Pi(j,k) = cdf_normal((ar_z(...
60.001 s6.8%
73
mt_Pi(j,k) = 1 - cdf_normal((a...
60.001 s5.8%
78
end
360.001 s5.2%
All other lines  0.003 s27.8%
Totals  0.010 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
mytauchen_z>cdf_normalsubfunction600.001 s7.5%
Self time (built-ins, overhead, etc.)  0.009 s92.5%
Totals  0.010 s100% 
Code Analyzer results
Line numberMessage
39IF might not be aligned with its matching END (line 52).
41Terminate statement with semicolon to suppress output (in functions).
93Use of brackets [] is unnecessary. Use parentheses to group, if needed.
Coverage results
Show coverage for parent directory
Total lines in function63
Non-code lines (comments, blank lines)17
Code lines (lines that can run)46
Code lines that did run26
Code lines that did not run20
Coverage (did run/can run)56.52 %
Function listing
time 
Calls 
 line
  32 
function [ar_z, mt_Pi] = mytauchen_z(varargin)
  33 

  34 
%% Function default parameters setting
  35 
close all;
  36 
profile off;
  37 
profile on;
  38 

< 0.001 
      1 
  39
if ~isempty(varargin) 
  40 

< 0.001 
      1 
  41
        [fl_mu_z, fl_rho_z, fl_sig_z, it_zgridno, fl_lambda_z]      = varargin{:}  
< 0.001 
      1 
  42
         bl_display_param = false; 
  43 

  44 
    else
  45 
         fl_mu_z            = 0;
  46 
         fl_rho_z           = 0.9;
  47 
         fl_sig_z           = 0.2;
  48 
         it_zgridno       = 10;
  49 
         fl_lambda_z        = 3; 
  50 
         bl_display_param = true;
  51 

< 0.001 
      1 
  52
    end 
  53 

< 0.001 
      1 
  54
ar_z       = zeros(it_zgridno,1); 
< 0.001 
      1 
  55
mt_Pi      = zeros(it_zgridno,it_zgridno); 
< 0.001 
      1 
  56
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 
  57
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 
  58
step    = (ar_z(it_zgridno)-ar_z(1))/(it_zgridno-1); 
  59 

  60 
%% Constructing entrepreneurial productivity array
  61 

< 0.001 
      1 
  62
for i=2:(it_zgridno-1) 
< 0.001 
      4 
  63
   ar_z(i) = ar_z(i-1) + step;  
< 0.001 
      4 
  64
end 
  65 

  66 
%% Constructing transition matrix
  67 

< 0.001 
      1 
  68
for j = 1:it_zgridno 
< 0.001 
      6 
  69
    for k = 1:it_zgridno 
< 0.001 
     36 
  70
        if k == 1 
< 0.001 
      6 
  71
            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 
     30 
  72
        elseif k == it_zgridno 
< 0.001 
      6 
  73
            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 
     24 
  74
        else 
  0.001 
     24 
  75
            mt_Pi(j,k) = cdf_normal((ar_z(k) - fl_mu_z - fl_rho_z*ar_z(j) + step/2) / fl_sig_z) - ... 
     24 
  76
                      cdf_normal((ar_z(k) - fl_mu_z - fl_rho_z*ar_z(j) - step/2) / fl_sig_z); 
< 0.001 
     30 
  77
        end 
< 0.001 
     36 
  78
    end 
< 0.001 
      6 
  79
end 
  80 

  81 
 %% Displaying entreprenurial productivity array and transition matrix
  82 

< 0.001 
      1 
  83
if (bl_display_param == true) 
  84 
        fprintf (2, 'log entrepreneurial Productivity array  \n');   
  85 
        disp ('----------------------------------');
  86 
        disp (ar_z');
  87 
        fprintf (2, 'Transition Matrix \n');    
  88 
        disp ('------------------');
  89 
        disp (mt_Pi);
  90 
end  
  0.004 
      1 
  91
profile off; 
  92 
profile viewer;
  93 
st_file_name = ['/Users/sidhantkhanna/Documents/GitHub/BKS modified/code/Profile/mytauchen_z_profile'];
  94 
profsave(profile('info'), st_file_name);

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