No BSD License  

Highlights from
Estimation for Hidden Processes

from Estimation for Hidden Processes by Yves Rozenholc
Nonparametric estimation of density, regression or variance functions for hidden processes using mod

ExampleRegression.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%% HIDDEN REGRESSION Examples ("errors in variables" model)
% Observations vector Z
% The second input argument is noise type
% The third input argument is sigma
% The fourth input argument is observations vector Y
%
% the output is a structure with
%   Dgopt : the selected "dimension" for the density g of X
%   gD : the estimate coefficients for g at the selected dimension Dgopt
%   Dlopt : the selected "dimension" for the product l=b.g
%   lD : the estimate coefficients for l=b.g at the selected dimension Dlopt
%   n : length of the observations
%   abs : linspace(quantila(Z,0.05),quantila(Z,0.95),1001) ->(default values)
%   gord : density g estimates associated to abs
%   lord : l=b.g estimates associated to abs
%   bord : b estimates associated to abs
%   vord : (s^2+b^2)*g estimates associated to abs
%   cord : s^2+b^2 estimates associated to abs
%   s2ord : s^2 estimates associated to abs

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Example A-1/ REGRESSION with errors in variables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% following the second example of Fan & Truong - Annals of Statistics 1993
n = 2000;
name = 'truong';
W0 = 'normal';
s0 = sqrt(3/7)*0.25;
WY = 'normal';
sY = 0.25;

%%%% SIMULATION
Obs = DeconvSimul(name,n,W0,s0,WY,sY);

%%%% ESTIMATION
estimate = DeconvEstimate(Obs.Z,Obs.W0,Obs.s0,Obs.Y);

subplot(2,2,1)
plot(estimate.abs,pdf('norm',estimate.abs,0.5,0.25),'r',estimate.abs,estimate.gord,'b')
title('density g estimate')
legend('true','estimate')

subplot(2,2,2)
plot(estimate.abs,drift(estimate.abs,name),'r',estimate.abs,estimate.bord,'b')
title('b estimate')

subplot(2,2,3)
plot(estimate.abs,drift(estimate.abs,name).^2+volatility(estimate.abs,name).^2,'r',estimate.abs,estimate.cord,'b')
title('b^2+s^2 estimate')

subplot(2,2,4)
plot(estimate.abs,volatility(estimate.abs,name).^2,'r',estimate.abs,estimate.s2ord,'b')
title('s^2 estimate')


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Example A-2/ REGRESSION with errors in variables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% following the second example of Fan & Truong - Annals of Statistics 1993
n = 2000;
name = 'truong';
W0 = 'symexp';
s0 = sqrt(3/7)*0.25;
WY = 'normal';
sY = 0.25;

%%%% SIMULATION
Obs = DeconvSimul(name,n,W0,s0,WY,sY);

%%%% ESTIMATION
estimate = DeconvEstimate(Obs.Z,Obs.W0,Obs.s0,Obs.Y);

subplot(2,2,1)
plot(estimate.abs,pdf('norm',estimate.abs,0.5,0.25),'r',estimate.abs,estimate.gord,'b')
title('density g estimate')
legend('true','estimate')

subplot(2,2,2)
plot(estimate.abs,drift(estimate.abs,name),'r',estimate.abs,estimate.bord,'b')
title('b estimate')

subplot(2,2,3)
plot(estimate.abs,drift(estimate.abs,name).^2+volatility(estimate.abs,name).^2,'r',estimate.abs,estimate.cord,'b')
title('b^2+s^2 estimate')

subplot(2,2,4)
plot(estimate.abs,volatility(estimate.abs,name).^2,'r',estimate.abs,estimate.s2ord,'b')
title('s^2 estimate')


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Example B-1/ AUTO-REGRESSION with errors in variables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% following the second example of Fan & Truong - Annals of Statistics 1993
n = 2000;
name = 'M10';
W0 = 'normal';
s0 = 0.1;
WY = 'normal';
sY = 1;

%%%% SIMULATION
Obs = DeconvSimul(name,n,W0,s0,WY,sY);

%%%% ESTIMATION
estimate = DeconvEstimate(Obs.Z,Obs.W0,Obs.s0,Obs.Y);

subplot(2,2,1)
plot(estimate.abs,estimate.gord,'b')
title('density g estimate')

subplot(2,2,2)
plot(estimate.abs,drift(estimate.abs,name),'r',estimate.abs,estimate.bord,'b')
title('b estimate')
legend('true','estimate')

