Integrate(), Interpolate() und SplineEval()
Kombinieren Sie Integrate mit Interpolate oder SplineEval, um die Fläche unter der Kurve zu ermitteln.
@sseligman schrieb Verwenden von JMP zum Ermitteln der Fläche unter einer Kurve ; Hier finden Sie weitere Informationen zu einigen integrierten Funktionen.
Die Funktion „Interpolieren“ verwendet eine sortierte Liste von X-Koordinaten und eine entsprechende Liste von Y-Koordinaten und beantwortet die Frage „Wenn X 42 wäre, was wäre Y?“ unter Verwendung einer linearen Interpolation zwischen den nächsten zwei X-Koordinaten in der sortierten Liste. Durch die lineare Interpolation werden gerade Liniensegmente mit Datenpunkten an den Ecken der Kurve erzeugt.
Die SplineEval-Funktion macht das Gleiche (mit Hilfe der Spline Coef-Funktion) mithilfe einer Spline-Interpolation. Ein Spline ist ein flexibler, federnder Metalldraht, der je nach Steifigkeit nahe an den Datenpunkten vorbeiführt. Normalerweise fallen Datenpunkte nicht auf die Spline-Kurve.
Beide Funktionen erzeugen alle Datenpunkte in einer Kurve vom ersten X bis zum letzten X.
Die Integrate-Funktion beantwortet eine andere Frage: „Wie viel Fläche liegt unter dieser Kurve in diesem Bereich?“ Interpolate hat vier Argumente; Die ersten beiden beschreiben eine f(x)-Funktion, die eine Kurve generiert, und die letzten beiden beschreiben einen Bereich von x-Werten. Das Ergebnis von Integrate( f(x), x, low, high ) ist die Fläche unter der Kurve, wenn x von niedrig nach hoch geht. Die ersten beiden Variablen scheinen x zu wiederholen, da f(x) ein Ausdruck wie a+2*b sein könnte und die zweite Variable angibt, ob a oder b die Variable zwischen niedrig und hoch ist.
In der JSL für diesen Beitrag geht es um die Verwendung von Interpolate oder SplineEval als f(x)-Wert von Interpolate.Es erstellt ein interaktives Diagramm, um zu verstehen, wie das Finden der Fläche unter einer durch einige verrauschte Datenpunkte definierten Kurve mit linearer oder Spline-Interpolation funktionieren könnte. Außerdem wird die genaue Antwort (rot) angezeigt, bevor das Rauschen (schwarze Datenpunkte) zu den Daten hinzugefügt wurde. Die blaue Kurve ist die Spline-Anpassung an die schwarzen Datenpunkte. Das Balkendiagramm in der Mitte zeigt die drei Flächenberechnungen nebeneinander; Nur der mittlere blaue Balken bewegt sich, wenn sich die Spline-Spannung ändert. Mit den richtigen Zufallsdaten kann jeder Balken höher oder kürzer sein als die anderen.
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 makes a graph like this; the lambda slider changes the blue spline's tension.JSL erstellt ein Diagramm wie dieses; Der Lambda-Schieberegler ändert die Spannung des blauen Splines.
JMP 16 erforderlich...für jeden...
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>

Kombinieren Sie Integrate mit Interpolate oder SplineEval, um die Fläche unter der Kurve zu ermitteln.
Betreff: Integrate(), Interpolate() und SplineEval()Danke! Ich habe herausgefunden, dass sogar ein zufälliges 99x99-Quadrat eine sichtbare geflieste Kante erzeugt, wenn ich danach gesucht habe. Bei 299x299 sehe ich es nicht mehr.
Ganz am Ende habe ich fillpattern() ohne Argumente hinzugefügt, in der Hoffnung, dass dadurch das Muster gelöscht wird. Es sieht so aus. Ohne sie werden die runden Datenpunkte gefüllt, was ich wirklich nicht erwartet hatte. Bei spärlichen Kreuzschraffurmustern wurden die Datenpunkte meist nicht angezeigt. Ich denke, es ist eine Funktion.
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 markersBig filled diamond and filled circle markersBig filled diamond and filled circle markersGroße gefüllte Rauten- und gefüllte Kreismarkierungen
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>Betreff: Integrate(), Interpolate() und SplineEval()
Fill Pattern()
Hübsch!
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 );
)
)
);

Betreff: Integrate(), Interpolate() und SplineEval()Neue Version mit nur einem einzigen Muster und einem Schieberegler zum Anpassen der Mustergröße.
Hinweis: Eine einfache Möglichkeit, ständig neue Versionen des Musters neu zu generieren: Ändern Sie die Größe des Fensters 
Interessant:
Das Raster des Diagrammfelds scheint im „Live“-Modus gerade noch sichtbar zu sein – als statisches Raster im Gegensatz zum zufälligen Rauschen der sich ändernden Muster.
Wenn ich den Bildschirm einfriere (nicht die Größe des Fensters verändere), „verschwindet“ das Raster.
Für dich auch?

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) ) );
);
)
);