stLL {telefit} | R Documentation |
Compute log likelihood for model
Description
Compute log likelihood for model
Usage
stLL(
stData,
stFit,
beta,
sigmasq_y,
sigmasq_r,
sigmasq_eps,
rho_y,
rho_r,
X = stData$X,
Y = stData$Y,
Z = stData$Z,
coords.s = stData$coords.s,
coords.r = stData$coords.r,
coords.knots = stFit$coords.knots,
miles = TRUE,
sigmasq_r_eps
)
Arguments
stData |
Object with class 'stData' containing data needed to fit this model. The data need only be manually entered if not using a stData object. |
stFit |
Object with class 'stFit' containing posterior parameter samples needed to composition sample the teleconnection effects and generate posterior predictions. The data needed from stFit need only be manually entered if not using a stData object. |
beta |
values of |
sigmasq_y |
values of |
sigmasq_r |
values of |
sigmasq_eps |
values of |
rho_y |
values of |
rho_r |
values of |
X |
[ns, p, nt] array of design matrices with local covariates |
Y |
[ns, nt] matrix with response data |
Z |
[nr, nt] matrix with remote covariates |
coords.s |
matrix with coordinates where responses were observed (lon, lat) |
coords.r |
matrix with coordinates where remote covariates were observed (lon, lat) |
coords.knots |
matrix with coordinates of knots for remote covariates (lon, lat) |
miles |
TRUE if distances should be computed in miles (kilometers otherwise) |
sigmasq_r_eps |
values of |
Examples
library(dplyr)
library(foreach)
library(itertools)
set.seed(2018)
data("coprecip")
data("coprecip.fit")
attach(coprecip)
ests = coef(coprecip.fit, burn = 50)
ll = stLL(stData = coprecip, stFit = coprecip.fit,
beta = matrix(ests$beta, ncol = 2),
sigmasq_y = ests$sigmasq_y, sigmasq_r = ests$sigmasq_r,
sigmasq_eps = ests$sigmasq_eps,
rho_y = ests$rho_y, rho_r = ests$rho_r,
sigmasq_r_eps = 0)