dynare/matlab/doc/stab_map_marginal.html

120 lines
7.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Description of stab_map_marginal</title>
<meta name="keywords" content="stab_map_marginal">
<meta name="description" content="function stab_map_1(lpmat, ibehaviour, inonbehaviour, aname, ipar, dirname)">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
<meta name="robots" content="index, follow">
<link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../index.html">Home</a> &gt; <a href="index.html">.</a> &gt; stab_map_marginal.m</div>
<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for .&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->
<h1>stab_map_marginal
</h1>
<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function stab_map_1(lpmat, ibehaviour, inonbehaviour, aname, ipar, dirname)</strong></div>
<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function stab_map_marginal(lpmat, ibehaviour, inonbehaviour, aname, ipar, dirname) </strong></div>
<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment">function stab_map_1(lpmat, ibehaviour, inonbehaviour, aname, ipar, dirname)
lpmat = Monte Carlo matrix
ibehaviour = index of behavioural runs
inonbehaviour = index of non-behavioural runs
aname = label of the analysis
ipar = index array of parameters to plot
dirname = (OPTIONAL) path of the directory where to save
(default: current directory)
Plots: dotted lines for BEHAVIOURAL
solid lines for NON BEHAVIOURAL
USES smirnov</pre></div>
<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="kernel_density_estimate.html" class="code" title="function [abscissa,f] = kernel_density_estimate(data,number_of_grid_points,bandwidth,kernel_function)">kernel_density_estimate</a> % This function aims at estimating a continuous density. A kernel density</li><li><a href="mh_optimal_bandwidth.html" class="code" title="function optimal_bandwidth = mh_optimal_bandwidth(data,n,bandwidth,kernel_function)">mh_optimal_bandwidth</a> % This function gives the optimal bandwidth parameter of a kernel estimator</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function stab_map_marginal(lpmat, ibehaviour, inonbehaviour, aname, ipar, dirname)</a>
0002 <span class="comment">%function stab_map_1(lpmat, ibehaviour, inonbehaviour, aname, ipar, dirname)</span>
0003 <span class="comment">%</span>
0004 <span class="comment">% lpmat = Monte Carlo matrix</span>
0005 <span class="comment">% ibehaviour = index of behavioural runs</span>
0006 <span class="comment">% inonbehaviour = index of non-behavioural runs</span>
0007 <span class="comment">% aname = label of the analysis</span>
0008 <span class="comment">% ipar = index array of parameters to plot</span>
0009 <span class="comment">% dirname = (OPTIONAL) path of the directory where to save</span>
0010 <span class="comment">% (default: current directory)</span>
0011 <span class="comment">%</span>
0012 <span class="comment">% Plots: dotted lines for BEHAVIOURAL</span>
0013 <span class="comment">% solid lines for NON BEHAVIOURAL</span>
0014 <span class="comment">% USES smirnov</span>
0015
0016 <span class="keyword">global</span> estim_params_ bayestopt_ M_ options_
0017
0018 fname_ = M_.fname;
0019 <span class="keyword">if</span> nargin&lt;5,
0020 ipar=[1:npar];
0021 <span class="keyword">end</span>
0022 nparplot=length(ipar);
0023 <span class="keyword">if</span> nargin&lt;6,
0024 dirname=<span class="string">''</span>;;
0025 <span class="keyword">end</span>
0026
0027 nshock = estim_params_.nvx;
0028 nshock = nshock + estim_params_.nvn;
0029 nshock = nshock + estim_params_.ncx;
0030 nshock = nshock + estim_params_.ncn;
0031
0032 npar=size(lpmat,2);
0033 ishock= npar&gt;estim_params_.np;
0034
0035 number_of_grid_points = 2^9; <span class="comment">% 2^9 = 512 !... Must be a power of two.</span>
0036 bandwidth = 0; <span class="comment">% Rule of thumb optimal bandwidth parameter.</span>
0037 kernel_function = <span class="string">'gaussian'</span>; <span class="comment">% Gaussian kernel for Fast Fourrier Transform approximaton.</span>
0038 <span class="comment">%kernel_function = 'uniform'; % Gaussian kernel for Fast Fourrier Transform approximaton.</span>
0039
0040 lpmat=lpmat(:,ipar);
0041 ftit=bayestopt_.name(ipar+nshock*(1-ishock));
0042
0043 <span class="keyword">for</span> i=1:ceil(npar/12),
0044 figure(<span class="string">'name'</span>,aname),
0045 <span class="keyword">for</span> j=1+12*(i-1):min(npar,12*i),
0046 subplot(3,4,j-12*(i-1))
0047 optimal_bandwidth = <a href="mh_optimal_bandwidth.html" class="code" title="function optimal_bandwidth = mh_optimal_bandwidth(data,n,bandwidth,kernel_function)">mh_optimal_bandwidth</a>(lpmat(ibehaviour,j),length(ibehaviour),bandwidth,kernel_function);
0048 [x1,f1] = <a href="kernel_density_estimate.html" class="code" title="function [abscissa,f] = kernel_density_estimate(data,number_of_grid_points,bandwidth,kernel_function)">kernel_density_estimate</a>(lpmat(ibehaviour,j),number_of_grid_points,<span class="keyword">...</span>
0049 optimal_bandwidth,kernel_function);
0050 plot(x1, f1,<span class="string">':k'</span>,<span class="string">'linewidth'</span>,2)
0051 optimal_bandwidth = <a href="mh_optimal_bandwidth.html" class="code" title="function optimal_bandwidth = mh_optimal_bandwidth(data,n,bandwidth,kernel_function)">mh_optimal_bandwidth</a>(lpmat(inonbehaviour,j),length(inonbehaviour),bandwidth,kernel_function);
0052 [x1,f1] = <a href="kernel_density_estimate.html" class="code" title="function [abscissa,f] = kernel_density_estimate(data,number_of_grid_points,bandwidth,kernel_function)">kernel_density_estimate</a>(lpmat(inonbehaviour,j),number_of_grid_points,<span class="keyword">...</span>
0053 optimal_bandwidth,kernel_function);
0054 hold on, plot(x1, f1,<span class="string">'k'</span>,<span class="string">'linewidth'</span>,2)
0055
0056 title(ftit{j},<span class="string">'interpreter'</span>,<span class="string">'none'</span>)
0057 <span class="keyword">end</span>
0058 saveas(gcf,[dirname,<span class="string">'/'</span>,fname_,<span class="string">'_'</span>,aname,<span class="string">'_'</span>,int2str(i)])
0059 eval([<span class="string">'print -depsc2 '</span> dirname <span class="string">'\'</span> fname_ <span class="string">'_'</span> aname <span class="string">'_'</span> int2str(i)]);
0060 eval([<span class="string">'print -dpdf '</span> dirname <span class="string">'\'</span> fname_ <span class="string">'_'</span> aname <span class="string">'_'</span> int2str(i)]);
0061 <span class="keyword">if</span> options_.nograph, close(gcf), <span class="keyword">end</span>
0062 <span class="keyword">end</span></pre></div>
<hr><address>Generated on Fri 16-Jun-2006 09:09:06 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
</body>
</html>