I’m trying to visualize parameter uncertainty in results from the Turing
package. For each parameter, there is a vector of realizations of the parameter. If I use the StatsPlots
package, function density
allows me to plot the probability density function computed from each vector. However, I’d like to display how pairs of parameters co-vary. Three possible ways to do this for parameter realizations pr1 and pr2:
- scatter(pr1,pr2) gives a scatter plot. Darker areas in the plot correspond to higher probability of parameter pairs.
- histogram2(pr1,pr2,bins=N) gives a 2D histogram, where color-coding determines high probability.
- it should also be possible to fit a function f: \mathbb{R}\times \mathbb{R} \rightarrow \mathbb{R}_0^+ to a histogram, and do a contour plot of f to illustrate how the parameters co-vary.
Two questions…
- In my case, each parameter vector of realizations contain in the order of 10^4 elements. When I save a
scatter
plot as an SVG file, the file becomes very large, and when I insert this in a LaTeX document, the printing of the resulting pdf document crashes because of the file size.
- Is there a way to reduce the file size? (Save the
scatter
plot as pdf, png, etc.??). What is the recommendation?
- If I produce a histogram, the resulting SVG file is also quite large.
- Same question as for
scatter
plot.
- I can always create a 2d histogram and use, say, Flux, or some other tool to fit a surface to the histogram – or some other kind of curve fitting or interpolation (e.g., second order spline interpolation, or something). I assume that I can then produce a contour plot using Plots.
- what is the simplest/best way to produce such a surface function?
- do you think this will produce a smaller plot file?
I’m grateful for any recommendation as to best practice.