如何对 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 转换后的值进行反转换?嗨吉姆 - 非常感谢你的解释,现在对我来说很有意义。 另外,感谢您提供更新的代码!