Lower bound flux uncertainty and adjust prior uncertainty before calling optimLRC

LRC_optimLRCOnAdjustedPrior(theta, iOpt, dsDay, parameterPrior, ctrl, ...)

Arguments

theta

numeric vector of starting values

iOpt

integer vector: positions of subset of parameters that are optimized

dsDay

dataframe of NEE, sdNEE and predictors Rg, VPD and Temp

parameterPrior

numeric vector of prior parameter estimates (corresponding to theta)

ctrl

list of further controls

...

further arguments to LRC_optimLRC() (passed to LRC_computeCost())

Value

list of result of LRC_optimLRC() amended with list theta, iOpt and convergence

Details

Only those records are used for optimization where both NEE and sdNEE are finite. In larger settings, already filtered at partGLFitLRCOneWindow

Optimization of LRC parameters takes into account the uncertainty of the flux values. In order to avoid very strong leverage, values with a very low uncertainty (< a lower quantile) are assigned the lower quantile is assigned. This procedure downweighs records with a high uncertainty, but does not apply a large leverage for records with a very low uncertainty. Avoid this correction by setting ctrl$isBoundLowerNEEUncertainty = FALSE