Приложение 2. Описательная статистика переменных.
Показатель
|
Минимальное значение
|
Максимальное значение
|
Среднее значение
|
Медиана
|
Стандартное отклонение
|
WC/TA
|
-0.540289961
|
0.956020583
|
0.133
|
0.110783308
|
0.317768976
|
RE/TA
|
-0.15304868
|
0.753208819
|
0.086
|
0.015855594
|
0.158578732
|
EBIT/TA
|
-0.107920982
|
0.875787748
|
0.095
|
0.061071431
|
0.156441766
|
Sales/TA
|
0.00094657
|
9.61365051
|
1.422
|
0.733052306
|
1.751437476
|
CA/CL
|
0.309315822
|
25.43485362
|
2.733
|
1.274626522
|
4.884619825
|
NI/Sales
|
-0.741272431
|
1.355504587
|
0.054
|
0.014448383
|
0.246803034
|
PBT/Sales
|
-3.665944455
|
2.617757122
|
0.017
|
0.025302421
|
0.675172512
|
Debt/TA
|
0.0008021
|
0.981407591
|
0.455
|
0.455159563
|
0.242962354
|
Debt*/TA
|
0.011084989
|
10.25322744
|
1.446
|
1.173980389
|
1.556505342
|
EBIT/Total interest payments
|
-6.537960433
|
2468.977838
|
497.597
|
2.04856341
|
861.8487798
|
(Net worth + LT debt)/PPE
|
0.088513122
|
4396.355372
|
152.107
|
2.863812419
|
639.1022154
|
NI/TA
|
-0.128307939
|
0.409569571
|
0.039
|
0.01458566
|
0.081676905
|
CL/TA
|
0.001229531
|
0.998601799
|
0.481
|
0.459843749
|
0.300220347
|
PBT/CL
|
-0.544128933
|
2.252930552
|
0.189
|
0.040775603
|
0.5106134
|
CF1/Debt
|
-34.34423963
|
4.23522586
|
-0.527
|
-0.009251644
|
4.973993219
|
CF2/Debt
|
-724.8654378
|
0.507465393
|
-14.942
|
-0.183581406
|
102.4514558
|
CF3/Debt
|
-1.559511728
|
759.3239631
|
15.491
|
0.21272638
|
107.3424177
|
CF4/Debt
|
0.000264704
|
0.888103897
|
0.096
|
0.027912517
|
0.187287788
|
CF1/Debt*
|
-0.499784015
|
1.382551048
|
0.036
|
-0.003793234
|
0.291328413
|
CF2/Debt*
|
-2.32114775
|
0.320818816
|
-0.198
|
-0.074190337
|
0.40798959
|
CF3/Debt*
|
-0.417858675
|
1.644165162
|
0.169
|
0.096776783
|
0.318598434
|
CF4/Debt*
|
-0.167721024
|
0.138839002
|
0.008
|
0.000797851
|
0.038674642
|
WC/Debt
|
-403.6092166
|
9.959290561
|
-7.852
|
0.276511391
|
57.25465029
|
WC/Debt*
|
-0.87393556
|
1.6908631
|
0.171
|
0.117071465
|
0.400424527
|
Fixed asset turnover
|
0.010505463
|
11464.73394
|
296.378
|
6.138478633
|
1619.275397
|
Sales/Inventory
|
0.009720628
|
3174.616541
|
78.421
|
7.376255684
|
447.5998289
|
Asset turnover
|
0.00094657
|
9.61365051
|
1.422
|
0.733052306
|
1.751437476
|
Debt/EBITDA
|
0.076051238
|
3143.447905
|
482.395
|
6.803779505
|
1106.962775
|
Debt*/EBITDA
|
0.389677206
|
6927.292402
|
1084.064
|
18.1050329
|
2432.040679
|
Cash and equivalence/assets
|
9.35167E-05
|
0.118943228
|
0.018
|
0.006751386
|
0.025923584
|
(Current debt-cash)/Assets
|
0.000782257
|
0.998034378
|
0.462
|
0.456803833
|
0.300228241
|
Current debt/Cash and equivalence
|
1.226823283
|
6520.549407
|
446.535
|
38.04041222
|
1153.053434
|
EBITDA/interest expense
|
-2.055626872
|
2714.211669
|
550.183
|
2.63455678
|
945.7571366
|
Gross cash flow/Debt
|
-0.194379792
|
9.978454946
|
0.597
|
0.055544218
|
1.774924794
|
Gross cash flow/Debt*
|
-0.071690063
|
1.6129583
|
0.124
|
0.021072375
|
0.291146765
|
Inventories/TA
|
0.000211513
|
0.834394904
|
0.189
|
0.093614243
|
0.209378998
|
EBIT/Revenue
|
-4.84242663
|
18.47664172
|
0.415
|
0.049815306
|
2.781593544
|
Operating profit/Revenue
|
-3.792200118
|
0.543956905
|
-0.072
|
0.048603209
|
0.750961275
|
Volume of issue/Assets
|
0.005478147
|
384.6090238
|
8.624
|
0.746399571
|
54.27521763
|
Coupon1
|
0
|
1
|
0.180
|
0
|
0.388087934
|
Coupon2
|
0
|
18
|
11.676
|
11.775
|
2.872418451
|
Coupon3
|
0
|
4
|
2.440
|
2
|
0.929340341
|
Repayment period
|
1
|
1006
|
24.740
|
1
|
143.9224295
|
Приложение 3. Алгоритмы MATLAB.
-
Алгоритм для расчета коэффициентов логита:
function beta = logit (X, y, lambda)
k = size (X, 2);
options = optimset ('GradObj', 'on', 'Display', 'off');
beta = fminunc (@(beta) costFunction (X, y, lambda, beta), zeros (k, 1), options);
end
function [cost, grad] = costFunction (X, y, lambda, beta)
EPS = 1e-60;
m = size(X, 1);
cost = (-y'*log(EPS + Sigmoid(X*beta)) - (ones(size(y))-y)'*log(ones(size(y))-Sigmoid(X*beta) + EPS) + lambda/2 * (beta'*beta - beta(1)*beta(1))) / m;
grad = (((Sigmoid(X*beta) - y)'*X)' + lambda*beta) / m;
grad(1) = ((Sigmoid(X*beta) - y)'*ones(size(y))) / m;
end
function s = Sigmoid (X)
s = 1 ./ (1 + exp(-X));
end
-
Алгоритм для расчета ожидаемого значения у при рассчитанных коэффициентах логита:
function [y_predicted] = logitPredict(X, beta)
y_predicted = Sigmoid (X * beta);
end
function s = Sigmoid (X)
s = 1 ./ (1 + exp(-X));
end
-
Алгоритм для применения метода скользящего контроля:
function [y_predicted] = leaveOneOut (X, y, lambda)
n = size(X, 1); % observations
m = size(X, 2); % variables
y_predicted = zeros(n, 1);
for obsNum = 1 : n
X_ = [X(1 : obsNum-1, :); X(obsNum+1 : n, :)];
y_ = [y(1 : obsNum-1); y(obsNum+1 : n)];
beta_ = logit (X_, y_, lambda);
y_hat = logitPredict (X, beta_);
y_predicted(obsNum) = y_hat(obsNum);
disp(sprintf('%d/%d observations evaluated...', obsNum, n));
end
end
-
Алгоритм для построения кривой ошибок и вычисления площади под кривой ошибок:
function [AUC] = getROC(y_real, y_predicted)
[y_predicted, I] = sort (y_predicted);
y_real = y_real(I);
x = [0];
y = [0];
n = length(y_real);
total_positives = sum(y_real);
total_negatives = n - total_positives;
truePositives = 0;
for i = n : -1 : 1
if y_real(i) == 1
truePositives = truePositives + 1;
end
FPR = (n - i + 1 - truePositives) / total_negatives;
TPR = truePositives / total_positives;
x = [x, FPR];
y = [y, TPR];
end
AUC = 0;
for i = 2 : length(x)
AUC = AUC + (y(i) + y(i-1)) / 2 * (x(i) - x(i-1));
end
x_ = [0, 1];
y_ = [0, 1];
plot (x, y, x_, y_);
title(sprintf('AUC = %.3f', AUC));
xlabel('FPR');
ylabel('TPR');
legend ('Предсказание модели', 'Случайное предсказание', 'Location', 'SouthEast');
end
-
Алгоритм для построения графика зависимости площади под кривой ошибок от параметра регуляризации:
function runLogit1(fileName, lambda)
% Format of the input file:
% N - number of variables in the first line
% Each of the next lines (to the end) contains
% observations - N dependent variables first and
% independent variable (y) then
fin = fopen (fileName, 'rt');
m = fscanf (fin, '%d', 1);
V = fscanf (fin, '%g');
D = reshape(V, m+1, length(V) / (m+1))';
n = size(D, 1);
X = [ones(n, 1), D(:, 1:m)];
y = D(:, m+1);
u = [0];
v = [0];
for i = 1 : length(y)
if y(i) ~= 0 & y(i) ~= 1
disp('y''s are not 0 or 1. Check the input file.');
exit(0);
end
end
disp(sprintf('%d observations found in %s.', n, fileName));
for j = 1 : size(lambda, 2)
beta = logit (X, y, lambda(j));
y_pred = leaveOneOut (X, y, lambda(j));
disp (sprintf('AUC = %.3f', getROC1(y, y_pred)));
u = [u, lambda(j)];
v = [v, getROC1(y, y_pred)];
end
plot (u, v, 0.4, 1);
title(sprintf('Зависимость AUC от параметра регуляризации'));
xlabel('Параметр регуляризации');
ylabel('AUC');
end
-
Алгоритм вывода кривой ошибок и площади под кривой ошибок, а также для расчета коэффициентов логита для заданного массива данных:
function runLogit(fileName, lambda)
% Format of the input file:
% N - number of variables in the first line
% Each of the next lines (to the end) contains
% observations - N dependent variables first and
% independent variable (y) then
fin = fopen (fileName, 'rt');
m = fscanf (fin, '%d', 1);
V = fscanf (fin, '%g');
D = reshape(V, m+1, length(V) / (m+1))';
n = size(D, 1);
X = [ones(n, 1), D(:, 1:m)];
y = D(:, m+1);
for i = 1 : length(y)
if y(i) ~= 0 & y(i) ~= 1
disp('y''s are not 0 or 1. Check the input file.');
exit(0);
end
end
disp(sprintf('%d observations found in %s.', n, fileName));
disp('Running logit...');
beta = logit (X, y, lambda);
disp (sprintf('AUC = %.3f', getROC(y, logitPredict(X, beta))));
disp (beta);
key = input('Do you want to run cross-validation [y|n]? ', 's');
if key == 'y'
disp('Running cross-validation with leave-one-out approach...');
y_pred = leaveOneOut (X, y, lambda);
disp (sprintf('AUC = %.3f', getROC(y, y_pred)));
end
end
Приложение 4. Графики распределения показателей.
RE/TA
PBT/CL
CF4/Debt
CF1/Debt*
CF2/Debt*
Gross cash flow/Debt*
Coupon2
Достарыңызбен бөлісу: |