Activity feedback

  • Do not submit last week’s activity.
    • Double-check what you submitted on Avenue!
  • We have two activities each week, and you need to submit both in each submission.
  • A small \(p\)-value (\(<0.05\)) in the \(\chi^2\) test indicates that the point pattern is not random and shows spatial dependence.

Mathematical notation remainder

Summation notation (\(\sum\)):

\[ \sum_{i=1}^Qx_i=x_1 + x_2 + \cdots + x_Q \]

For all notation (\(\forall\)):

\[ x_k = 1 \hspace{0.2cm} \forall k\rightarrow x=1 \]

\(\chi^2\) distribution

Strictly non-negative, right-skewed, and non-symmetric.

Cumulative distribution function

\(F_X(x)=P(X \leq x)\)

\(\hat{G}\)-function

\[ \hat{G}(r) = \frac{1}{n(\mathbf x)}\sum_{i}\mathbf 1\{d_i \le r\} \]

The \(\hat{G}\) function represents the number of elements in the set of distances up to some threshold \(r\), normalized by the total number of points \(n\) in point pattern \(\mathbf{x}\).

Pipe operator in R

The |> is the native pipe operator introduced in R 4.1.0.

The old pipe operator is %>% from magrittr package.

It allows chained expressions in place of nested expressions to improve code readability.

v <- c(1, 2, 3, 4, 5)
sum(sqrt(v))
[1] 8.382332
v |> 
  sqrt() |>
  sum()
[1] 8.382332

Do not confuse it with + in ggplot2; they are not the same thing.

Packages we use today

Load the following three packages.

library(isdas)
library(sf)
library(tidyverse)
library(spatstat)

If you have trouble restoring the reproducible environment, you need to manually install the packages first.

install.packages("remotes")
remotes::install_github("paezha/isdas")

install.packages("sf")

install.packages("tidyverse")

install.packages("spatstat")

Activities for today

  • We will work on the following chapter from the textbook:
    • Chapter 12: Activity 5: Point Pattern Analysis II
    • Chapter 14: Activity 6: Point Pattern Analysis III
  • The hard deadline is Friday, February 7.

Reference