⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 olsrs_d.m

📁 时间序列分析中常用到的matlab代码
💻 M
字号:
% PURPOSE: An example using olsrs(),
%                           prt(),
%                           plt(),
% restricted ols estimation
%---------------------------------------------------
% USAGE: olsrs_d
%---------------------------------------------------

clear all;
% generate data
nobs = 100;
nvar = 5;
beta = ones(nvar,1);
beta(nvar-1,1) = 0.6;
beta(nvar,1) = 0.4;

randn('state',0);

xmat = randn(nobs,nvar-1);

x = [ones(nobs,1) xmat];
evec = randn(nobs,1);

y = x*beta + evec;

% By some theoretical presumptions, 
%the coefficients on the x3 and x4 explanatory variables
% must sum up to one. 
% Given q = R*b, this translates into the following shape of R and q.
q = 1;
R = [0 0 0 1 1];
vnames = strvcat('y','constant','x1','x2','x3','x4');
results = olsrs(y,x,R,q);
prt_reg(results,vnames);


⌨️ 快捷键说明

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