亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? difonzo.m

?? 計量工具箱
?? M
字號:
function res = difonzo(Y,x,z,ta,s,type,f);
% PURPOSE: Multivariate temporal disaggregation with transversal constraint
% ----------------------------------------------------------------------------------
% SYNTAX: res = difonzo(Y,x,z,ta,s,type,f);
% ----------------------------------------------------------------------------------
% OUTPUT: res: a structure
%         res.meth  = 'Multivariate di Fonzo';
%         res.N     = Number of low frequency data
%         res.n     = Number of high frequency data
%         res.pred  = Number of extrapolations
%         res.ta    = Type of disaggregation
%         res.s     = Frequency conversion
%         res.type  = Model for high frequency innovations
%         res.beta  = Model parameters 
%         res.y     = High frequency estimate
%         res.d_y   = High frequency estimate: std. deviation
%         res.et    = Elapsed time
% ----------------------------------------------------------------------------------
% INPUT: Y: NxM  ---> M series of low frequency data with N observations
%        x: nxm  ---> m series of high frequency data with n observations, m>=M see (*)
%        z: nzx1 ---> high frequency transversal constraint with nz obs.
%        ta: type of disaggregation
%            ta=1 ---> sum (flow)
%            ta=2 ---> average (index)
%            ta=3 ---> last element (stock) ---> interpolation
%            ta=4 ---> first element (stock) ---> interpolation
%        s: number of high frequency data points for each low frequency data points 
%            s= 4 ---> annual to quarterly
%            s=12 ---> annual to monthly
%            s= 3 ---> quarterly to monthly
%        type: model for the high frequency innvations
%            type=0 ---> multivariate white noise
%            type=1 ---> multivariate random walk
% (*) Optional:
%        f: 1xM ---> Set the number of high frequency indicators linked to
%                    each low frequency variable. If f is explicitly included,
%                    the high frequency indicators should be placed in 
%                    consecutive columns
% ----------------------------------------------------------------------------------
% NOTE: Extrapolation is automatically performed when n>sN. 
%       If n=nz>sN restricted extrapolation is applied.
%       Finally, if n>nz>sN extrapolation is perfomed in constrained
%       form in the first nz-sN observatons and in free form in 
%       the last n-nz observations.
% ----------------------------------------------------------------------------------
% LIBRARY: aggreg, dif, vec, desvec
% ----------------------------------------------------------------------------------
% SEE ALSO: denton, mtd_print, mtd_plot
% ----------------------------------------------------------------------------------
% REFERENCE: Di Fonzo, T.(1990)"The estimation of M disaggregate time 
% series when contemporaneous and temporal aggregates are known", Review 
% of Economics and Statistics, vol. 72, n. 1, p. 178-182.

% written by:
% Enrique M. Quilis
% Instituto Nacional de Estadistica
% Paseo de la Castellana, 183
% 28046 - Madrid (SPAIN)
% ----------------------------------------------------------------------------------

t0 = clock;

%--------------------------------------------------------
%       Preliminary checking

[N,M] = size(Y);
[n,m] = size(x);
[nz,mz] = size(z);

if ((M > m) | (n < s*N) | (mz ~= 1) | (nz > n) | (nz < s*N))
   error (' *** INCORRECT DIMENSIONS *** ');
else
   % Number of extrapolations
   h1 = n - nz;
   h2 = n - s*N;
   clear nz mz;
end

%--------------------------------------------------------
%       Checking of "ta"

if (ta < 1) | (ta > 4)
    error (' *** INCORRECT TA OPTION *** ');
end

%--------------------------------------------------------
%       Checking of "s"

if (s ~= 3) & (s ~= 4) & (s ~= 12)
    error (' *** INCORRECT FREQUENCY CONVERSION (s) *** ');
end

%--------------------------------------------------------
%       Checking of "type"

if (type < 0) | (type > 1)
    error (' *** INCORRECT TYPE OPTION *** ');
end

%--------------------------------------------------------
%       Checking (and definition) of vector f 

if (nargin == 6)
    f = ones(1,M);
end

if ( (f < 1) | (sum(f) ~= m) | (length(f) ~= M))
   error (' *** IMPROPER ASSIGNMENT OF INDICATORS IN f VECTOR *** ');
