Mashinali o‘qitishga kirish Nosirov Xabibullo xikmatullo o‘gli Falsafa doktori (PhD), tret kafedrasi mudiri


There are K = 10 regression coefficients to estimate: nine intercept terms and a common slope. The input argument X should be an n-element cell array of d -by- K design matrices


Download 1.54 Mb.
bet3/5
Sana02.01.2022
Hajmi1.54 Mb.
#194061
1   2   3   4   5
Bog'liq
Mashinali oqitishga kirish 10-maruza Nosirov Kh

There are K = 10 regression coefficients to estimate: nine intercept terms and a common slope. The input argument X should be an n-element cell array of d -by- K design matrices.

X = cell(n,1); for i = 1:n X{i} = [eye(d) repmat(x(i),d,1)]; end [beta,Sigma] = mvregress(X,Y);

beta contains estimates of the K-dimensional coefficient vector (α1,α2,…,α9,β)′.

Sigma contains estimates of the d -by- d variance-covariance matrix (σij)d×di,j=1,…,d for the between-region concurrent correlations.

regress

  • x1 x2 y x1*x2 1 3 3 3 2 6 4 12 3 8 5 24 4 4 6 16 y – vektor
  • X = (ones(4) x1 x2 x1.*x2) regress(y, X) a w1 w2 eps

y = a + w1*x1 + w2*x2 + eps

Multivariate regression model for panel data with different intercepts

Plot the fitted regression model.

B = [beta(1:d)';repmat(beta(end),1,d)]; xx = linspace(.5,3.5)'; fits = [ones(size(xx)),xx]*B; figure; h = plot(x,Y,'x',xx,fits,'-'); for i = 1:d set(h(d+i),'color',get(h(i),'color')); end legend(regions,'Location','NorthWest');


Download 1.54 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling