LoopParamSpace: Loop over parameter space to find minimum RMSD

View source: R/LoopParamSpace.R

LoopParamSpaceR Documentation

Loop over parameter space to find minimum RMSD

Description

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.

Usage

LoopParamSpace(rec.in, reference, res, depth, advSpace, sigmaSpace, densfSpace)

Arguments

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 rec.in.

res

the depth resolution of rec.in and reference.

depth

the depth scale of the records; must be in the same units as res.

advSpace

numeric vector of downward advection values to loop over; in the same units as res. Advection values can be zero or negative, but the absolute non-zero values must be larger than res.

sigmaSpace

numeric vector of differential diffusion length values to loop over; in the same units as res.

densfSpace

numeric vector of compression values from densification to loop over; in the same units as res.

Details

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).

Value

A list with nine components:

adv:

a copy of advSpace;

sigma:

a copy of sigmaSpace;

densf:

a copy of densfSpace;

adv.opt:

the optimal advection value;

sigma.opt:

the optimal diffusion length;

densf.opt:

the optimal compression value;

adv.opt.arr:

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;

RMSD:

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;

RMSD.opt:

the array RMSD projected onto the optimal downward-advection value.

Author(s)

Thomas Münch

References

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.

See Also

DiffuseRecord; CompressRecord; ?ParamSpace

Examples

# 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))


EarthSystemDiagnostics/TrenchR documentation built on Sept. 2, 2023, 3:44 a.m.