end

%--------------------------------------------------------
%  **** CONSTRAINT MATRICES ***
%--------------------------------------------------------
% Required:
%              H1 ---> transversal
%              H2 ---> longitudinal
%
%---------------------------------------------------------------
%       Generate H1: (n-h1) x nM

H1 = kron(ones(1,M),[eye(n-h1) zeros(n-h1,h1)]);

%---------------------------------------------------------------
%       Generate H2: NM x nM.
%
% Generation of aggregation matrix C

C = aggreg(ta,N,s);
C = [C zeros(N,h2)];

H2 = kron(eye(M),C);

%---------------------------------------------------------------
%       Generate H: (n-h1+NM) x nM.
%
%       H = [ H1
%             H2 ]

H = [H1
   H2];

%--------------------------------------------------------
%  **** PREPARING DATA MATRICES ***
%--------------------------------------------------------
% Required:
%               x_diag
%               Y_big,  Y_e
%               X_diag, X_e

%--------------------------------------------------------
%       Generate x_diag: nM x M+m
%
% It is a diagonal matrix formed by the high frequency
% indicators, including a vector of ones for the intercept
%
%       x_diag = [ x1 0  0  ... 0
%                  0  x2 0  ... 0
%                  0  0  x3 ... 0
%                  ..............
%                  0  0  0  ... xM ]
%
% It is made by means of a recursion.

ac(1)=f(1);                             % Initialization of the recursion
x_diag = [ones(n,1) x(:,1:ac(1))];

j=2;
while (j <= M)
   xaux = [ones(n,1) x(:,ac(j-1)+1:ac(j-1)+f(j))];
   [a2,b2] = size(xaux);
   [a1,b1] = size(x_diag);
   x_diag = [ x_diag         zeros(a1,b2) 
              zeros(a2,b1)   xaux ];
   ac(j) = ac(j-1) + f(j);
   j = j + 1;
end
clear xaux;

%--------------------------------------------------------
%       Generate X_diag: NM x M+m
%
% Low frequency analog of x_diag. It is the result of
% applying the temporal aggregator H2 to x_diag.

X_diag = H2 * x_diag;

%--------------------------------------------------------
%       Generate X_e: (n-h1+NM) x M+m
%
%
% It is the result of applying the complete aggregator H
% (temporal as well as transversal). 
% Lower part of X_e is X_diag.

X_e = H * x_diag;

%--------------------------------------------------------
%       Generate Y_big: NM x 1
%
% It is column vector containing all the observations on the
% low frequency series according to: Y_big = [Y1 Y2 ... YM]'
% Formally: Y_big = vec(Y)

Y_big = vec(Y);

%--------------------------------------------------------
%       Generate Y_e: (n-h1+NM) x 1
%
% It is column vector containing the transversal constraint
% and all the observations on the low frequency series
% according to: Y_e = [ z Y1 Y2 ... YM]' = [z Y_big]'

Y_e = [ z
      Y_big];

%--------------------------------------------------------
%  **** PRELIMINARY ESTIMATION OF SIGMA ***
%--------------------------------------------------------
% The method of di Fonzo requires the previous estimation of VCV
% matrix SIGMA for the (implied) low frequency model. This
% preliminary estimation is performed by means of estimating, equation 
% by equation, the model. Formally, this is equivalent to estimate an 
% unrelated SURE model. Computationally, this is also the applied procedure.

BETA = (X_diag' * X_diag) \ (X_diag' * Y_big); % OLS estimator
U_big = Y_big - X_diag * BETA;                 % Residuals in vec format

% Residuals (columnwise) U: NxM

U = desvec(U_big,M);

% Preliminary estimation of SIGMA

SIGMA = cov(U,1);

%--------------------------------------------------------
%  **** APPLYING DI FONZO PROCEDURE ***
%--------------------------------------------------------

%--------------------------------------------------------
%       High frequency VCV matrix v: nM x nM

switch type
case 0 % White noise
   v = kron(SIGMA,eye(n));
