View source: R/LoopParamSpace.R
LoopParamSpace | R Documentation |
Loop over a given parameter space of advection, diffusion and densification values to modify a given record accordingly, and return the overall minimum root mean square deviation (RMSD) to a reference record.
LoopParamSpace(rec.in, reference, res, depth, advSpace, sigmaSpace, densfSpace)
rec.in |
numeric vector with the input record which is modified according to the given parameter spaces of advection, diffusion and densification. |
reference |
numeric vector with a reference record against which the
root mean square deviation of the modified record is calculated; must be of
the same length as |
res |
the depth resolution of |
depth |
the depth scale of the records; must be in the same units as
|
advSpace |
numeric vector of downward advection values to loop over; in
the same units as |
sigmaSpace |
numeric vector of differential diffusion length values to
loop over; in the same units as |
densfSpace |
numeric vector of compression values from densification to
loop over; in the same units as |
Note that all NA's are stripped from the input record before the computation process. This is problematic for the diffusion calculation in case of a large number of internal NA's.
Note further that for computational efficiency, the implemented order of modifications is (1) downward advection, (2) diffusion, and (3) compression from densification. This is slightly unphysical since the diffusional smoothing so acts over the uncompressed depth scale. However, it affects the results only slightly in the domain of high diffusion lengths and high compression values, and does not affect the main results discussed in Münch et al. (2017).
A list with nine components:
a copy of advSpace
;
a copy of sigmaSpace
;
a copy of densfSpace
;
the optimal advection value;
the optimal diffusion length;
the optimal compression value;
an array of dimension length(sigmaSpace)
x
length(densfSpace)
which contains the optimal advection values at
which, for fixed compression and diffusion, the RMSD between the
reference and the modified input record is minimal;
an array of dimension length(advSpace)
x
length(sigmaSpace)
x length(densfSpace)
which contains the
RMSD value between the reference and the modified input record for every
combination of downward advection, diffusion and compression;
the array RMSD
projected onto the optimal
downward-advection value.
Thomas Münch
Münch, T., et al., Constraints on post-depositional isotope modifications in East Antarctic firn from analysing temporal changes of isotope profiles, The Cryosphere, 11(5), 2175-2188, doi:10.5194/tc-11-2175-2017, 2017.
DiffuseRecord
; CompressRecord
;
?ParamSpace
# Run the analysis for Fig. (5) in Münch et al. (2017)
# (note that this takes some amount of computation time):
TR <- TrenchR:::prepareTrenchData()$oxy
ParamSpace <- LoopParamSpace(rec.in = TR$mean13_HiRes,
reference = TR$mean15_HiRes,
res = TR$HiRes, depth = TR$depth_HiRes,
advSpace = seq(40, 60, 0.5),
sigmaSpace = seq(0, 8, 0.1),
densfSpace = seq(0, 10, 0.1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.