
Extract the penalized log likelihood for a PrestoGP model.
Source:R/PrestoGP_Model.R
get_pen_loglik-PrestoGPModel-method.RdThis method extracts the (negative) penalized log likelihood for a PrestoGP model.
References
Messier, K.P. and Katzfuss, M. "Scalable penalized spatiotemporal land-use regression for ground-level nitrogen dioxide", The Annals of Applied Statistics (2021) 15(2):688-710.
Examples
data(soil)
soil <- soil[!is.na(soil[,5]),] # remove rows with NA's
y <- soil[,4] # predict moisture content
X <- as.matrix(soil[,5:9])
locs <- as.matrix(soil[,1:2])
soil.vm <- new("VecchiaModel", n_neighbors = 10)
soil.vm <- prestogp_fit(soil.vm, y, X, locs)
#>
#> Estimating initial beta...
#> Estimation of initial beta complete
#>
#> Beginning iteration 1
#> Estimating theta...
#> Estimation of theta complete
#> Estimating beta...
#> Estimation of beta complete
#> Iteration 1 complete
#> Current penalized negative log likelihood: 487.6132
#> Current MSE: 9.104869
#> Beginning iteration 2
#> Estimating theta...
#> Estimation of theta complete
#> Estimating beta...
#> Estimation of beta complete
#> Iteration 2 complete
#> Current penalized negative log likelihood: 482.3724
#> Current MSE: 9.041921
#> Beginning iteration 3
#> Estimating theta...
#> Estimation of theta complete
#> Estimating beta...
#> Estimation of beta complete
#> Iteration 3 complete
#> Current penalized negative log likelihood: 482.1576
#> Current MSE: 9.036236
#> Beginning iteration 4
#> Estimating theta...
#> Estimation of theta complete
#> Estimating beta...
#> Estimation of beta complete
#> Iteration 4 complete
#> Current penalized negative log likelihood: 482.1385
#> Current MSE: 9.026094
#> Beginning iteration 5
#> Estimating theta...
#> Estimation of theta complete
#> Estimating beta...
#> Estimation of beta complete
#> Iteration 5 complete
#> Current penalized negative log likelihood: 481.8444
#> Current MSE: 9.0499
#> Beginning iteration 6
#> Estimating theta...
#> Estimation of theta complete
#> Estimating beta...
#> Estimation of beta complete
#> Iteration 6 complete
#> Current penalized negative log likelihood: 481.8396
#> Current MSE: 9.047716
#> Beginning iteration 7
#> Estimating theta...
#> Estimation of theta complete
#> Estimating beta...
#> Estimation of beta complete
#> Iteration 7 complete
#> Current penalized negative log likelihood: 481.8396
#> Current MSE: 9.0499
get_pen_loglik(soil.vm)
#> [1] 481.8396