R Under development (unstable) (2023-10-18 r85349 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(spatsurv) Welcome to 'spatsurv': Spatial Survival Analysis B. M. Taylor & B. S. Rowlingson. Type 'spatsurvVignette()' to view the package vignette. Type 'citation("spatsurv")' to view the citation for this package. Please see the spatsurv package NEWS file for latest additions, changes and bug fixes. > > func <- function(par){ + x <- par[1] + y <- par[2] + z <- par[3] + + return(0 + x + 2*y + 3*z + 2*x^2 + y^2 + 2*z^2 + 3*x*y + 4*x*z + 5*y*z + rnorm(1)) + } > > ans <- QuadApprox(fun=func,npts=10,argRanges=list(c(-5,5),c(-5,5),c(-5,5)),plot=FALSE) Constructing quadratic approximation to posterior (this can take some time) ... Done. Warning in fixmatrix(sigmainv) : Something is wrong with the estimated covariance matrix, fixing this using a totally ad-hoc method. This will not affect ergodicity, merely the efficiency of the chain. Fixing non positive definite covariance matrix for eta ... > print(ans) $max [1] 1.2015495 -0.9670950 -0.7339665 $curvature [,1] [,2] [,3] [1,] -4.016796 0.000000 0.000000 [2,] 0.000000 -2.006319 0.000000 [3,] 0.000000 0.000000 -4.009496 $mod Call: lm(formula = form, data = dataf) Coefficients: (Intercept) x1 x2 x3 x1.2 x2.2 -0.2172 1.0055 2.0082 2.9831 2.0084 1.0032 x3.2 x1x2 x1x3 x2x3 2.0047 2.9996 3.9933 5.0031 > > # ans1 <- quadapprox(fun=func,xseq=seq(-5,5,length.out=20),yseq=seq(-5,5,length.out=20)) > # print(ans1) > > proc.time() user system elapsed 5.10 0.31 5.42