伊藤忠商事(8001)の適正PERを、競合の売上、純利益との相関から、linear regressionで計算したいと思います。
まず、データセット。
銘柄名,売上,純利益,PER ※単位:10億円
丸紅:8002,7100,155, 6.79%
三菱商事:8058, 6400,440, 9.73%
三井物産:8031, 4300, 306,7.63%
双日:2768, 1500, 40, 7.76%
伊藤忠商事:8001, 4800, 352, ?(実際は7.7%)
<?php
require_once 'vendor/autoload.php';
use Phpml\Regression\LeastSquares;
$samples = [[7100, 155],
[6400, 440],
[4300,306],
[1500, 40],
];
$targets = [6.79,
9.73,
7.63,
7.76];
$regression = new LeastSquares();
$regression->train($samples, $targets);
echo $regression->predict([4800, 352]);
?>

8.8ぐらいあってもいいと言ってますね。実際は、本日時点で7.7%なので、割安ということです。。
なにこれ?