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

ExampleDensity.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%% Density Deconvolution Examples
% Observations vector Z
% The second input argument is noise type
% The third input argument is sigma
%
% the output is a structure with
%   Dgopt : the selected "dimension"
%   gD : the estimate coef for the selected dimension
%   n : length of the observations
%   abs : linspace(quantila(Z,0.05),quantila(Z,0.95),1001) ->(default values)
%   gord : density estimates associated to abs
%
%
% %%%% to specify particular abscissa
% ab = linspace(-2,6,1000);
% estimate = DeconvOrd(estimate,ab);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Example A/ Gaussian with Gaussian noise
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

n = 2000
X = randn(n,1);
Y = randn(n,1);
sigma = 1;
Wtype = 'normal';
Z = X + sigma*Y;

estimate = DeconvEstimate(Z,Wtype,sigma);

plot(estimate.abs,pdf('normal',estimate.abs,0,1),'r',estimate.abs,estimate.gord,'b')
legend('true','estimate')
title([Wtype ' noise'])


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Example B/ GARCH 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

euler = 0.57721566490153286061;
n = 2000;
[X,s2] = GARCH(n,[1 0.7],0.2,500);
sigma = 1; 
Wtype = 'logchi2';

estimate = DeconvEstimate(log(X.^2)+log(2)+euler,Wtype,sigma);
plot(estimate.abs,estimate.gord)

% Please install HistOptimal first to run the next line
hold on,HistOptimal(log(s2),100);hold off


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Example C/ Mixture of Gaussians with log(Chi2) noise
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

euler = 0.57721566490153286061;
n = 2000
X=randn(n,1); ep=log(randn(n,1).^2); Wtype = 'logchi2';
B=(rand(n,1)<0.4); X=-2+8*B+2*X; sigma=1; Z=X+sigma*ep;

estimate = DeconvEstimate(Z,Wtype,sigma);

true = 0.6*pdf('norm',estimate.abs,-2,2)+0.4*pdf('norm',estimate.abs,6,2);
plot(estimate.abs,true,'r',estimate.abs+log(2)+euler,estimate.gord,'b')
legend('true','estimate')

% Please install HistOptimal first to run the next line
hold on,HistOptimal(Z,100);hold off


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Example D/ Gaussian with Laplace noise
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

n = 2000
X = randn(1,n);
Y = randn(1,n);
sigma = 1;
Wtype = 'symexp';
Z = X + sigma*Y;

estimate = DeconvEstimate(Z,Wtype,sigma);

plot(estimate.abs,pdf('normal',estimate.abs,0,1),'r',estimate.abs,estimate.gord,'b')
legend('true','estimate')
title([Wtype ' noise'])

%%%% to specify particular abscissa
ab = linspace(-2,6,1000);
estimate = DeconvOrd(estimate,ab);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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