subplot(2,2,3)
plot(estimate.abs,drift(estimate.abs,name).^2+volatility(estimate.abs,name).^2,'r',estimate.abs,estimate.cord,'b')
title('b^2+s^2 estimate')

subplot(2,2,4)
plot(estimate.abs,volatility(estimate.abs,name).^2,'r',estimate.abs,estimate.s2ord,'b')
title('s^2 estimate')


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Example B-2/ AUTO-REGRESSION with errors in variables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% following the second example of Fan & Truong - Annals of Statistics 1993
n = 2000;
name = 'M11';
W0 = 'symexp';
s0 = 0.1;
WY = 'normal';
sY = 1;

%%%% SIMULATION
Obs = DeconvSimul(name,n,W0,s0,WY,sY);

%%%% ESTIMATION
estimate = DeconvEstimate(Obs.Z,Obs.W0,Obs.s0,Obs.Y);

subplot(2,2,1)
plot(estimate.abs,estimate.gord,'b')
title('density g estimate')

subplot(2,2,2)
plot(estimate.abs,drift(estimate.abs,name),'r',estimate.abs,estimate.bord,'b')
title('b estimate')
legend('true','estimate')

subplot(2,2,3)
plot(estimate.abs,drift(estimate.abs,name).^2+volatility(estimate.abs,name).^2,'r',estimate.abs,estimate.cord,'b')
title('b^2+s^2 estimate')

subplot(2,2,4)
plot(estimate.abs,volatility(estimate.abs,name).^2,'r',estimate.abs,estimate.s2ord,'b')
title('s^2 estimate')

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This is part of the package EstimHidden devoted to the estimation of 
%
% 1/ the density of X in a convolution model where Z=X+noise1 is observed 
%
% 2/ the functions b (drift) and s^2 (volatility) in an "errors in variables" 
%    model where Z and Y are observed and assumed to follow:
%           Z=X+noise1 and Y=b(X)+s(X)*noise2.
%
% 3/ the functions b (drift) and s^2 (volatility) in an stochastic
%    volatility model where Z is observed and follows:
%           Z=X+noise1 and X_{i+1} = b(X_i) + s(X_i)*noise2
%
% in any cases the density of noise1 is known. We consider three cases for
% this density : Gaussian ('normal'), Laplace ('symexp') and log(Chi2)
% ('logchi2)
%
% See function DeconvEstimate.m and examples in files ExampleDensity.m and
% ExampleRegression.m
%
% Authors : F. COMTE and Y. ROZENHOLC 
%
%
% For more information, see the following references:
%
% DENSITY DECONVOLUTION
%%%%%%%%%%%%%%%%%%%%%%%
%
% 1/ "Penalized contrast estimator for density deconvolution", 
%    The Canadian Journal of Statistics, 34, 431-452, 2006.
%    by F. COMTE, Y. ROZENHOLC, and M.-L. TAUPIN
%
% 2/ "Finite sample  penalization in adaptive density deconvolution", 
%    Journal of Statistical Computation and Simulation. 
%    Available online.
%    by F. COMTE, Y. ROZENHOLC, and M.-L. TAUPIN
%
% 3/ "Adaptive density estimation for general ARCH models", 
%    Preprint HAL-CNRS : hal-00101417  at http://hal.archives-ouvertes.fr/
%    by F. COMTE, J. DEDECKER, and  M.-L. TAUPIN. 
%
% REGRESSION and AUTO-REGRESSION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% 4/ "Nonparametric estimation of the regression function in an
%    errors-in-variables model", 
%    Statistica Sinica, 17, n3, 1065-1090, 2007. 
%    by F. COMTE and M.-L. TAUPIN
%
% 5/ "Adaptive estimation of the dynamics of a discrete time stochastic
%    volatility model", 
%    Preprint HAL-CNRS : hal-00170740 at http://hal.archives-ouvertes.fr/
%    by F. COMTE, C. LACOUR, and Y. ROZENHOLC. 
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% You can use this software for NON-COMMERCIAL USE ONLY. 
%
% You can distribute this sofware unchanged and only unchanged, which implies
% including all files found in the folder cointainning this file.
%
% This software, and any part of it, is proposed for NON-COMMERCIAL USE 
% ONLY. 
%
% Please, contact the author for and before any non-academic use
% of this software.
%
% To reproduce this code or any part of this code in the original language 
% or in any other language, for commercial use, please contact the Author
%
% For academic purpose, cite this package and the connected papers.
%
% Corresponding author : Y. Rozenholc, yves.rozenholc@univ-paris5.fr
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Examples in files ExampleDensity.m and ExampleRegression.m
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



Contact us at files@mathworks.com