通过重新排序 Y 变量来验证/测试过拟合模型?一位同事描述了另一个软件包中的测试,该软件包在分析中随机重新排列 y 值,然后重新拟合模型以确保其拟合不佳。 有没有人熟悉这项技术或试图在 JMP 中自动化它?
比较这两个拟合演示了该技术,尽管听起来像创建和测试了许多 y' 列。
dt = New Table( "Untitled 2",
Add Rows( 10 ),
New Column( "x",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Selected,
Set Values( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] )
),
New Column( "y",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( :x * 2 + Random Normal( 0, 0.1 ) )
),
New Column( "y'",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Col Stored Value( :y, Col Shuffle() ) )
)
);
dt << Fit Model(
Y( :y, :y' ),
Effects( :x ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(
:y << {Lack of Fit( 0 ), Plot Actual by Predicted( 0 ),
Plot Residual by Predicted( 0 ), Plot Effect Leverage( 0 )},
:y' << {Lack of Fit( 0 ), Plot Actual by Predicted( 0 ),
Plot Residual by Predicted( 0 ), Plot Effect Leverage( 0 )}
)
);回复:通过重新排序 Y 变量来验证/测试过拟合模型?标记,
如果我理解你的帖子,我认为引导将是(希望)得出相同结论的另一种方法。 老实说,虽然我对基本模型的引导参数估计没有好运,但也许我做错了什么:-)。 例如,尝试引导二阶模型的参数估计会导致每个可能系数的多列。
我想我找到了一种使用模拟方法自动执行此操作的方法。 不使用平台生成的模拟函数,只需将原始 y 与重新排列的 y' 列交换即可。 但是,我在将该技术应用于分区方法时遇到了麻烦;我怀疑每次模拟都使用相同的树。
附件是一个脚本,显示了几种不同方法的情况,但这里是基本思想:
Random Reset(1);
dt = New Table( "Untitled 2",
Add Rows( 4 ),
New Column( "x",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Selected,
Set Values( [1, 2, 3, 4] )
),
New Column( "y",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( :x * 2 + Random Normal( 0, 0.1 ) )
),
New Column( "y'",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Col Stored Value( :y, Col Shuffle() ) )
)
);
// ------ Linear Model ------
linmdl = dt << Fit Model(
Y( :y ),
Effects( :x ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(
:y << {Lack of Fit( 0 ), Plot Actual by Predicted( 0 ),
Plot Residual by Predicted( 0 ), Plot Effect Leverage( 0 )},
:y' << {Lack of Fit( 0 ), Plot Actual by Predicted( 0 ),
Plot Residual by Predicted( 0 ), Plot Effect Leverage( 0 )}
)
);
linrpt = linmdl << Report;
lindt = linrpt["Summary of Fit"][1][2] << Simulate(
100,
Out( :y ),
In( :y' )
);
lindt[2] << Distribution( Continuous Distribution( Column( :RSquare ) ) );
回复:通过重新排序 Y 变量来验证/测试过拟合模型?这重采样法通常用于确定改变自变量水平的影响的显着性。这种方法经常被用来代替吨test 或 ANOVA,它对数据和模型做出假设,以进行推理。重采样方法生成经验分布而不是假设特定模型。您将样本统计量与经验分布进行比较以获得磷-价值。
JMP Pro 可以引导程序任何结果,例如参数估计,以确定其重要性。
您不需要第二个因变量(随机正态偏差)。