mc_err_proj | R Documentation |
Function to propagate combined errors on x
(= Dsam
) and
y
(= Osam
) on the modeled X (= D
) and Y
(= d18Oc
) values by means of direct projection of y–uncertainty
on x
and then combine the errors on both in the x
domain
mc_err_proj(x, x_err, y, y_err, X, Y, MC = 1000)
x |
Vector of |
x_err |
Vector of uncertainties on |
y |
Vector of |
y_err |
Vector of uncertainties on |
X |
Vector of modeled |
Y |
Matrix of modeled x and |
MC |
Number of Monte Carlo simulations to apply for error propagation Default = 1000 |
Note: projection y_err on x_err leads to large X errors on shallow slopes due to numerical calculation of fist derivative.
A vector listing the standard deviations of propagated errors
propagated on all X
values.
# Create dummy data for input x <- seq(1, 40, 1) x_err <- rep(0.1, 40) y <- sin((2 * pi * (seq(1, 40, 1) - 8 + 30 / 4)) / 30) y_err <- rep(0.1, 40) X <- seq(1.5, 39.5, 1) Y <- cbind(seq(1, 39, 1), 0.9 * sin((2 * pi * (seq(1, 39, 1) - 9 + 25 / 4)) / 25)) # Run function result <- mc_err_proj(x, x_err, y, y_err, X, Y, 1000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.