diff --git a/matlab/load_all_distributions.m b/matlab/load_all_distributions.m index f468abec9fcd076224051af4dbfccd32a323561d..d46def2d2e938aa0a4990fb9b5c54296a34275a9 100644 --- a/matlab/load_all_distributions.m +++ b/matlab/load_all_distributions.m @@ -8,5 +8,9 @@ particles = NaN(nparticles, n); for i=1:n p = load(sprintf('%s%shssmc%sparticles-%u-%u.mat', modelname, filesep, filesep, i, n)); + if isfield(p, 'weights') + iresample = kitagawa(p.weights); + p.particles = p.particles(:,iresample); + end particles(:,i) = transpose(p.particles(idparam,:)); end diff --git a/matlab/plot_all_distributions.m b/matlab/plot_all_distributions.m index c164c056edc0a3ad95255a3c8e98af3a784ad650..a0fe546e10fe9b441c7acb506dc96c500b4293dd 100644 --- a/matlab/plot_all_distributions.m +++ b/matlab/plot_all_distributions.m @@ -15,11 +15,18 @@ function densities = plot_all_distributions(modelname, nparticles, idparam) densities{i,2} = f; end + figure; + axes1 = axes; + hold(axes1,'on'); plot3(densities{1,1}, ones(512,1), densities{1,2}, '-k') hold on for i=2:25, plot3(densities{i,1}, i*ones(512,1), densities{i,2}, '-k'), end - view(axes1,[-31.1204379546341 14.8026428177991]); + view(axes1,[-17.2002668752499 20.7729498300686]); axis tight grid on hold off + zlabel('Density'); + ylabel('SMC steps','Rotation',-45); + xlabel('\rho'); + hold(axes1,'off'); end diff --git a/model/distributions.fig b/model/distributions.fig index 600949902a484d2fdab33677620d885e2a88de65..8d2d146790dfa3622483bc442d10f0452b5da5ad 100644 Binary files a/model/distributions.fig and b/model/distributions.fig differ diff --git a/model/distributions.tex b/model/distributions.tex index c69e8ec12cc149eebf738af0d8ce8c9cfba95f45..7a933912e23b786ba515befa60497e5543e21b10 100644 --- a/model/distributions.tex +++ b/model/distributions.tex @@ -1,18 +1,24 @@ \begin{tikzpicture} \begin{axis}[% -width=11.42in, -height=8.512in, -at={(1.916in,1.149in)}, +width=6.028in, +height=4.754in, +at={(1.011in,0.642in)}, scale only axis, xmin=-0.333300382566031, xmax=1.33320153026412, tick align=outside, +xlabel style={font=\color{white!15!black}}, +xlabel={$\rho$}, ymin=1, ymax=25, +ylabel style={font=\color{white!15!black}}, +ylabel={SMC steps}, zmin=-7.56339435525888e-16, zmax=6.43962121896579, -view={-31.1204379546341}{14.8026428177991}, +zlabel style={font=\color{white!15!black}}, +zlabel={Density}, +view={-17.2002668752499}{20.7729498300686}, axis background/.style={fill=white}, axis x line*=bottom, axis y line*=left, @@ -12897,24 +12903,4 @@ zmajorgrids 1.11922185468259 25 1.11022302462516e-16\\ }; \end{axis} - -\begin{axis}[% -width=14.736in, -height=10.444in, -at={(0in,0in)}, -scale only axis, -xmin=0, -xmax=1, -ymin=0, -ymax=1, -xlabel=$\mathbf{\rho}$, -xlabel style = {xshift=6cm,yshift=3cm}, -ylabel= \textbf{Density}, -ylabel style = {xshift=0cm,yshift=-4cm}, -axis line style={draw=none}, -ticks=none, -axis x line*=bottom, -axis y line*=left -] -\end{axis} \end{tikzpicture}% diff --git a/tex/slides.tex b/tex/slides.tex index c119604413307793a9788ade330a47fd7d36c66d..0284f7db6509da24a12f0c4e28932a7d3d29aefd 100644 --- a/tex/slides.tex +++ b/tex/slides.tex @@ -295,7 +295,7 @@ posterior_sampling_options = ('particles', 20000, \frametitle{Sequential importance sampling, V} \begin{center} - \resizebox{\textwidth}{!}{\input{../model/distributions.tex}} + \resizebox{.95\textwidth}{!}{\input{../model/distributions.tex}} \end{center} \end{frame}