如何對 SHASH 變換後的值進行反變換?你好。
我正在嘗試計算過程數據的 CpK。
然而歷史 Dist 分析表明,需要 SHASH 變換。
因此我將 SHASH 變換應用於數據並進行分析。
以下是問題。
1. 可以使用SHASH資料作為Cpk的素材嗎?
2. 進行Cpk分析時是否需要輸入原始LSL/USL的SHASH值?
3. 如果透過分析呈現 SHASH 值,如何對其進行反向轉換?
4. 此類分析還有其他考量嗎?
感謝您的閱讀。
進階統計建模品質和工藝工程回覆:如何對 SHASH 轉換後的值進行反轉換?我過去曾使用逐次逼近來完成反向變換。以下是在列上使用逐次逼近的一個非常粗略的範例
names default to here(1);
dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Probe.jmp" );
// Save Columns: Save Transformed
Local( {obj},
obj = dt << Distribution(
Continuous Distribution( Column( :DELL_RPPBR ), Fit SHASH )
);
obj << (Fit Handle["SHASH"] << Save Transformed);
obj << Close Window;
);
meandell_rppbr = col mean(dt:dell_rppbr);
meanSHASH = col mean(dt:SHASH Transform to Normal dell_rppbr);
// Determine the mean of the SHASH value in the original data distribution
// Do this by using successive approximation
// Temporarily add a new row to have a cell to be able to run the SHASH formula
dt << add rows(1);
theRow = nrows(dt);
theMax = col max(:dell_rppbr);
theMin = col min(:dell_rppbr);
targetdell_rppbr = meandell_rppbr;
theDif = col max( dt:SHASH Transform to Normal dell_rppbr)-col min(dt:SHASH Transform to Normal dell_rppbr);
count = 1;
// Successively recalculate the SHASH formula until the difference
// between the mean of the SHASH calculated mean, and the estimated
// value is effectively zero.
while( round(theDif,5) != 0 & count < 100,
if(dt:SHASH Transform to Normal dell_rppbr[theRow]>meanSHASH,
theMax = targetdell_rppbr;
targetdell_rppbr = mean(targetdell_rppbr, theMin ),
theMin = targetdell_rppbr;
targetdell_rppbr = mean(targetdell_rppbr, theMax )
);
dt:dell_rppbr[theRow] = targetdell_rppbr;
count++;
dt << rerun formulas;
theDif = meanSHASH - dt:SHASH Transform to Normal dell_rppbr[theRow];
);
// Once the difference is effectively zero, then display the results
meanSHASHBackTransform = :dell_rppbr[theRow];
dt<<DELETE rows=""></DELETE>回覆:如何對 SHASH 轉換後的值進行反轉換?不幸的是我無法完全理解腳本和運行結果。
然而,很明顯 SHASH 的反向變換與原始單元並不相同。 (考慮運行結果的值和您對「近似值」的使用)
因此我簡單地得出結論,我不能使用這種轉換,因為這種類型的 Cpk 分析需要精確的 1 對 1 匹配。
非常有趣但令人困惑的一點是,Log 和 Sqrt 等一般變換具有精確的反向變換,但 SHASH 和其他幾個變換(例如 Box-cox)看起來並非如此。
還有一個問題,我查了一下,SHASH一定是sinh(arcsinh(x)),那為什麼sinh(arcsinh(93))=93呢?這個 93 是任意的,但 f(x)=x 是我故意的。 我錯了嗎?
回覆:如何對 SHASH 轉換後的值進行反轉換?你好,TXnelson,你能添加原始、SHASH 和反向轉換的標準差嗎? 非常感謝!
回覆:如何對 SHASH 轉換後的值進行反轉換?您的請求雖然對程式碼的修改並不困難,但解釋並不簡單。為了對標準差進行反向變換,必須對高於變換平均值的一個變換後的標準差的值進行反向變換,然後從新的反向變換的高於平均值的1 個標準差中減去原始平均值。這很容易做到,但由於變換改變了資料的分佈,因此必須使用變換後的值重複相同的過程,變換後的 std 值低於平均值。結果是,從平均值到高於平均值的反向變換值的距離不同於從平均值到低於平均值的反向變換值的距離。在我先前的回應中的範例中,從平均值到反向轉換值的距離為:1.57,其中低於平均值的距離為 0.303 我不知道如何處理這些差異?
回覆:如何對 SHASH 轉換後的值進行反轉換?感謝吉姆的快速回覆。 使用您的程式碼,我能夠對資料集進行反向轉換以獲得平均值,但我是 JMP 新手,我不知道程式碼會是什麼樣子 - 您能幫忙嗎?謝謝
原始平均值:4.92759
SHASH 意思: 0284
返回轉換平均值:5.14013
原始標準差:0.6796304
SHASH 標準差:1.0157
回覆:如何對 SHASH 轉換後的值進行反轉換?正如我上面所說,反向轉換 STD 不會有單一值。必須假設,如果您要轉換數據,則原始的未轉換資料不是常態分佈的。因此,高於原始平均值 1 STD 的反向變換標準差點與平均值的距離將不同,而低於平均值 1 STD 的距離則不同。因此,顯示這一點的最佳方法是傳回高於平均值的 v1STD 和低於平均值的 2 STD。這是計算所有這些的 JSL
names default to here(1);
dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Probe.jmp" );
// Save Columns: Save Transformed
Local( {obj},
obj = dt << Distribution(
Continuous Distribution( Column( :DELL_RPPBR ), Fit SHASH )
);
obj << (Fit Handle["SHASH"] << Save Transformed);
obj << Close Window;
);
meandell_rppbr = col mean(dt:dell_rppbr);
meanSHASH = col mean(dt:SHASH Transform to Normal dell_rppbr);
// Determine the mean of the SHASH value in the original data distribution
// Do this by using successive approximation
// Temporarily add a new row to have a cell to be able to run the SHASH formula
dt << add rows(1);
theRow = nrows(dt);
theMax = col max(:dell_rppbr);
theMin = col min(:dell_rppbr);
targetdell_rppbr = meandell_rppbr;
theDif = col max( dt:SHASH Transform to Normal dell_rppbr)-col min(dt:SHASH Transform to Normal dell_rppbr);
count = 1;
// Successively recalculate the SHASH formula until the difference
// between the mean of the SHASH calculated mean, and the estimated
// value is effectively zero.
while( round(theDif,5) != 0 & count < 100,
if(dt:SHASH Transform to Normal dell_rppbr[theRow]>meanSHASH,
theMax = targetdell_rppbr;
targetdell_rppbr = mean(targetdell_rppbr, theMin ),
theMin = targetdell_rppbr;
targetdell_rppbr = mean(targetdell_rppbr, theMax )
);
dt:dell_rppbr[theRow] = targetdell_rppbr;
count++;
dt << rerun formulas;
theDif = meanSHASH - dt:SHASH Transform to Normal dell_rppbr[theRow];
);
// Once the difference is effectively zero, then display the results
meanSHASHBackTransform = :dell_rppbr[theRow];
displayList = {};
insert into(displayList, meandell_rppbr);
insert into(displayList, meanSHASH);
insert into(displayList, meanSHASHBackTransform);
sourceList = {"Original Mean", "SHASH Mean", "Back Transformed Mean"};
meandell_rppbr = col mean(dt:dell_rppbr);
stddell_rppbr = col STDDEV(dt:dell_rppbr);
upperSTDSHASH = col mean(dt:SHASH Transform to Normal dell_rppbr)+col STDDEV(dt:SHASH Transform to Normal dell_rppbr);
// Calculate the Upper STD
// Determine the mean of the SHASH value in the original data distribution
// Do this by using successive approximation
STDSHASH = col mean(dt:SHASH Transform to Normal dell_rppbr) +
col STDDEV(dt:SHASH Transform to Normal dell_rppbr);
theMax = col max(:dell_rppbr);
theMin = col min(:dell_rppbr);
targetdell_rppbr = meandell_rppbr;
theDif = col max( dt:SHASH Transform to Normal dell_rppbr)-col min(dt:SHASH Transform to Normal dell_rppbr);
count = 1;
// Successively recalculate the SHASH formula until the difference
// between the mean of the SHASH calculated mean, and the estimated
// value is effectively zero.
while( round(theDif,5) != 0 & count < 100,
if(dt:SHASH Transform to Normal dell_rppbr[theRow]>upperSTDSHASH,
theMax = targetdell_rppbr;
targetdell_rppbr = mean(targetdell_rppbr, theMin ),
theMin = targetdell_rppbr;
targetdell_rppbr = mean(targetdell_rppbr, theMax )
);
dt:dell_rppbr[theRow] = targetdell_rppbr;
count++;
dt << rerun formulas;
theDif = upperSTDSHASH - dt:SHASH Transform to Normal dell_rppbr[theRow];
);
// Once the difference is effectively zero, then display the results
UpperSTDSHASHBackTransform = :dell_rppbr[theRow] - meandell_rppbr;
insert into(displayList, stddell_rppbr);
insert into(displayList, upperSTDSHASH);
insert into(displayList, UpperSTDSHASHBackTransform);
insert into(sourceList,"Original STD" );
insert into(sourceList,"SHASH STD");
insert into(sourceList,"Back Transformed Upper STD");
// Calculate the Lower STD
// Determine the mean of the SHASH value in the original data distribution
// Do this by using successive approximation
STDSHASH = col mean(dt:SHASH Transform to Normal dell_rppbr) -
col STDDEV(dt:SHASH Transform to Normal dell_rppbr);
theMax = col max(:dell_rppbr);
theMin = col min(:dell_rppbr);
targetdell_rppbr = meandell_rppbr;
theDif = col max( dt:SHASH Transform to Normal dell_rppbr)-col min(dt:SHASH Transform to Normal dell_rppbr);
count = 1;
// Successively recalculate the SHASH formula until the difference
// between the mean of the SHASH calculated mean, and the estimated
// value is effectively zero.
while( round(theDif,5) != 0 & count < 100,
if(dt:SHASH Transform to Normal dell_rppbr[theRow]>upperSTDSHASH,
theMax = targetdell_rppbr;
targetdell_rppbr = mean(targetdell_rppbr, theMin ),
theMin = targetdell_rppbr;
targetdell_rppbr = mean(targetdell_rppbr, theMax )
);
dt:dell_rppbr[theRow] = targetdell_rppbr;
count++;
dt << rerun formulas;
theDif = upperSTDSHASH - dt:SHASH Transform to Normal dell_rppbr[theRow];
);
// Once the difference is effectively zero, then display the results
UpperSTDSHASHBackTransform = meandell_rppbr - :dell_rppbr[theRow];
insert into(displayList, UpperSTDSHASHBackTransform);
insert into(sourceList,"Back Transformed Lower STD");
New Window("Results",
Table Box(
string col box("Source", sourceList),
number col box("Value", displayList)
)
);
dt<<DELETE rows=""></DELETE>回覆:如何對 SHASH 轉換後的值進行反轉換?嗨吉姆 - 非常感謝你的解釋,現在對我來說很有意義。 另外,感謝您提供更新的程式碼!