
デビッドKについて尋ねた楕円を描くデータポイントの周り。 私はしばらく前にこれに苦労しました. ここにある間違いはすべて私のものです。コメントと修正を歓迎します。この図は、スクリプトの最後に生成された Bivariate からの出力です。 スクリプトの目的は、緑色の楕円を描画するためのパラメーターを計算することです。 このスクリプトは、JMP の組み込み関数 Correlation、Mean、StdDev、Eigen を使用して作業を行います。 特に Eigen は、楕円を表すパラメータを返します。 これらのパラメータは 2D 3x3 変換行列に変換され、0,0 を中心とする単位円上の点を目的の楕円に変換するために使用されます。
x = Open( "$sample_data\big class.jmp" );
H = x:height << get values; // column vectors
W = x:weight << get values;
data = H || W; // 2 columns by 40 rows
corr = Correlation( data );
mean = Mean( H ) || Mean( W );
stddev = Std Dev( H ) || Std Dev( W );
cov = Diag( stddev ) * corr * Diag( stddev );
{D, E} = Eigen( cov );
// sort columns of E. Don't know why; it controls which ellipse axis goes with the bigger vector, I think.
// you can see the gap in the ellipse change position if you use [1,2] (or just comment the next 3 lines)
jj = [2,1];
E = E[ 0, jj ];
D = D[ jj ];
// there seems to be a lot of opinions on how to do the confidence limit...
NormalContour = sqrt(ChiSquare Quantile( 0.95, 2 ));
T = NormalContour * E * Diag( Sqrt( D ) );
m = (T` |/ mean) || [0, 0, 1]; // transform matrix
unitCircle = J(100,3); // 2x2 transform uses 3x3 matrix for homogeneous coords
For( i = 1, i <= 100, i++,
unitCircle[i, 1] = Sin( (i - 1) * 2 * Pi() / 100 ); // divide by 99 to close the gap
unitCircle[i, 2] = Cos( (i - 1) * 2 * Pi() / 100 );
unitCircle[i, 3] = 1;
);
ellipse = unitCircle * m; // draw the ellipse as a unit circle transformed by m
New Window( "Ellipse from Eigen Values and Vectors",
Graph Box(xscale(50,75),yscale(40,180),
Marker( Marker State( 12 ), H, W ),
line( ellipse[0,1], ellipse[0,2])
)
);
// for comparison...
x<<BIVARIATE></BIVARIATE>

これが「手動で」描かれた楕円です。 変換行列 m は、データ ポイントを単位円に変換するために (逆行列と共に) 使用することもできます。 0,0 からの距離は、楕円内の点では 1 未満になります。 Bivariate は、楕円の内側または外側の点の選択を含め、すべての作業を既に行っていることに注意してください。

JMP の Scene3D で変換行列を使用する場合、変換行列に対する Scene3D の期待に一致させるために、「m」を転置する必要がある場合があります。
2017年9月30日編集:フォーマットの修復