This is a static copy of a profile report

Home

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

Home

mytauchen_n (Calls: 1, Time: 0.017 s)
Generated 03-May-2020 16:34:11 using performance time.
function in file /Users/sidhantkhanna/Documents/GitHub/BKS modified/code/mytauchen_n.m
Copy to new window for comparing multiple runs

Parents (calling functions)
No parent
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
92
profile off;
10.014 s82.5%
71
mt_Pi(j,k) = cdf_normal((ar_n(...
20.000 s1.8%
86
disp ('-----------------------...
10.000 s1.8%
73
mt_Pi(j,k) = 1 - cdf_normal((a...
20.000 s1.0%
85
fprintf (2, 'Labor Productivit...
10.000 s0.9%
All other lines  0.002 s12.0%
Totals  0.017 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
mytauchen_n>cdf_normalsubfunction40.000 s1.0%
Self time (built-ins, overhead, etc.)  0.017 s99.0%
Totals  0.017 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).
94Use of brackets [] is unnecessary. Use parentheses to group, if needed.
Coverage results
Show coverage for parent directory
Total lines in function64
Non-code lines (comments, blank lines)18
Code lines (lines that can run)46
Code lines that did run33
Code lines that did not run13
Coverage (did run/can run)71.74 %
Function listing
time 
Calls 
 line
  32 
function [ar_n, mt_Pi] = mytauchen_n(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 

  41 
        [fl_mu_n, fl_rho_n, fl_sig_n, it_ngridno, fl_lambda_n]      = varargin{:} 
  42 
        bl_display_param = false;
  43 

< 0.001 
      1 
  44
    else 
< 0.001 
      1 
  45
         fl_mu_n            = 0; 
< 0.001 
      1 
  46
         fl_rho_n           = 0.1; 
< 0.001 
      1 
  47
         fl_sig_n           = 0.2; 
< 0.001 
      1 
  48
         it_ngridno         = 2; 
< 0.001 
      1 
  49
         fl_lambda_n        = 3;  
< 0.001 
      1 
  50
         bl_display_param = true; 
  51 

< 0.001 
      1 
  52
    end 
  53 

< 0.001 
      1 
  54
ar_n       = zeros(it_ngridno,1); 
< 0.001 
      1 
  55
mt_Pi      = zeros(it_ngridno,it_ngridno); 
< 0.001 
      1 
  56
ar_n(1)    = fl_mu_n/(1-fl_rho_n) - fl_lambda_n*sqrt(fl_sig_n^2/(1-fl_rho_n^2)); 
< 0.001 
      1 
  57
ar_n(it_ngridno)    = fl_mu_n/(1-fl_rho_n) + fl_lambda_n*sqrt(fl_sig_n^2/(1-fl_rho_n^2)); 
< 0.001 
      1 
  58
step    = (ar_n(it_ngridno)-ar_n(1))/(it_ngridno-1); 
  59 

  60 
%% Constructing Labor productivity array
  61 

< 0.001 
      1 
  62
for i=2:(it_ngridno-1) 
  63 
   ar_n(i) = ar_n(i-1) + step; 
  64 
end
  65 

  66 
%% Constructing Labor productivity transition matrix
  67 

< 0.001 
      1 
  68
for j = 1:it_ngridno 
< 0.001 
      2 
  69
    for k = 1:it_ngridno 
< 0.001 
      4 
  70
        if k == 1 
< 0.001 
      2 
  71
            mt_Pi(j,k) = cdf_normal((ar_n(1) - fl_mu_n - fl_rho_n*ar_n(j) + step/2) / fl_sig_n); 
< 0.001 
      2 
  72
        elseif k == it_ngridno 
< 0.001 
      2 
  73
            mt_Pi(j,k) = 1 - cdf_normal((ar_n(it_ngridno) - fl_mu_n - fl_rho_n*ar_n(j) - step/2) / fl_sig_n); 
  74 
        else
  75 
            mt_Pi(j,k) = cdf_normal((ar_n(k) - fl_mu_n - fl_rho_n*ar_n(j) + step/2) / fl_sig_n) - ...
  76 
                      cdf_normal((ar_n(k) - fl_mu_n - fl_rho_n*ar_n(j) - step/2) / fl_sig_n);
< 0.001 
      2 
  77
        end 
< 0.001 
      4 
  78
    end 
< 0.001 
      2 
  79
end 
  80 

  81 
 %% Displaying labor productivity array and transition matrix
  82 

  83 

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

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