case 1 % Random walk, with U(0)=0
   D = dif(1,n);
   DDi = inv(D'*D);
   v = kron(SIGMA,DDi);
end;

%--------------------------------------------------------
%       Low frequency VCV matrix V: (n-h1+NM) x (n-h1+NM)
%       and its generalized inverse 

V = H * v * H';
Vi = pinv(V);      % Moore-Penrose generalized inverse 

%--------------------------------------------------------
%       Generation of distribution filter L: nM x (n-h1+NM)

L = v * H' * Vi;

%--------------------------------------------------------
%	     GLS estimation of beta in a SURE context

beta = (X_e' * Vi * X_e) \ (X_e' * Vi * Y_e);

U_e = Y_e - X_e * beta;

%--------------------------------------------------------
%       Estimation of high frequency series

y_big = x_diag * beta + L * U_e;

% Series y columnwise y: nxM

y = desvec(y_big,M);

%--------------------------------------------------------
%       VCV matrix of estimations y: nM x nM

sigma_y = (eye(n*M) - L*H)*v + ...
   (x_diag - L*X_e)*inv(X_e'*Vi*X_e)*(x_diag - L*X_e)';

% Vector format of std. dev.

d_y_big = sqrt(diag(sigma_y));

% Std. dev. series in column format dt_y: n x M

d_y = desvec(d_y_big,M);

% -----------------------------------------------------------------------
% Loading the structure
% -----------------------------------------------------------------------
% Basic parameters 

res.meth = 'Multivariate di Fonzo';
res.N = N;
res.n = n;
res.pred = h2;
res.ta= ta;
res.s = s;
res.type = type;

% -----------------------------------------------------------------------
% Parameters

res.beta=beta;

% -----------------------------------------------------------------------
% Series

res.y   = y;
res.d_y = d_y;

% -----------------------------------------------------------------------
% Elapsed time

res.et        = etime(clock,t0);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区福利在线| 不卡的电影网站| 欧美一区二区三区免费大片| 丝袜美腿成人在线| 精品久久一二三区| 国产精品2024| 老司机午夜精品| 国产午夜精品久久久久久免费视 | 亚洲妇女屁股眼交7| 欧美日韩视频在线一区二区 | 另类中文字幕网| 亚洲国产精品成人久久综合一区 | 激情综合五月婷婷| 国产日韩欧美精品一区| 日本电影亚洲天堂一区| 日精品一区二区三区| 久久婷婷国产综合国色天香| 大美女一区二区三区| 亚洲午夜久久久久久久久电影网| 欧美男女性生活在线直播观看| 奇米影视一区二区三区| 欧美国产在线观看| 欧美日韩亚洲综合一区| 国产激情视频一区二区三区欧美| 一区二区视频在线| 精品久久久影院| 色综合色综合色综合色综合色综合 | 国产日韩综合av| 欧美在线free| 国产精品亚洲综合一区在线观看| 亚洲男人的天堂一区二区| 日韩美女在线视频| 在线精品亚洲一区二区不卡| 另类小说欧美激情| 亚洲乱码日产精品bd| 欧美精品一区男女天堂| 国产香蕉久久精品综合网| 91在线播放网址| 国产米奇在线777精品观看| 亚洲五码中文字幕| 国产精品色婷婷久久58| 日韩一区二区在线观看| 在线观看免费成人| 成人午夜视频在线| 黄一区二区三区| 日韩精品成人一区二区在线| 亚洲欧洲日韩av| 精品国产亚洲一区二区三区在线观看| 91福利在线观看| 国产91精品欧美| 精品一区二区三区视频在线观看| 亚洲综合精品自拍| 亚洲欧美色图小说| 国产精品乱码一区二区三区软件| 日韩欧美二区三区| 欧美中文字幕一区二区三区亚洲| 成人精品高清在线| 国产成人三级在线观看| 久久精品国产在热久久| 日韩影院精彩在线| 亚洲一区二区三区中文字幕在线| 一区精品在线播放| 国产精品免费久久久久| 国产午夜亚洲精品午夜鲁丝片| 日韩一级成人av| 6080国产精品一区二区| 欧美猛男超大videosgay| 色狠狠一区二区| 一本到不卡精品视频在线观看| av电影天堂一区二区在线| 成人一区二区在线观看| 成人精品免费网站| www.亚洲精品| 99精品欧美一区| 99久久99久久久精品齐齐| 成人avav影音| 99re6这里只有精品视频在线观看| av影院午夜一区| 久久免费视频一区| 精品国产1区2区3区| 欧美精品一区二区三区久久久| 精品国精品国产尤物美女| 精品国产三级a在线观看| 欧美精品一区男女天堂| 国产午夜一区二区三区| 国产精品精品国产色婷婷| 亚洲国产精品成人综合色在线婷婷 | 国产精品久久久久四虎| 亚洲人成伊人成综合网小说| 一区二区三区欧美在线观看| 亚洲第一成年网| 日韩中文字幕麻豆| 激情欧美日韩一区二区| www.欧美日韩| 欧美三级欧美一级| 欧美一级夜夜爽| 久久综合九色综合97婷婷| 国产精品国产三级国产aⅴ原创 | 亚洲人成精品久久久久久| 一区二区三区影院| 蜜臀久久99精品久久久久久9| 国产精品一区久久久久| 色综合久久久久久久久久久| 欧美日韩一级视频| 国产亚洲成aⅴ人片在线观看| 国产精品国产自产拍在线| 五月激情六月综合| 国产一区二区不卡老阿姨| 成人av午夜影院| 91精品国产综合久久蜜臀| 国产女人aaa级久久久级| 亚洲线精品一区二区三区八戒| 久久国产麻豆精品| 91在线看国产| 精品国产亚洲在线| 亚洲综合色噜噜狠狠| 精品午夜一区二区三区在线观看| 99久久免费国产| 日韩一区二区三区免费看| 亚洲欧洲国产日本综合| 免费视频最近日韩| 91麻豆swag| 久久午夜色播影院免费高清| 亚洲免费电影在线| 国产成人在线网站| 91.com在线观看| 尤物视频一区二区| 国产成人精品免费一区二区| 欧美精品乱码久久久久久 | 欧美一区二区三区播放老司机| 亚洲国产精品99久久久久久久久| 午夜精品一区二区三区免费视频| 国产成人免费在线观看| 91精品国模一区二区三区| 一区二区三区欧美日| 国产精品自拍av| 欧美一区二区三级| 午夜精品福利一区二区三区蜜桃| 99精品视频在线观看免费| 精品国产乱码久久久久久图片 | 色婷婷综合在线| 欧美激情一区二区三区不卡 | 国精产品一区一区三区mba视频| 色欧美日韩亚洲| 国产日韩欧美一区二区三区综合| 久久超碰97人人做人人爱| 欧美久久一区二区| 亚洲一区在线观看免费观看电影高清 | 91丨九色porny丨蝌蚪| 久久婷婷久久一区二区三区| 麻豆精品久久精品色综合| 欧美日韩高清影院| 亚洲一区二区三区四区在线观看| 99久久精品情趣| 中文字幕第一页久久| 国产精品一区久久久久| 欧美精品一区二区高清在线观看 | 日本伦理一区二区| 亚洲欧洲日产国码二区| 成人成人成人在线视频| 国产精品乱码一区二区三区软件| 国产成人h网站| 久久久久久毛片| 国产麻豆一精品一av一免费| 日韩一本二本av| 另类小说色综合网站| 精品国产伦理网| 国产麻豆欧美日韩一区| 久久久久国产精品麻豆| 国产精品一区在线| 国产精品视频你懂的| 不卡视频一二三四| 亚洲精品国产一区二区精华液 | 毛片av一区二区| 亚洲精品在线免费播放| 国内精品伊人久久久久av一坑| 欧美va亚洲va在线观看蝴蝶网| 激情伊人五月天久久综合| 2欧美一区二区三区在线观看视频| 国产专区欧美精品| 国产视频亚洲色图| aaa国产一区| 亚洲午夜电影在线观看| 91精品国产日韩91久久久久久| 久久国产尿小便嘘嘘尿| 欧美国产日韩精品免费观看| 91麻豆国产自产在线观看| 性做久久久久久免费观看| 欧美成人高清电影在线| 国产成人综合网站| 亚洲综合男人的天堂| 这里只有精品免费| 国产成人亚洲综合a∨猫咪| 日韩理论片中文av| 欧美三区在线观看| 国内精品在线播放| 亚洲精品久久嫩草网站秘色| 日韩一区二区三区av| 成人综合在线视频| 婷婷激情综合网|