header updated

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1629 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
assia 2008-01-21 12:09:31 +00:00
parent 50b745b547
commit 467d1b1dd1
1 changed files with 25 additions and 8 deletions

View File

@ -1,12 +1,29 @@
function [abscissa,f] = kernel_density_estimate(data,number_of_grid_points,bandwidth,kernel_function)
%% This function aims at estimating a continuous density. A kernel density
%% estimator is used (see Silverman [1986]).
%%
%% * Silverman [1986], "Density estimation for statistics and data analysis".
%%
%% The code is adapted from Anders Holtsberg's matlab toolbox (stixbox).
%%
%% stephane.adjemian@cepremap.cnrs.fr [07/16/2004].
% function [abscissa,f] = kernel_density_estimate(data,number_of_grid_points,bandwidth,kernel_function)
% Estimates a continuous density.
%
% INPUTS
% data: data
% number_of_grid_points: number of grid points
% bandwidth: scalar equals to 0,-1 or -2. For a value different from 0,-1 or -2 the
% function will return optimal_bandwidth = bandwidth.
% kernel_function: 'gaussian','uniform','triangle','epanechnikov',
% 'quartic','triweight','cosinus'.
%
% OUTPUTS
% abscissa: value on the abscissa axis
% f: density
%
% SPECIAL REQUIREMENTS
% A kernel density estimator is used (see Silverman [1986], "Density estimation for statistics and data analysis")
% The code is adapted from Anders Holtsberg's matlab toolbox (stixbox).
%
% part of DYNARE, copyright Dynare Team (2004-2008)
% Gnu Public License.
if size(data,2) > 1 & size(data,1) == 1
data = transpose(data);
elseif size(data,2)>1 & size(data,1)>1