时间序列分析 - 需要脚本编写者我正在尝试对时间序列数据进行 ARIMA (1,1,0) 分析 - 附有示例。我的表有 450 个城市,但示例文件中只有 2 个。我想对每个城市进行相同的分析。在许多 JMP 平台中,我可以按住控制键并要求进行分析,它将对“按框”中的所有城市进行分析。但是,对于设置 ARIMA 值,它会为每个城市(共 450 个!)提供对话框。我怀疑有一种方法可以编写脚本,这样我只需要指定一次 ARIMA (1,1,0) 并将其应用于每个城市 - 但我不知道该怎么做。有人可以帮忙吗?
高级统计建模回复:时间序列分析 - 需要脚本编写者以下脚本将为“Zillow 数据的区域名称”中的每个唯一值生成“索引价格”与“月份”的 ARIMA(1,1,0) 模型。
Time Series(
X( :month ),
Y( :indexed prices ),
ARIMA( 1, 1, 0 ),
Forecast Periods( 24 ),
By( :RegionName of Zillow Data)
);
回复:时间序列分析 - 需要脚本编写者这能给你想要的吗?
New Window( "Subset of Comparison data - Time Series of prices",
V List Box(
Time Series(
X( :month ),
Y( :prices ),
ARIMA( 1, 1, 0 ),
Where(
:RegionName of Zillow Data == "Los Angeles-Long Beach-Anaheim, CA"
)
),
Time Series(
X( :month ),
Y( :prices ),
ARIMA( 1, 1, 0 ),
by(:RegionName of Zillow Data),
SendToReport(
Dispatch(
{"Model Comparison"},
"",
ScrollBox,
{Background Color( 117 )}
)
)
)
)
);回复:时间序列分析 - 需要脚本编写者谢谢 - 这符合我的要求,但我想我还需要一件事。我想保存来自这些模型的预测,但两个选项 - 保存预测公式或保存列都为每个区域(其中 450 个)创建一个新的数据表。我希望预测(有或没有标准误差和置信区间)出现在同一个数据表中,但预测列应包含每个按组区域的预测。换句话说,一个数据表,而不是其中的 450 个(它可以是一个新数据表,也可以只是添加到现有表中的列)。
回复:时间序列分析 - 需要脚本编写者同样的问题 - 谢谢,这符合我的要求。但我还需要一件事——我想将模型中的预测全部保存在一张表中。如果我控制单击保存选项,我会得到 450 个表,每个区域名称一个。有没有办法获得一个表,其中预测列链接到区域名称中的每个值?
回复:时间序列分析 - 需要脚本编写者这是一个脚本,我相信它会给你你想要的
Names Default To Here( 1 );
dt = Current Data Table();
ts = Time Series(invisible,
X( :month ),
Y( :indexed prices ),
Forecast Periods( 24 ),
By( :RegionName of Zillow Data )
);
// Start final table
dtFinal = New Table( "Final", New Column( "RegionName of Zillow Data", character ) );
// Loop across output creating ARIMA and the Save Columns
For( i = 1, i <= N Items( ts ), i++,
objt = ts[i] << arima( 1, 1, 0 );
dtTemp = objt << save columns;
// Add the By Group name to the data table
RZD = Word( 2, Report( ts[i] )[Outline Box( 1 )] << get title, "=" );
dtTemp << New Column( "RegionName of Zillow Data", character, set each value( RZD ) );
// Add the new table to the Final data table
dtFinal << concatenate( dtTemp, Append to first table( 1 ) );
Close( dtTemp, nosave );
);
回复:时间序列分析 - 需要脚本编写者吉姆,你又成功了!完美的!