\[\color{#2ECC40}G_{\color{#2ECC40}i}^{\color{#2ECC40}*} = \frac{\color{#FF4136}\sum_{\color{#FF4136}j \color{#FF4136}= \color{#FF4136}1}^\color{#FF4136}{n} \color{#FF4136}w_{\color{#FF4136}i\color{#FF4136}j}\color{#FF4136}x_{\color{#FF4136}j}} {\color{#0074D9}\sum_{\color{#0074D 9}j \color{#0074D9}= \color{#0074D9}1}^{\color{#0074D9}n} \color{#0074D9}x_{\color{#0074D9}j}}\]
donde:
\(\color{#FF4136}\sum_{\color{#FF4136}j \color{#FF4136}= \color{#FF4136}1}^\color{#FF4136}{n} \color{#FF4136}w_{\color{#FF4136}i\color{#FF4136}j}\color{#FF4136}x_{\color{#FF4136}j}\) el numerador, es la suma de los valores \(x_{i}\) de la unidad espacial de interes con sus vecinos \(x_{j}\) &
\(\frac{}{\color{#0074D9}\sum_{\color{#0074D9}j \color{#0074D9}= \color{#0074D9}1}^{\color{#0074D9}n} \color{#0074D9}x_{\color{#0074D9}j}}\) el denominador, es la suma de todos los valores \(x\) en toda la localidad de interes.
Hotspots son las áreas o las unidades espaciales con valores altos de \(\color{#2ECC40}G_{\color{#2ECC40}i}^{\color{#2ECC40}*}\) y homogéneos de la unidad espaciales de interes \(x_{ij}\). En otras palabras el estadístico espacial, identifica las unidades espaciales \(x_{ij}\) con valores altos comparados con el valor promedio de todas la unidades espaciales en la localidad de interes.
Bajar las bases de datos del SINAVE.
Geocodificar las bases.
Generar la base (onset y coordenadas).
Aplicar el Knox test.
Definir los Space-Time link.
Visualizar Space-Time link. ]
\[\color{Orange}{Knox} = \frac{1}{2} \sum_{i=1}^{n} \sum_{i=1}^{n} \color{Green}{S_{ij}} \color{red}{T_{ij}}\] donde:
\(\color{Green}{S_{ij}}\) = 1 si el caso \(( i\ne j)\) & la \(d_{ij} \le \delta^s\) (metros = 400), de lo contrario 0.
\(\color{red}{T_{ij}}\) = 1 si el caso \(( i\ne j)\) & la \(d_{ij} \le \delta^t\) (dÍas = 20), de los contrario 0.
Hipotesis Nula las distancias temporales entre pares de casos son independientes de las distancias espaciales.
Hipotesis Alternativa existe dependencia de las distancias espaciales y temporales entre los pares de casos (existen cadenas de transmisión).
Modelo General \[\varLambda{_s} = exp(n{_s})\] El modelo asume que los casos son una parcial realización de un proceso Gausiano (log-Gaussian).
Modelo en un Grid \[\varLambda_{ij} = \int\limits_{s_{ij}}^{} exp(n(s))ds\] \[\varLambda_{ij} \approx |s_{ij}| exp(n_{ij})\] donde \(|s_{ij}|\) es el área de la celda \(s_{ij}\)
\(y_{ij}|n_{ij} \sim Poisson(|s_{ij}|exp(n_{ij}))\)
\(n_{ij} = \beta{_0} + \beta{_1} \space x \space cov (s_{ij}) + f{_s}(s_{ij}) + f{_u}(s_{ij})\)
\(s{_i}\) sitios de colecta con coordenadas geográficas (longitud. latitud).
\(D\) area de estudio (zona metropolitana de Guadalajara).
\(Y{_i}\) es la variable de respuesta (Número de Huevos por Ovitrampa o Manzana).
\(y{_i}\) tiene una distribución (binomial negativa ó zibn).
\(U{_s{_i}}\) el efecto espacial & el proceso ocurre en un campo gaussiano continuo (Gaussian Field).
Se usa SPDE & Elemento Finito para aproximar la matriz de covarianzas de \(U{_s{_i}}\)
\(\color{#2ECC40}{el \space proceso \space se \space encuentra \space implementado \space en \space INLA}\)
Paquetes en R desarrollados por el Programa (denhotspots & deneggs) para el análisis espacial.
# Step 2. extract the locality #####
x <- rgeomex::extract_ageb(locality = c("Guadalajara", "Zapopan",
"Tlaquepaque", "Tonalá"),
cve_edo = "14")
head(x)
$locality
Simple feature collection with 4 features and 6 fields
Geometry type: POLYGON
Dimension: XY
Bounding box: xmin: -103.4861 ymin: 20.55375 xmax: -103.2139 ymax: 20.79372
Geodetic CRS: WGS 84
CVEGEO CVE_ENT CVE_MUN CVE_LOC NOMGEO AMBITO
1 140390001 14 039 0001 Guadalajara Urbana
2 140980001 14 098 0001 Tlaquepaque Urbana
3 141010001 14 101 0001 Tonalá Urbana
4 141200001 14 120 0001 Zapopan Urbana
geometry
1 POLYGON ((-103.3135 20.7438...
2 POLYGON ((-103.3156 20.6464...
3 POLYGON ((-103.2614 20.6947...
4 POLYGON ((-103.4292 20.7920...
$ageb
Simple feature collection with 1270 features and 9 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: -103.4861 ymin: 20.54882 xmax: -103.2 ymax: 20.79372
Geodetic CRS: WGS 84
First 10 features:
OBJECTID CVEGEO CVE_ENT CVE_MUN CVE_LOC CVE_AGEB Ambito Shape_Leng
23317 23317 1403900013482 14 039 0001 3482 Urbana 3637.262
23318 23318 1403900012696 14 039 0001 2696 Urbana 3432.020
23319 23319 1403900014207 14 039 0001 4207 Urbana 1864.111
23320 23320 1403900013020 14 039 0001 3020 Urbana 4580.413
23321 23321 1403900014194 14 039 0001 4194 Urbana 1955.355
23322 23322 1403900015243 14 039 0001 5243 Urbana 1891.697
23323 23323 1403900015084 14 039 0001 5084 Urbana 2035.218
23324 23324 1403900011927 14 039 0001 1927 Urbana 2194.300
23325 23325 1403900013088 14 039 0001 3088 Urbana 3207.238
23326 23326 140390001051A 14 039 0001 051A Urbana 2767.618
Shape_Area geometry
23317 286365.2 MULTIPOLYGON (((-103.3217 2...
23318 518915.1 MULTIPOLYGON (((-103.3765 2...
23319 169661.8 MULTIPOLYGON (((-103.2781 2...
23320 864900.3 MULTIPOLYGON (((-103.3133 2...
23321 193752.6 MULTIPOLYGON (((-103.2776 2...
23322 144208.2 MULTIPOLYGON (((-103.2712 2...
23323 240413.0 MULTIPOLYGON (((-103.2862 2...
23324 289063.5 MULTIPOLYGON (((-103.3336 2...
23325 522372.5 MULTIPOLYGON (((-103.3103 2...
23326 407880.2 MULTIPOLYGON (((-103.2964 2...
library(magrittr)
library(sf)
z <- denhotspots::point_to_polygons(x = xy,
y = x$ageb,
ids = names(x$ageb)[-10],
time = ANO,
coords = c("long", "lat"),
crs = 4326,
dis = "DENV")
head(z)
Simple feature collection with 6 features and 25 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: -103.3896 ymin: 20.63876 xmax: -103.2692 ymax: 20.7373
Geodetic CRS: WGS 84
OBJECTID CVEGEO CVE_ENT CVE_MUN CVE_LOC CVE_AGEB Ambito Shape_Leng
1 23317 1403900013482 14 039 0001 3482 Urbana 3637.262
2 23318 1403900012696 14 039 0001 2696 Urbana 3432.020
3 23319 1403900014207 14 039 0001 4207 Urbana 1864.111
4 23320 1403900013020 14 039 0001 3020 Urbana 4580.413
5 23321 1403900014194 14 039 0001 4194 Urbana 1955.355
6 23322 1403900015243 14 039 0001 5243 Urbana 1891.697
Shape_Area DENV_2008 DENV_2009 DENV_2010 DENV_2011 DENV_2012 DENV_2014
1 286365.2 0 1 0 0 0 0
2 518915.1 0 1 0 0 0 0
3 169661.8 0 0 0 0 0 0
4 864900.3 0 0 0 0 0 0
5 193752.6 0 1 0 0 0 0
6 144208.2 0 0 0 0 0 0
DENV_2015 DENV_2013 DENV_2016 DENV_2017 DENV_2018 DENV_2019 DENV_2020
1 0 0 0 0 0 11 0
2 0 0 0 0 0 2 0
3 0 1 0 0 0 2 2
4 1 0 0 0 0 3 1
5 1 1 2 0 0 1 0
6 0 0 2 0 0 2 0
DENV_2021 DENV_2022 DENV_2023 geometry
1 0 0 0 MULTIPOLYGON (((-103.3217 2...
2 0 0 0 MULTIPOLYGON (((-103.3765 2...
3 0 0 0 MULTIPOLYGON (((-103.2781 2...
4 0 0 0 MULTIPOLYGON (((-103.3133 2...
5 0 0 0 MULTIPOLYGON (((-103.2776 2...
6 0 0 0 MULTIPOLYGON (((-103.2712 2...
hotspots <- denhotspots::gihi(x = z,
id = names(z)[c(1:9)],
time = "year",
dis = "DENV",
gi_hi = "gi",
alpha = 0.95)
head(hotspots)
Simple feature collection with 6 features and 11 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: -103.3896 ymin: 20.63876 xmax: -103.2692 ymax: 20.7373
Geodetic CRS: WGS 84
OBJECTID CVEGEO CVE_ENT CVE_MUN CVE_LOC CVE_AGEB Ambito Shape_Leng
1 23317 1403900013482 14 039 0001 3482 Urbana 3637.262
2 23318 1403900012696 14 039 0001 2696 Urbana 3432.020
3 23319 1403900014207 14 039 0001 4207 Urbana 1864.111
4 23320 1403900013020 14 039 0001 3020 Urbana 4580.413
5 23321 1403900014194 14 039 0001 4194 Urbana 1955.355
6 23322 1403900015243 14 039 0001 5243 Urbana 1891.697
Shape_Area intensity_gi hotspots_gi geometry
1 286365.2 1 1 MULTIPOLYGON (((-103.3217 2...
2 518915.1 0 0 MULTIPOLYGON (((-103.3765 2...
3 169661.8 1 1 MULTIPOLYGON (((-103.2781 2...
4 864900.3 1 1 MULTIPOLYGON (((-103.3133 2...
5 193752.6 1 1 MULTIPOLYGON (((-103.2776 2...
6 144208.2 0 0 MULTIPOLYGON (((-103.2712 2...
# Step 1. load the dengue geocoded dataset ####
load("/Users/fdzul/Library/CloudStorage/OneDrive-Personal/proyects/geocoding_mex/2023/9.geocoded_dataset/dengue_mx_2023.RData")
# Step 2. extract the dengue cases #####
geocoded_dataset <- z |>
dplyr::filter(ESTATUS_CASO == 2) |>
dplyr::mutate(onset = FEC_INI_SIGNOS_SINT,
date = as.character(onset),
id = VEC_ID) |>
dplyr::mutate(x = long,
y = lat) |>
sf::st_as_sf(coords = c("long", "lat"),
crs = 4326) |>
dplyr::select(x, y, onset)
# Step 3. extract the locality ####
loc <- rgeomex::extract_locality(cve_edo = 31,
locality = "Mérida")
# Step 4. extract the dengue cases of the locality
geocoded_dataset <- geocoded_dataset[loc,] |>
sf::st_drop_geometry()
# Step 5. map of lgcp
x <- denhotspots::spatial_lgcp(dataset = geocoded_dataset,
locality = "Merida",
cve_edo = "31",
longitude = "x",
latitude = "y",
k = 30,
plot = FALSE,
aproximation = "gaussian",
integration = "laplace",
resolution = 0.015,
approach = "lattice",
cell_size = 1500,
name = "YlGnBu")
x$map
# Step 2. load the dengue dataset geocoded ####
load("/Users/fdzul/Library/CloudStorage/OneDrive-Personal/proyects/geocoding_mex/2024/8.RData/denmex_2024.RData")
# step 3. apply the function ####
####
densnv::mp_heatmap(geocoded_dataset = z,
cve_edo = "31",
locality = c("Mérida"),
status_caso = c(1,2),
week = 1:3,
alpha = 0.6,
static = FALSE,
palette = viridis::turbo)
# Step 1. define the path
path_ovitraps <- "/Users/fdzul/Library/CloudStorage/OneDrive-Personal/datasets/CENAPRECE/2023/14_jalisco"
path_coord <- paste(path_ovitraps, "DescargaOvitrampasMesFco.txt", sep = "/")
map_gua <- deneggs::eggs_hotspots(path_lect = path_ovitraps,
path_coord = path_coord,
cve_ent = "14",
locality = c("Guadalajara", "Zapopan",
"Tlaquepaque", "Tonala"),
longitude = "Pocision_X",
latitude = "Pocision_Y",
aproximation = "gaussian",
integration = "eb",
fam = "zeroinflatednbinomial1",
k = 40,
palette_vir = "magma",
leg_title = "Huevos",
plot = FALSE,
hist_dataset = FALSE,
sem = 40, var = "eggs",
cell_size = 5000,
alpha = .99)
Concepto
Mapa de riesgo