Calc_Anisotropic_Mesh: Calculates mesh and generates elements for anisotropic random...

Usage Arguments Examples

Usage

1

Arguments

loc_x

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (loc_x) 
{
    mesh = inla.mesh.create(loc_x, plot.delay = NULL, refine = FALSE)
    spde = inla.spde2.matern(mesh, alpha = 2)
    Dset = 1:2
    TV = mesh$graph$tv
    V0 = mesh$loc[TV[, 1], Dset]
    V1 = mesh$loc[TV[, 2], Dset]
    V2 = mesh$loc[TV[, 3], Dset]
    E0 = V2 - V1
    E1 = V0 - V2
    E2 = V1 - V0
    TmpFn = function(Vec1, Vec2) abs(det(rbind(Vec1, Vec2)))
    Tri_Area = rep(NA, nrow(E0))
    for (i in 1:length(Tri_Area)) Tri_Area[i] = TmpFn(E0[i, ], 
        E1[i, ])/2
    Return = list(Tri_Area = Tri_Area, TV = TV, E0 = E0, E1 = E1, 
        E2 = E2, mesh = mesh, spde = spde)
    return(Return)
  }

aaronmberger/Geo_dGLMM_habitat documentation built on May 10, 2019, 3:20 a.m.