Integrate()、Interpolate()、および SplineEval()
Integrate と Interpolate または SplineEval を組み合わせて、曲線の下の領域を取得します。
@セリグマン書きましたJMP を使用して曲線の下の領域を見つける;ここでは、いくつかの組み込み関数についてもう少し詳しく説明します。
Interpolate 関数は、並べ替えられた X 座標のリストと、対応する Y 座標のリストを使用して、「X が 42 だったら、Y は何になるでしょうか?」という質問に答えます。ソートされたリスト内の最も近い 2 つの X 座標間の線形補間を使用します。 線形補間では、曲線のコーナーにデータ ポイントを持つ直線セグメントが生成されます。
SplineEval 関数は、スプライン補間を使用して同じことを (Spline Coef 関数の助けを借りて) 実行します。 スプラインは、硬さに応じてデータ ポイントの近くを通過する柔軟で弾力のある金属ワイヤです。 通常、データ点はスプライン曲線上にありません。
これらの関数は両方とも、最初の X から最後の X までの曲線内のすべてのデータ ポイントを生成します。
Integrate 関数は、「この範囲内でこの曲線の下にある面積はどれくらいですか?」という別の質問に答えます。 Interpolate には 4 つの引数があります。最初の 2 つは曲線を生成する af(x) 関数を記述し、最後の 2 つは x 値の範囲を記述します。 Integrate( f(x), x, low, high ) の結果は、x が低値から高値に変化するときの曲線の下の面積です。 f(x) は a+2*b のような式であり、2 番目の変数は a または b が低値と高値の間の変数であるかどうかを示すため、最初の 2 つの変数は x を繰り返しているように見えます。
この投稿の JSL は、Interpolate または SplineEval を Interpolate の f(x) 値として使用することについてです。インタラクティブなグラフを構築して、ノイズの多いデータ ポイントによって定義される曲線の下の領域を見つけることが、線形補間またはスプライン補間でどのように機能するかを理解するのに役立ちます。 また、ノイズ (黒のデータ ポイント) がデータに追加される前の正確な答え (赤) も表示されます。 青い曲線は、黒いデータ ポイントに適合したスプラインです。 中央の棒グラフは、3 つの面積計算を並べて示しています。スプライン張力が変化すると、中央の青いバーのみが移動します。 適切なランダム データを使用すると、どのバーも他のバーよりも高くしたり、短くしたりすることができます。
JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL makes a graph like this; the lambda slider changes the blue spline's tension.JSL は次のようなグラフを作成します。ラムダ スライダーは青いスプラインの張力を変更します。
JMP 16 が必要です...それぞれに...
New Window( "Integrate Area Under Curve",
// make a function, in the window: namespace, that returns a sine wave
window:f = Function( {t},
50 + Sin( t / 10 ) * 40
);
// create the x dimension of the graph
window:xmin = 20; // integrate over this range
window:xmax = 80;
window:xcoarse = window:xmin :: window:xmax :: 4; // the coarse data is used to make random data from sin function
window:xfine = window:xmin :: window:xmax :: 0.125; // the fine data is used for outlining smooth polygons
// create the y dimension of the graph from x and function f(x) and some randomness
window:random = 10; // random variation, slider below
// this function called here, and from slider below
window:generatedata = Function( {}, // regenerate the points with new random error
window:ycoarse = window:f( window:xcoarse ) + J( 1, N Col( window:xcoarse ), Random Normal( 0, window:random ) );
// ycoarse is the y data for the points; limit it to stay on the y axis...
window:ycoarse[Loc( window:ycoarse > 99 )] = 99;
window:ycoarse[Loc( window:ycoarse < 1 )] = 1;
);
window:generatedata(); // prepare the initial data in the graph
// lambda is the tension on the spline interpolation, slider below
window:loglambda = 2;// spline tension, a nice middle value
// random patterns for filled areas. the exponents are artistically adjusted for blending the colors
// with gray drawn first, and dark, and yellow drawn last, medium, and blue between, but light.
// there are 7 overlaps with different shades.
window:patternsize = 299; // big square patch for a pattern
window:pat01 = J( window:patternsize, window:patternsize, (Random Integer( 0, 255 ) / 255) ^ 0.5 );//gray
window:pat02 = J( window:patternsize, window:patternsize, (Random Integer( 0, 255 ) / 255) ^ 3 );//blue
window:pat03 = J( window:patternsize, window:patternsize, (Random Integer( 0, 255 ) / 255) ^ 2 );//yellow
window:bar01 = 38;
window:bar02 = 44;// bar x-locations, in graph coordinates; they look good here, for this sine wave
window:bar03 = 50;
window:show = [1 1 1];
window:barwide = 5;
window:barbottom = 50;// bottom of chopped off bar
window:bartop = window:barbottom + 5;
// map values of the AUC onto the graph
window:aucMin = 1500;
window:aucMax = 4000;
window:aucToGraph = Function( {y}, // convert auc to graph Y to make bar heights; 0 is for a label
Interpolate( y, 0, window:barbottom - window:bartop, window:aucMin, 7, window:aucMax, 97 - window:bartop )
);
// draw a broken bar; x in graph units, y in auc units
window:drawAucBar = Function( {x, y},
y = window:aucToGraph( y );
Polygon(// ragged edge bottom poly below the break
x || x || x + .1 * window:barwide || x + .3 * window:barwide || x + .5 * window:barwide || x + .8 * window:barwide || x + window:barwide
|| x + window:barwide,
window:barbottom || window:barbottom + 5 || window:barbottom + 6 || window:barbottom + 4 || window:barbottom + 7 || window:barbottom + 3
|| window:barbottom + 5 || window:barbottom
);
If( y >= 0, // the bar is below the break, don't draw
Polygon(
x || x || x + .1 * window:barwide || x + .3 * window:barwide || x + .5 * window:barwide || x + .8 * window:barwide || x + window
:barwide || x + window:barwide,
window:bartop + y || window:bartop + 5 || window:bartop + 6 || window:bartop + 4 || window:bartop + 7 || window:bartop + 3 || window
:bartop + 5 || window:bartop + y
)
);
);
// make the GUI
window:g = Graph Box(
// this script runs when the graph needs to reshow, either the first time, or because a slider script uses <<RESHOW framesize=""></RESHOW>

Integrate と Interpolate または SplineEval を組み合わせて、曲線の下の領域を取得します。
Re: Integrate()、Interpolate()、SplineEval()ありがとう! 探していると、99x99 のランダムな正方形でも、目に見えるタイル状のエッジが生成されることがわかりました。 299x299ではもう見えません。
最後に、パターンがクリアされることを期待して、引数なしで fillpattern() を追加しました。 そうのようです。 これがないと、丸いデータ ポイントが埋まってしまいますが、これはまったく予想していませんでした。 まばらなクロスハッチ パターンでは、データ ポイントはほとんど表示されませんでした。 それは特徴だと思います。
Big filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersBig filled diamond and filled circle markers大きな塗りつぶされたひし形と塗りつぶされた円のマーカー
p = J( 128, 128, . );
Parallel Assign( {}, p[r( -20, 20 ), c( -20, 20 )] = (Sin( r ) * Sin( c ) + 1) / 2 );
New Window( "bumps",
Graph Box(
<<MARKER size=""></MARKER>Re: Integrate()、Interpolate()、SplineEval()
Fill Pattern()
良い!
New Window( "window",
Graph Box(
framesize( 1000, 900 ),
Y Scale( 0, 900 ),
X Scale( 0, 1000 ),
for (i=1,i<=89,i++,
pattSize = i;
pen color(black);
pen size (2);
y1 = floor(i/10)*100;
x1 = mod(i,10)*100;
Rect( mod(i,10)*100, (floor(i/10))*100+i, (mod(i,10))*100+i, floor(i/10)*100);
Fill Color( "dark blue" );
Fill Pattern( J( pattsize, pattsize, (Random Integer( 0, 255 ) / 255) ) );
Rect( mod(i,10)*100, (floor(i/10)+1)*100-10, (mod(i,10)+1)*100-10, floor(i/10)*100, 1 );
)
)
);

Re: Integrate()、Interpolate()、SplineEval()単一のパターンとパターン サイズを調整するためのスライダー バーのみを備えた新しいバージョン。
注意: パターンの新しいバージョンを継続的に再生成する簡単な方法: ウィンドウのサイズを変更します:)
面白い:
グラフ ボックスのグリッドは、「ライブ」モードで、変化するパターンのランダム ノイズに対する静的なグリッドとして表示されるだけのようです。
画面をフリーズすると(ウィンドウのサイズを変更しない)、グリッドのようなものが「消えます」。
あなたにとっても?

Names default to here(1);
New Window( "window",
V List Box(
window:i = 1;
Slider Box( 1,300, window:i, window:gb << reshow ),
window:gb = Graph Box(
framesize( 600, 600 ),
Y Scale( 0, 600 ),
X Scale( 0, 600 ),
window:pattSize = i;
Fill Color( "dark blue" );
mat= J( window:pattsize, window:pattsize, (Random Integer( 0, 255 ) / 255) );
//mat=J( pattsize, pattsize, 0 );
Fill Pattern( mat );
Rect( 0, 600, 600, 300, 1 );
mat[0,window:pattsize]=J(window:pattsize,1,1);
mat[window:pattsize,0]=J(1,window:pattsize,1);
Fill Pattern( mat );
Rect( 0, 300, 600, 0, 1 );
Text Size( 50 );
Text( {270, 270}, Char(floor(i) ) );
);
)
);