waldf_d.m

来自「时间序列分析中常用到的matlab代码」· M 代码 · 共 32 行

M
32
字号
% PURPOSE: demo using waldf() 
%                       
% computes Wald F-test for two regressions
%---------------------------------------------------
% USAGE: waldf_d
%---------------------------------------------------

clear all;

rand('seed',10);
n = 100; k=6;
x = randn(n,k);
e = randn(n,1);    
b = ones(k,1);
iota = ones(n,1);
x(:,1) = iota;
% generate y1 data vector using all 6 x's
y = x*b + e;
% create x-matrix based on only 4 x's
xsmall = x(:,1:4);

% unrestricted regression
resu = ols(y,x);

% restricted regression
resr = ols(y,xsmall);

% Wald-test of the restriction
% prints results to command window
waldf(resr,resu);

[fstat prob] = waldf(resr,resu);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?