Learn R Programming

RBaM (version 1.1.1)

llfunk_iLinear_Gaussian: Log-likelihood function: independent-linear Gaussian

Description

Computes the log-likelihood from model-simulated values based on a Gaussian independent error model with linearly-varying standard deviation:

  • Yobs = Ysim + delta + epsilon

  • Measurement errors: delta~ N(0,sdev=Yu)

  • Structural errors: epsilon~ N(0,sdev=g1+g2*|Ysim|)

If Yobs/Ysim are multi-variate, this error model is applied independently to each component.

Usage

llfunk_iLinear_Gaussian(Ysim, Yobs, Yu, gamma)

Value

A numeric value equal to the log-likelihood.

Arguments

Ysim

data frame, model-simulated values.

Yobs

data frame, corresponding observed values, same dimensions as Ysim. NAs are skipped.

Yu

data frame, measurement uncertainties (standard deviations), same dimensions as Ysim and Yobs.

gamma

numeric vector, structural error parameters, organized as: gamma=c((g1,g2) for the 1st component of Ysim,(g1,g2) for the 2nd component of Ysim, etc.) => length(gamma) = 2*(number of columns in Ysim).

Examples

Run this code
Yobs=SauzeGaugings['Q']
Yu=SauzeGaugings['uQ']
Ysim=100*(SauzeGaugings['H']+0.5)^1.6
llfunk_iLinear_Gaussian(Ysim,Yobs,Yu,gamma=c(1,0.1))

Run the code above in your browser using DataLab