在MATLAB中使用Econometrics工具箱存储p值 [英] Storing p values using Econometrics toolbox in matlab

查看:254
本文介绍了在MATLAB中使用Econometrics工具箱存储p值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码将与计量经济学工具箱一起运行

This code will run with the econometrics toolbox,

    model = arima('Constant',0.5,'AR',{0.9999},'Variance',.4);
rng('default')
Y = simulate(model,50);
figure
plot(Y)
xlim([0,50])
title('Simulated AR(1) Process')

rng('default')
Y = simulate(model,50,'NumPaths',1000);
Y1=Y(:,1);

for ii = 1:50
Mdl = arima(1,0,0);
EstMdl = estimate(Mdl, [Y(:,ii)]);
end

如何为每次迭代存储EstMdl中的p值(即具有5个pvalue的向量)?

How can I store the p-values from the EstMdl for each iteration (i.e. a vector with 5 pvalues) ?

推荐答案

使用 summarize (要求≥R2018a)以获取 estimate .

在此处显示一次迭代的结果:

Showing the results for one iteration here:

>> ii=1;
>> Mdl = arima(1,0,0);
>> EstMdl = estimate(Mdl, [Y(:,ii)]);

    ARIMA(1,0,0) Model (Gaussian Distribution):

                 Value     StandardError    TStatistic      PValue  
                _______    _____________    __________    __________

    Constant     622.14        427.99         1.4536         0.14605
    AR{1}       0.87561      0.085586         10.231      1.4432e-24
    Variance    0.37122      0.079507          4.669      3.0263e-06

>> Results = summarize(EstMdl);
>> PValues = Results.Table.PValue

PValues =

    0.1460
    0.0000
    0.0000

这篇关于在MATLAB中使用Econometrics工具箱存储p值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