Hals.ses {widals} | R Documentation |
Effective Standard Errors
Description
Calculate the ALS so-called 'effective standard errors'
Usage
Hals.ses(Z, Hs, Ht, Hst.ls, rho, reg, b.lag, test.rng)
Arguments
Z |
Space-time data. A |
Hs |
Spacial covariates (of supporting sites). An |
Ht |
Temporal covariates (of supporting sites). A |
Hst.ls |
Space-time covariates (of supporting sites). A list of length |
rho |
ALS signal-to-noise ratio (SNR). A non-negative scalar. |
reg |
ALS regularizer. A non-negative scalar. |
b.lag |
ALS lag. A scalar integer, typically -1 (a-prior), or 0 (a-posteriori). |
test.rng |
Temporal test range. A vector of temporal indices of the model test range. |
Value
A named list.
estimates |
A |
inv.LHH |
A |
ALS.g |
The ALS gain at time |
Examples
## Please see the example in H.als.b
## The function is currently defined as
function (Z, Hs, Ht, Hst.ls, rho, reg, b.lag, test.rng)
{
tau <- nrow(Z)
xALS <- H.als.b(Z = Z, Hs = Hs, Ht = Ht, Hst.ls = Hst.ls,
rho = rho, reg = reg, b.lag = b.lag, Hs0 = NULL, Ht0 = NULL,
Hst0.ls = NULL)
rmse <- sqrt(mean((Z[test.rng, ] - xALS$Z.hat[test.rng, ])^2))
rmse
als.se <- rmse * sqrt(xALS$ALS.g) * sqrt(diag(xALS$inv.LHH))
return(list(estimates = cbind(xALS$B[tau, ], als.se), inv.LHH = xALS$inv.LHH,
ALS.g = xALS$ALS.g))
}