여보세요,
저는 일련의 다른 장치와 신호 응답 응답을 시간의 함수로 플로팅하고 있습니다. 플롯이 값(예: 3100)을 넘으면 각 부드러운 플롯에서 시간 값을 가져오고 싶습니다. 산포 데이터는 이것이 발생하는 시간을 얻기에는 너무 조잡하지만 각 장치에 대한 부드러운 적합 뒤에 기능이 있는 경우 이 정보를 사용할 수 있어야 합니다.
이것이 가능한지 그리고 가능하다면 어떻게 해야 하는지 아는 사람이 있습니까?
JMP는 다음 기능을 제공합니다. 스플라인 계수() 그리고 스플라인 평가() .당신이 사용할 수있는 스플라인 계수() 스플라인 매개변수를 가져온 다음 원하는 지점에서 해당 스플라인을 평가합니다.이것을 Newtons의 방법과 함께 사용하여 각 스플라인이 특정 값(예: 3100)을 교차하는 시기를 결정할 수 있습니다.
스플라인 람다가 일반적으로 예상하는 것과 일치할 수 있도록 이 전에 x-데이터(0 평균, std-dev = 1)를 정규화하려고 할 것이라는 점에 주의하십시오.
다음은 당신이 요구하는 바를 수행한다고 생각되는 방금 함께 던진 예입니다.
Names Default to Here( 1 );
determine crossover = Function( {table, value, spline lambda, x col, y col, group, precision = 0.1},
{Default Local},
spline number = 64;
max runs = 10;
rows = table << Get Rows Where( Excluded( Row State() ) == 0 );
groups = Associative Array( Column( table, group )[rows] ) << Get Keys;
curves = [=>];
For( i = 1, i <= N Items( groups ), i++,
item = groups[i];
Eval( Parse( Eval Insert( JSL Quote(
rows = table << Get Rows Where( Excluded( Row State() ) == 0 & :Name("^group^") == "^item^" )
) ) ) );
curves[item] = [=>];
curves[item]["rows"] = rows;
curves[item]["abcissa"] = Column( table, x col )[rows];
curves[item]["ordinate"] = Column( table, y col )[rows];
curves[item]["abcissa mean"] = Mean( curves[item]["abcissa"] );
curves[item]["abcissa stddev"] = Std Dev( curves[item]["abcissa"] );
If( curves[item]["abcissa stddev"] == 0, curves[item]["abcissa"] = 1 );
curves[item]["abcissa"] = (curves[item]["abcissa"] - curves[item]["abcissa mean"]) / curves[item]["abcissa stddev"];
first = Min( curves[item]["abcissa"] );
last = Max( curves[item]["abcissa"] );
curves[item]["crossover abcissa"] = .;
curves[item]["crossover ordinate"] = -1932870987120;
run = 1;
While( Abs( value - curves[item]["crossover ordinate"] ) > precision * value & run <= max runs,
run++;
points = first :: last :: (last - first) / spline number;
coef = Spline Coef( curves[item]["abcissa"], curves[item]["ordinate"], spline lambda );
spline = Spline Eval(
points,
coef
);
For( j = 1, j <= spline number, j++,
If( spline[j] > value,
first = If( j == 1, first, points[j - 1] );
last = points[j];
Break();
,
If( Abs( value - spline[j] ) < Abs( value - curves[item]["crossover ordinate"] ),
curves[item]["crossover abcissa"] = points[j] * curves[item]["abcissa stddev"] + curves[item]["abcissa mean"];
curves[item]["crossover ordinate"] = spline[j];
)
)
);
If( first == last, Break() );
);
first = Min( curves[item]["abcissa"] );
last = Max( curves[item]["abcissa"] );
points = first :: last :: (last - first) / spline number;
curves[item]["spline ordniate"] = Spline Eval(
points,
coef
);
curves[item]["spline abcissa"] = points * curves[item]["abcissa stddev"] + curves[item]["abcissa mean"];
curves[item]["abcissa"] = curves[item]["abcissa"] * curves[item]["abcissa stddev"] + curves[item]["abcissa mean"];
);
curves
);
dt = Open("$SAMPLE_DATA/Nonlinear Examples/Algae Mitscherlich.jmp");
lambda = 1;
Current Data Table( dt );
gb = Graph Builder(
Size( 516, 450 ),
Show Control Panel( 0 ),
Variables( X( :Days ), Y( :Algae density ), Overlay( :Treatment ) ),
Elements( Points( X, Y, Legend( 18 ) ), Smoother( X, Y, Legend( 19 ), Lambda( lambda ) ) ),
SendToReport(
Dispatch(
{},
"Algae density",
ScaleBox,
{Add Ref Line( 3, "Solid", "Black", "", 1 )}
)
)
);
curves = determine crossover( dt, 3, lambda, "Days", "Algae density", "Treatment", 0.001 );
gbr = Report( gb );
dt << Color or Mark by Column( :Treatment );
{y min, y max} = Eval List( {gbr[Axis Box( 2 )] << Get Min, gbr[Axis Box( 2 )] << Get Max} );
key = curves << First;
While( !Is Empty( key ),
Print( Eval List( {key, curves[key]["crossover abcissa"], curves[key]["crossover ordinate"]} ) );
color = Color Of( Row State( curves[key]["rows"][1] ) );
Eval( Eval Expr(
gbr[Frame Box( 1 )] << Add Graphics Script(
Pen Color( Expr( color ) );
Pen Size( 2 );
Line( {Expr( curves[key]["crossover abcissa"] ), Expr( y min )}, {Expr( curves[key]["crossover abcissa"] ), Expr( y max )} )
)
) );
key = curves << Next( key )
)
JMP Pro의 Functional Data Explorer는 함수, 프로필 및 곡선 작업을 위한 많은 도구를 제공합니다.