Make_Map: Makes the Map argument for TMB, which is used to turn off...

Usage Arguments Examples

Usage

1
Make_Map(VesselConfig, TmbData, FieldConfig, CovConfig, CovConception, ObsModel, Aniso)

Arguments

VesselConfig

Vector describing whether to include vessel effects

TmbData

named list generated by Data_Fn

FieldConfig

Vector describing what types of spatial variation to estimate

CovConfig

Vector describing covariates for spatial variation (advanced feature not used by default)

CovConception

Deprecated and FALSE by default

ObsModel

Integer for distribution of residual 'measurement' error (0=normal (log-link); 1=lognormal; 2=gamma; 4=ZANB; 5=ZINB; 11=lognormal-mixture; 12=gamma-mixture)

Aniso

Use geometric anisotropy for spatial variation (0=no, 1=yes)

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
##---- 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 (VesselConfig, TmbData, FieldConfig, CovConfig, CovConception, 
    ObsModel, Aniso) 
{
    Map = list()
    if (VesselConfig["Vessel"] == 0) {
        Map[["nu1_v"]] = factor(rep(NA, TmbData$n_v))
        Map[["nu2_v"]] = factor(rep(NA, TmbData$n_v))
        Map[["logsigmaV1"]] = factor(NA)
        Map[["logsigmaV2"]] = factor(NA)
    }
    if (VesselConfig["VesselYear"] == 0) {
        Map[["nu1_vt"]] = factor(matrix(NA, nrow = TmbData$n_v, 
            ncol = TmbData$n_t))
        Map[["nu2_vt"]] = factor(matrix(NA, nrow = TmbData$n_v, 
            ncol = TmbData$n_t))
        Map[["logsigmaVT1"]] = factor(NA)
        Map[["logsigmaVT2"]] = factor(NA)
    }
    if (FieldConfig["Omega1"] == 0) {
        Map[["Omegainput1_s"]] = factor(rep(NA, TmbData$n_s))
        Map[["logetaO1"]] = factor(NA)
    }
    if (FieldConfig["Epsilon1"] == 0) {
        Map[["Epsiloninput1_st"]] = factor(matrix(NA, nrow = TmbData$n_s, 
            ncol = TmbData$n_t))
        Map[["logetaE1"]] = factor(NA)
    }
    if (FieldConfig["Omega1"] == 0 & FieldConfig["Epsilon1"] == 
        0) 
        Map[["logkappa1"]] = factor(NA)
    if (FieldConfig["Omega2"] == 0) {
        Map[["Omegainput2_s"]] = factor(rep(NA, TmbData$n_s))
        Map[["logetaO2"]] = factor(NA)
    }
    if (FieldConfig["Epsilon2"] == 0) {
        Map[["Epsiloninput2_st"]] = factor(matrix(NA, nrow = TmbData$n_s, 
            ncol = TmbData$n_t))
        Map[["logetaE2"]] = factor(NA)
    }
    if (FieldConfig["Omega2"] == 0 & FieldConfig["Epsilon2"] == 
        0) 
        Map[["logkappa2"]] = factor(NA)
    if (sum(CovConfig) == 0 & CovConception == FALSE) {
        Map[["gamma1_j"]] = factor(NA)
        Map[["gamma2_j"]] = factor(NA)
    }
    if (ObsModel %in% c(0, 1, 2)) {
        Map[["logSigmaM"]] = factor(c(1, NA, NA))
    }
    if (ObsModel %in% c(4, 5)) {
        Map[["logSigmaM"]] = factor(c(1, NA, 2))
    }
    if (Aniso == 0 | all(FieldConfig == 0)) 
        Map[["ln_H_input"]] = factor(rep(NA, 2))
    return(Map)
  }

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