You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: kern_dens_plot.m
    path of file: ./repos/malini/Codes/FC_EC_calculation code/DynamicFC/jplv7/Ucsd_garch/Kernel Estimation
    
    the code of the file until where you have to start completion: function h=kern_dens_plot(returns,bw,nodes,range,kern)
% PURPOSE:
%    Plots a bivariate kernel smooth
% 
% USAGE:
%     h=kern_dens_plot(returns,bw,nodes,range,kern)
% 
% INPUTS:
%     returns : T by 2 length series to generae the data
%     bw      : The bandwidth to use. If empty, silverman's BW is used
%     nodes   : Number of nodes to use
%     range   : Range to calculate the nodes over(2 by 1 vector)(can be empty, in which case the range is used)
%     kern    : String arguement of the type of kernel to be used

    
function h=kern_dens_plot(returns,bw,nodes,range,kern)
% PURPOSE:
%    Plots a bivariate kernel smooth
% 
% USAGE:
%     h=kern_dens_plot(returns,bw,nodes,range,kern)
% 
% INPUTS:
%     returns : T by 2 length series to generae the data
%     bw      : The bandwidth to use. If empty, silverman's BW is used
%     nodes   : Number of nodes to use
%     range   : Range to calculate the nodes over(2 by 1 vector)(can be empty, in which case the range is used)
%     kern    : String arguement of the type of kernel to be used
%             'cosinus'
%             'epanechnikov'
%             'normal'
%             'quartic'
%             'triangular'
%             'triweight'
%             'uniform'
%
% OUTPUTS:
%     h       : Graphics handle to plos
% 
% COMMENTS:
%     Uses product kernels
% 
% Author: Kevin Sheppard
% kevin.sheppard@economics.ox.ac.uk
% Revision: 2    Date: 12/31/2001

if isempty(bw)
   bw=1.06*std(returns)*length(returns)^(-1/5); 
end