uvector {resde} | R Documentation |
ML estimation vector for reducible SDEs
Description
These functions are not normally called directly by the user.
Function uvector()
is used by sdefit()
. Function
uvector_noh()
is a more limited version, maintained for documentation
purposes. Function logdet_and_v()
is used by uvector()
and
uvector_noh()
.
Usage
uvector(x, t, unit = NULL, beta0, beta1, eta, eta0, x0, t0, lambda,
mum = 1, mu0 = 1, mup = 1, sorted = FALSE, final = FALSE)
uvector_noh(x, t, beta0, beta1, eta, eta0, x0, t0, lambda, final = FALSE)
logdet.and.v(cdiag, csub = NULL, z)
Arguments
x , t |
Data vectors |
unit |
Unit id vector, if any. |
beta0 , beta1 , eta , eta0 , x0 , t0 |
SDE parameters or re-parameterizations. |
lambda |
Named list of parameters(s) for |
mum , mu0 , mup |
Optional |
sorted |
Data already ordered by increasing t? |
final |
Mode, see below. |
cdiag |
Vector with the diagonal elements |
csub |
Vector with sub-diagonal |
z |
A numeric vector |
Details
uvector()
and uvector_noh()
calculate a vector of
residuals for sum of squares minimization by nls()
or nlme()
.
The first one works both for single-unit and for bilevel hierarchical models.
It is backward-compatible with uvector_noh()
, which is only for
single-unit models but simpler and easier to understand. They require a
transformation function phi(x, theta)
, and a function
phiprime(x, theta)
for the derivative dy/dx, where theta
is a
list containing the transformation parameters.
logdet_and_v()
calculates \log[\det(L)]
and v
= L^{-1} z
, where C = LL'
, with L
lower-triangular.
The three functions are essentially unchanged from GarcĂa (2019)
<doi:10.1007/s00180-018-0837-4>, except for a somewhat safer computation
for very small beta1
, and adding in logdet_and_v()
a shortcut
for when L
is diagonal (e.g., when \sigma_m = 0
). The
transformation functions phi
and phiprime
can be passed as
globals, as in the original, or in an environment named trfuns
.
Value
uvector()
and uvector_noh()
: If final = FALSE
(default), return a vector whose sum of squares should be minimized over the
parameters to obtain maximum-likelihood estimates. If final = TRUE
,
passing the ML parameter estimates returns a list with the sigma estimates,
the maximized log-likelihood, and AIC and BIC criteria..
logdet_and_v()
: List with elements logdet
and v
.
Functions
-
uvector()
: Estimation vector, general -
uvector_noh()
: Estimation vector, non-hierarchical -
logdet.and.v()
: Logarithm of determinant, andv
vector