text:
\section{Introduction}
\label{sec:intro}

The analysis of a point pattern, given as a collection of points in a region, typically begins with computing an estimate of some summary statistic which which may be used to find specific structures in the data and suggest suitable models \citep{chiu:stoyan:kendall:mecke:13,daley:vere-jones:08,gelfand:diggle:guttorp:fuentes:10,illian:penttinen:stoyan:stoyan:08,van2000markov}.
The choice of summary statistic depends both on the pattern at hand and on the feature or hypothesis of interest.

A widely used summary statistic for descriptive analyses and diagnostics, which is obtained as an instance of the so-called reduced second moment measure \citep{cressie2001analysis,chiu:stoyan:kendall:mecke:13,moller:03}, is Ripley's $K$-function \citep{ripley:76}, which is based on the assumption of a non-marked stationary and isotropic point process.
In the marked case, assuming discrete marks
and
stationarity, cross versions of the $K$- or nearest neighbour distance distribution functions
have been proposed
\citep{diggle:13}. For real-valued marks, the mark correlation type-functions in \cite{penttinen1989statistical,illian:penttinen:stoyan:stoyan:08} are widely used and such second order statistics have been studied in more detail and reformulated by \cite{schlather2001second}, in order to obtain a more rigorous formulation.
However, although the assumption of stationarity is mathematically appealing,  unfortunately it can rarely be justified in practice, where, mostly, the intensity tends to change over the study region.
This is to say that the underlying point process is inhomogeneous and, in the unmarked case, \cite{baddeley2000non} proposed an inhomogeneous extension of the $K$-function for a class of point processes, which are referred to as second order intensity-reweighted stationary. Their ideas were extended to spatio-temporal point processes in \cite{gabriel:diggle:09,moller:mohammad:12}.
Further, \cite{moller:waagepetersen:04} proposed an extension of this $K$-function to second order intensity-reweighted stationary multivariate point processes.
As indicated in \cite{cronie2016summary,iftimi2019second}, this structure may be extended to $K$-functions for general marked point processes.
To analyse higher order interactions in general stationary marked point processes, \cite{van2006j} proposed marked versions of the nearest neighbour distance distribution functions, the empty space function and the $J$-function. These summary statistics, which allow us to study spatial interactions between different mark groupings of the points,
were later extended to the inhomogeneous setting by \cite{cronie2016summary,iftimi2019second}. In particular, to test for random labelling, \cite{cronie2016summary} proposed inhomogeneous Lotwick-Silverman-type Monte Carlo tests based on their new summary statistics, while \cite{iftimi2019second} proposed second order Monte Carlo tests based on permuting the attached marks.
Further details on the random shift-type testing considered in Lotwick-Silverman-type tests can be found in \cite{mrkvivcka2021revisiting}.

Despite the relatively long history of point process theory \citep[see e.g.][]{diggle:13,stoyan:stoyan:94,daley:vere-jones:08}, few approaches have been
proposed
to analyse spatial point patterns where the features of interest are functions/curves instead of qualitative or quantitative variables.
Examples of point patterns with associated functional data include forest patterns where for each tree we have a growth function, curves representing the incidence of an epidemic over a period of time, and the evolution of distinct economic parameters such as unemployment and price rates, all for distinct spatial locations. The study of such configurations allows analysing the effects of the spatial structure on individual functions.
\cite{illian2006principal} consider for each point a transformed \cite{ripley:76}'s $K$-function to characterise spatial point patterns of ecological plant communities, whilst \cite{mateu:lorenzo:porcu:07} build new marked point processes formed by spatial locations and curves defined in terms of Local Indicators of Spatial Association (LISA) functions, which describe local characteristics of the points.
They use this approach to classify and discriminate between points belonging to a clutter and those belonging to a feature.
Finally, the idea of analysing point patterns with attached functions has been presented coherently by \cite{comas2011second,ghorbani2021functional}.

\citet{ghorbani2021functional} introduced a very broad framework for the analysis of Functional Marked Point Processes (FMPPs), indicating how they connect the point process framework with both Functional Data Analysis (FDA; \cite{ramsay2002applied}) and geostatistics.
In particular, they defined a new family of summary statistics, so-called \textit{weighted $n$-th order marked inhomogeneous $K$-functions}, together with their non-parametric estimators,
which they exploited to analyse Spanish population structures, such as demographic evolution and sex ratio over time.
This summary statistic family can be used to run a Monte Carlo test of random labelling, e.g.~by means of global envelopes test (GET; \cite{myllymaki2017global}), to assess whether the functional marks of the analysed pattern are spatially dependent.
However, this procedure is essentially global, since it does not provide information on the points which mostly contributed to the rejection of the random labelling hypothesis.
Therefore, motivated by the need of
detecting such points, and thus the regions in which they are located, where the functional marks really do depend on the surrounding structure, in this paper we introduce a new class of summary statistics,  \textit{local $t$-weighted marked $n$-th order inhomogeneous $K$-functions}. These are used to propose a \textit{local test of random labelling}. Here $t$ refers to a function which governs how much weight we put on different aspects of the marked point process/pattern.

Further, we use the developed tools to analyse seismic data.
Note that while the spatial (and temporal) locations of the epicenters of
earthquakes are typically analysed within the framework of point processes, the associated seismic waveforms are commonly investigated in separate analyses through FDA.
Applying the local test allows us to identify where one would expect waveforms (i.e. functional marks) to be similar to those of nearby points.

All the performed analyses
are carried out through the \cite{R} software, and the codes are available from the first author. Preliminary data manipulation is performed through the software Python \citep{van1995python}.

The structure of the paper is as follows.
In Section \ref{sec:data}, the motivation of this paper is presented, showing the dataset and problem that will be further analysed along the paper.
Section \ref{sec:preliminaries} contains some preliminaries on functional marked point processes. In Section \ref{sec:proposal}, we present our proposed local t-weighted
$n$-th order
inhomogeneous $K$-functions and their main properties, also relating them to their global counterparts. Section \ref{sec:test} outlines the main steps to run a local test of random labelling.
In Section \ref{sec:sims}, we present a motivating example to show the further advantages of a local test, compared to a
global
one.
To have a comprehensive understanding of the performance of the proposed local test, we show simulation results under different scenarios.
Section \ref{sec:real} provides an application to seismic data.
Finally, conclusions are drawn in Section \ref{sec:conc}.

\section{Data and motivation }
\label{sec:data}

\begin{figure}[htb]
	\centering
		\includegraphics[width=.75\textwidth]{png2pdf.pdf}
\includegraphics[width=.75\textwidth]{png2pdf2.pdf}
	\caption{\textit{Top-left panel:} Earthquake locations; \textit{Top-right panel:} Seismic stations used for waveforms extraction. The symbol sizes are proportional to earthquake magnitude and number of arrival phases recorded by stations, respectively; \textit{Bottom panels}: Seismic waveforms of some events with magnitude in the range $[2, 4]$.
	 \textit{Source: \cite{michelini2021instance}}.}
	\label{fig:instance}
\end{figure}

Earthquakes' detection
provides a whole set of data which are usually studied separately, i.e. spatial (and temporal) occurrence
of points through point process theory (\cite{siino2017spatial,iftimi2019second,dangelo2021locall}, to cite just a few recent works),
and the analysis of waveforms through FDA \citep{adelfio2011fpca,adelfio2012simultaneous,chiodi2013clustering}.

A recently released set of data on Italian seismic activity encompasses both of these data types.
\textit{The Italian seismic dataset for machine learning (INSTANCE)} is a dataset of seismic waveforms data and associated metadata \citep{michelini2021instance}, which includes 54008 earthquakes for a total of 1159249 3-channel waveforms. It also contains 132330 3-channel noise waveforms.
For each of these waveforms,
115 metadata (i.e.\ statistical variables) are available, providing information on station, trace, source, path and quality. Overall, the data are collected by 19 networks which consist of 620 seismic stations.
The dataset is available on \url{http://www.pi.ingv.it/instance/}.

The earthquake list
in the dataset
is based on the Italian seismic bulletin (\url{http://terremoti.ingv.it/bsi}) of the ``Istituto Nazionale di Geofisica e Vulcanologia'',
includes events which occurred
between January 2005 and January 2020, and in the magnitude range between 0.0 and 6.5. The waveform data have been recorded primarily by the Italian National Seismic Network. The top panels of Figure \ref{fig:instance} depict the earthquake locations and the seismic stations which recorded the events.

In the bottom panels of Figure \ref{fig:instance}, some waveforms contained in the dataset are represented.
All the waveform traces have a length of 120 seconds, are sampled at 100 Hz, and are provided both in counts and ground motion physical units after deconvolution of the instrument transfer functions. The waveform dataset is accompanied by metadata consisting of more than 100 variables providing comprehensive information on the earthquake source, the recording stations, the trace features, and other derived quantities.

\section{Preliminaries on marked point processes}
\label{sec:preliminaries}

Throughout the paper, we consider marked point processes $Y=\{(x_i,m_i)\}_{i=1}^N$
\citep[Definition 6.4.1]{daley:vere-jones:08}, with ground points $x_i$ in the $d$-dimensional Euclidean space $\mathbb{R}^d$, $d\geq1$, which is equipped with
the Lebesgue measure $\vert A \vert =\int_A\text{d}z$ for Borel sets $A\in\mathcal{B}(\mathbb{R}^d)$; a closed Euclidean $r$-ball around $x\in\mathbb{R}^d$ will be denoted by $b[x,r]$.
By definition, the ground process $Y_g=\{x_i\}_{i=1}^N$, obtained from $Y$ by ignoring the marks, is a well-defined point process on $\mathbb{R}^d$ in its own right. We shall assume that $Y$ is simple, that is, it almost surely (a.s.) does not contain multiple points. Note that, formally, $Y$ is a random element in the measurable space $(N_{lf},\mathcal{N})$ of locally finite point configurations/patterns $\mathbf{x}=\{((x_1,m_1),\ldots, (x_n,m_n))\}$, $n\geq0$ \citep{daley:vere-jones:08,van2000markov}.
We assume that the mark space $\mathcal{M}$ is Polish and equipped with a finite reference measure $\nu$ on the Borel $\sigma$-algebra $\mathcal{B(M)}$. The Borel
$\sigma$-algebra  $\mathcal{B}(\mathbb{R}^d \times  \mathcal{M})=\mathcal{B}(\mathbb{R}^d)\otimes\mathcal{B}(\mathcal{M})$ is endowed with the product measure $A\times E\mapsto \vert A \vert \nu(E)$, $A\times E\in\mathcal{B}(\mathbb{R}^d \times  \mathcal{M})$.
We will let $Y(A\times E)=\sum_{(x,m)\in Y}\mathbf{1}\{(x,m)\in A\times E\}$, where $\mathbf{1}$ is the indicator function, denote the cardinality of the random set $Y\cap(A\times E)$.

Given this general setup, one may obtain various forms of marked point processes, most notably multivariate/multitype point processes with  $\mathcal{M}=\{1,\ldots,k\}$ \citep{diggle:13} and functional marked point processes with $\mathcal{M}$ given by a suitable function space \citep{ghorbani2021functional}.

\subsection{Functional Marked Point Processes}

In this section, we provide the definition of functional marked point processes following \cite{ghorbani2021functional}.

In classical FDA, one analyses a collection of functions $\{f_1(t), \ldots, f_n(t)\}$, $t \in \mathcal{T} \subset [0,\infty)$, $n \geq 1$, which take values in some Euclidean space $\mathbb{R}^k$, $k \geq 1$, and belong to some suitable function space, typically an $L_2$-space. Although $t$ usually represents time, it could also represent some other quantity, for example, spatial distance.
Classically, one would assume that such a collection of functions constitute realisations or samples of some collection of independent and identically distributed (iid) random functions or stochastic processes $\{ F_1(t), \ldots , F_n(t)\}$, $t \in \mathcal{T}$.
Such an assumption may, however, be questioned in certain settings.
For example, two functions $f_i$ and $f_j$, which are spatially close to each other in $\mathbb{R}^k$, could  gain (or lose) from being close to each other. Accordingly, it seems natural to relax the iid
assumption for $F_1,\ldots, F_N$. A natural way to handle such a scenario is to generate $F_1,\ldots, F_N$ conditionally on some collection of (dependent) random spatial locations.
Note that the conditional distribution of $F_1,\ldots, F_N$ could render them both dependent and independent.

To facilitate such a setting, we consider a functional marked point process \citep{ghorbani2021functional}, which is defined as a marked point process where the marks are random elements in some (Polish) function space, $\mathcal{M}$, most notably the space of $L_2$-functions $f:\mathcal{T}\to\mathbb{R}^k$. Realisations of FMPPs are called functional
marked point patterns.
It is noteworthy that the original formal construction of functional marked point processes by \citet{ghorbani2021functional} also included an additional non-functional mark, so that each ground process point would be marked by a pair which consists of a function and a non-functional variable. We here do not consider such auxiliary non-functional marks.

\subsection{Product densities}

Provided that it exists, the \textit{$n$-th order intensity/product density} function $\rho^{(n)}$, $n\geq1$, which is the density of the $n$-th order factorial moment measure $\alpha^{(n)}$, may be specified through the $n$-th order \textit{Campbell formula}. It states that, for any non-negative measurable function $h$ on $(\mathbb{R}^d \times  \mathcal{M})^n$, the expectation of the random sum of $h$ over $n$-tuples of distinct points of $Y$ satisfies
\begin{equation}
\begin{split}
  & \mathbb{E}\left[\sum^{\ne}_{(x_1,m_1), \ldots, (x_n,m_n) \in Y} h((x_1,m_1), \ldots, (x_n,m_n)) \right] = \\
  & =  \int \cdots \int  h((x_1,m_1), \ldots, (x_n,m_n))  \rho^{(n)}((x_1,m_1), \ldots, (x_n,m_n)) \prod_{i = 1}^{n} \text{d}x_i \nu(dm_i).
    \label{eq:campmark}
\end{split}
\end{equation}
Heuristically, $\rho^{(n)}((x_1,m_1), \ldots, (x_n,m_n)) \text{d}x_1 \nu(dm_1)\cdots\text{d}x_n \nu (dm_n)$ gives the probability that $Y$ has points in infinitesimal neighbourhoods $d(x_i,m_i)\ni (x_i,m_i) \in \mathbb{R}^d \times \mathcal{M}$ with measures $\text{d}x_i \nu(dm_i)$, $i=1,\ldots,n$.
Moreover, we retrieve $\alpha^{(n)}((A_1\times E_1)\times\cdots\times(A_n\times E_n))$, $(A_i\times E_i)\in\mathcal{B}(\mathbb{R}^d \times  \mathcal{M})$, $i=1,\ldots,n$, by letting $h$ be given by the indicator function  $\mathbf{1}\{(x_1,m_1)\in (A_1\times E_1),\ldots,(x_n,m_n)\in (A_n\times E_n)\}$.
It further follows that
$$
\rho^{(n)}((x_1,m_1), \ldots, (x_n,m_n))
=
f_{x_1,\dots,x_n}(m_1, \ldots, m_n)
\rho_g^{(n)}(x_1,\ldots,x_n),
$$
where $\rho_g^{(n)}$ is the $n$-th order product density of $Y_g$ and $f_{x_1,\dots,x_n}(\cdot)$ is a conditional density function on $\mathcal{M}^n$ which governs the joint distribution of $n$ marks, given that their associated ground process points are given by $x_1,\dots,x_n\in\mathbb{R}^d$. These, in turn, yield the corresponding mark distributions
\begin{equation*}
 M^{x_1,\ldots,x_n}(E_1, \ldots, E_n) = \int_{E_1} \cdots  \int_{E_n} f_{x_1,\dots,x_n}(m_1, \ldots, m_n) \prod_{i = 1}^{n} \nu(dm_i),
\end{equation*}
which govern the joint distribution on $n$ marks, given the associated ground process locations.

The intensity measure of $Y$, which coincides with the first order factorial moment measure, here satisfies
\begin{align}
\alpha(A \times E) =& \mathbb{E}[Y(A \times E)]
=
\int_A \int_E \rho(x,m) \text{d}x \nu (dm)
\nonumber
\\
=&
\int_A \int_E  f_{x}(m) \rho_g(x) \text{d}x \nu (dm)
=
\int_A M^{x}(E)\rho_g(x) \text{d}x
,
\label{eq:first}
\end{align}
where the first order intensity functions $\rho=\rho^{(1)}$ and $\rho_g=\rho_g^{(1)}$ are typically referred to as \textit{the intensity functions} of $Y$ and $Y_g$.
Note that
$\rho$ may be viewed as a ``heat map" which reflects the infinitesimal chance of having a point of $Y$ at/around an arbitrary location in $\mathbb{R}^d \times  \mathcal{M}$. When the intensity function (of the ground process) is constant, we say that the (ground) process is homogeneous, otherwise it is called inhomogeneous.

When, conditional on the ground process, all marks have the same marginal univariate distribution, so that $M^{z}(E) = \int_{E} f_{z}(m) \text{d}\nu(dm) = \int_{E} f(m) \text{d}\nu(m) = M(E)$, we say that $X$ has a common (marginal) mark distribution.
This holds e.g.~when $Y$ is stationary, i.e.~when its distribution is invariant under translations of the ground points; here $\alpha(A \times E)=\rho_g M(E) \vert  A \vert $ and $\rho_g>0$ is the constant intensity of the ground process.
We will see that, at times, it is particularly convenient to have here that the reference measure $\nu$ coincides with the common mark distribution $M$, which implies that the common mark density $f$ is set to $1$ and $\rho(x,m)=\rho_g(x)$.

When $Y$ is independently marked, i.e.~when the marks are independent conditional on the ground process,
$f_{x_1,\ldots,x_n}(m_1, \ldots, m_n)=f_{x_1}(m_1)\cdots f_{x_n}(m_n)$ for any $n\geq1$ and if, in addition, there is a common mark distribution, whereby the marks are iid conditional on the ground process, we say that $Y$ is randomly labelled and note that $f_{x_1,\ldots,x_n}(m_1, \ldots, m_n)=f(m_1)\cdots f(m_n)$.

\subsubsection{Intensity reweighted stationarity}

We next turn to the notion of a $k$-th order marked intensity reweighted stationary ($k$-MIRS) marked point process $Y$ \citep{ghorbani2021functional}. We say that $Y$ is $k$-MIRS, $k\in\{1,2,\ldots\}$, if $\rho$ is bounded away from 0 and the correlation functions
\begin{align*}
&g^{(n)}((x_1,m_1), \ldots, (x_n,m_n))
=
\\
=&
\frac{\rho^{(n)}((x_1,m_1), \ldots, (x_n,m_n))}{\rho(x_1,m_1)\cdots\rho(x_n,m_n)}
=
\frac{f_{x_1,\dots,x_n}(m_1, \ldots, m_n)}{f_{x_1}(m_1)\cdots f_{x_n}(m_n)}
\frac{\rho_g^{(n)}(x_1, \ldots, x_n)}{\rho_g(x_1)\cdots\rho_g(x_n)}
,
\quad n\geq1,
\end{align*}
satisfy $g^{(n)}((x_1,m_1), \ldots, (x_n,m_n))=g^{(n)}((z+x_1,m_1), \ldots, (z+x_n,m_n))$ for any $z\in\mathbb{R}^d$ and any $n\leq k$. Note that $g^{(1)}(\cdot)\equiv1$ and that the second ratio on the right hand side is the $n$-th order correlation function, $g_g^{(n)}$, of the ground process. Provided that the product densities of all orders exist, stationarity implies $k$-MIRS for all orders $k\geq1$. Note further that $g^{(n)}(\cdot)\equiv1$, $n\geq1$, for a Poisson process and when $g^{(n)}((x_1,m_1), \ldots, (x_n,m_n))>1$ points of $Y_g$ in infinitesimal neighbourhoods of $x_1,\ldots,x_n$ with marks in infinitesimal neighbourhoods of  $m_1,\ldots,m_n$ tend to cluster/aggregate. Similarly, $g^{(n)}((x_1,m_1), \ldots, (x_n,m_n))<1$ indicates inhibition/regularity.

\subsection{Palm distributions}

Let $Y$ be a simple marked point process whose intensity function exists. Many of the summary statistics we will consider can be expressed in terms of \textit{reduced Palm distributions}. These satisfy the \textit{reduced Campbell–Mecke} formula which states that, for any non-negative measurable function $h$ on the product space $(\mathbb{R}^d \times \mathcal{M})\times N_{lf}$,
\begin{align}
\label{eq:mecke}
\mathbb{E} \left[ \sum_{(z,m) \in Y} h((z,m), Y \backslash \{ (z,m) \}) \right]
=&
\int
\mathbb{E}[h((x,m),Y^{!(x,m)})]\rho(x,m)\text{d}x
\nu(dm)
\\
=&
\int
\mathbb{E}^{!(x,m)}[h((x,m),Y)]\rho(x,m)\text{d}x
\nu(dm).
\nonumber
\end{align}
Here $Y^{!(x,m)}$ is the reduced Palm process at $(x,m)\in\mathbb{R}^d\times\mathcal{M}$, which we interpret as $Y$ conditioned on the null event that there is a point in $(x,m)$, which is removed upon realisation. The probability distribution $P^{!(x,m)}(\cdot) = \mathbb{P}^{!(x,m)}(Y \in \cdot) = \mathbb{P}(Y^{!(x,m)}\in\cdot)$ on $(N_{lf},\mathcal{N})$, which corresponds to $\mathbb{E}^{!(x,m)}$, is called the reduced Palm distribution at $(x,m)$.

\section{Local weighted marked summary statistics}\label{sec:proposal}

Global summary statistics have had a prominent role in the statistical analysis of point processes. More precisely, their non-parametric estimators are typically used to characterise the degree of spatial interaction present in the underlying data-generating point process.
In Section \ref{sec:intro}, we have reviewed a few such examples, for instance $K$-functions.

The individual contributions to a global statistic, which are commonly called Local Indicators of Spatial Association (LISA) functions, can be used to identify outlying components measuring the influence of each contribution to the global statistic \citep{anselin:95}. This is the case of the scatter plot based on the local Moran index \citep{anselin1996chapter}. On the other hand, the individual contributions
can be used to test for specific local structures, such as
spatial association and hot spot detection in areal data  \citep{getis:ord:92}. Basically, the local statistics mentioned so far are often used to analyse areal data but \cite{getis:franklin:87} introduced a local version of the $K$-function for spatial point processes to show that trees exhibit different kinds of heterogeneity when examined at different scales of analysis. The notion of individual functions for
certain
statistics has also been studied in \cite{stoyan:stoyan:94} and \cite{mateu:lorenzo:porcu:10} showed that the local product density function \citep{cressie2001analysis} is more sensitive to identifying different local structures and unusual points than the local $K$-function. Applications of LISA functions range from detection of features in images with noise \citep{mateu:lorenzo:porcu:07} to detection of disease clusters \citep{moraga:montes:11}. In \cite{siino2018testing} the authors extend local indicators of spatial association to the spatio-temporal context (LISTA functions) based on the second order product density, and these local functions have been used to define a proper statistical test for clustering detection.
Recently, LISTA functions have been used both for diagnostic \citep{adelfio2020some} and fitting purposes \citep{dangelo2021locally}.
Finally, \cite{dangelo2021assessing} extended LISTA functions to spatio-temporal point processes living on linear networks.

As we have clearly indicated,
an alternative to studying the aforementioned global summary statistics for marked point processes
is
considering
local summary statistics which
describe the spatial interaction in the vicinity of a given marked point.
In order to do so here in the marked context, we introduce the function
\begin{align}
\label{e:GeneralLocal}
  &L((x,m),\mathbf{x}) =
  L_n((x,m),\mathbf{x}; \tilde t, \tilde \rho)
  =
  \sum_{(x_1,m_1), \ldots, (x_{n-1},m_{n-1}) \in \mathbf{x}
  }^{\ne}
  \frac{
  \tilde t((x,m),(x_1,m_1),\ldots,(x_{n-1},m_{n-1}))
  }{\tilde \rho(x,m)\tilde \rho(x_1,m_1) \cdots \tilde \rho(x_{n-1},m_{n-1})}
  ,
\end{align}
for $(x,m)\in \mathbb{R}^d\times\mathcal{M}$, point patterns $\mathbf{x}\in N_{lf}$ and measurable $\tilde t:(\mathbb{R}^d\times\mathcal{M})^n\to\mathbb{R}$,
$n\geq2$. Note that, formally, the argument $\tilde \rho$ does not need to be the true intensity function $\rho$ of $Y$, it could e.g.~be a plug-in estimator. We will exploit Definition \ref{def:LocalMarked}, and thereby \eqref{e:GeneralLocal}, to define proper notions of (mark-weighted $n$-th order inhomogeneous) local summary statistics.

\begin{definition}
\label{def:LocalMarked}
Given a marked point process $Y$, we refer to $L((x,m),Y\setminus\{(x,m)\}; \tilde t, \tilde \rho)$, $(x,m)\in Y$, as the family of $n$-th order local marked cumulative summary statistics of $Y$ associated with $\tilde t$ and $\tilde \rho$.
\end{definition}

The construction of a specific local statistic is obtained by identifying when, for some function family $\{\tilde t_r\}$,
\begin{align}
\label{e:GeneralGlobal}
G(r,Y) = \sum_{(x,m)\in Y} L_n((x,m), Y\setminus\{(x,m)\}; \tilde t_r, \tilde\rho)
\end{align}
forms an estimator of an existing global summary statistic.

Using $n$-th order local marked cumulative summary statistics
to quantify local spatial interactions for a point pattern $\mathbf{x}$ entails inserting an estimate $\widehat\rho(x,m)=\widehat f_{z}(m)\widehat{\rho}_g(x)$ for the unknown intensity $\rho(x,m)=f_{z}(m)\rho_g(x)$, i.e.\ setting $\tilde\rho=\widehat\rho$.
When we assume that there is a common mark distribution which coincides with the mark reference measure $\nu$, we obtain that $\widehat\rho(x,m)=\widehat{\rho}_g(x)$, i.e.\ the intensity estimate does not depend on the mark values.
Imposing this assumption is particularly convenient when dealing with functional marks since estimation of the mark density, which here is a density on a function space, is rather challenging and beyond the scope of this paper. Note that when $Y$ is randomly labelled, it has a common mark distribution and in this setting the assumption  $\widehat\rho(x,m)=\widehat{\rho}_g(x)$ thus makes sense.

Turning to the distributional properties of the $n$-th order local marked cumulative summary statistics, we next derive their expectations under the assumption of $k$-MIRS. Note, in particular, that the choice of $\tilde t$ plays a significant role here.

\begin{theorem}
\label{thm:Local}
When $Y$ is $k$-MIRS and $\tilde\rho=\rho$, for any $W\in\mathcal{B}(\mathbb{R}^d)$ the expectation of $L((x,m),Y\setminus\{(x,m)\}\cap W\times\mathcal{M}; \tilde t, \rho)$, $(x,m)\in Y\cap W\times\mathcal{M}$, is almost everywhere given by
\begin{align*}
&\int_{W-x}\cdots\int_{W-x}
 \Bigg(
 \int_{\mathcal{M}}\cdots\int_{\mathcal{M}}
  \tilde t((x,m),(x_1+x,m_1),\ldots,(x_{n-1}+x,m_{n-1}))
  \times
  \\
  &\times
 \frac{f_{0,x_1,\ldots,x_{n-1}}(m,m_1, \ldots, m_{n-1})}{f_{0}(m) f_{x_1}(m_1)\cdots f_{x_{n-1}}(m_{n-1})}
 \nu(dm_1) \cdots \nu(dm_{n-1})
 \Bigg)
 g_g^{(n)}(0, x_1, \ldots, x_{n-1})
 \text{d}x_1 \cdots \text{d}x_{n-1}
  ,
\end{align*}
when $2\leq n\leq k$. Moreover, the expectation of $G(r,Y\cap W\times\mathcal{M})$ is obtained by replacing $\tilde t$ by $\tilde t_r$ in the expression above and integrating it over $W\times\mathcal{M}$ with respect to the reference measure on $\mathbb{R}^d \times \mathcal{M}$.
\end{theorem}

\begin{proof}
Note first that the expectation coincides with
\begin{align*}
&
\mathbb{E}^{!(x,m)}[L_n((x,m), Y\cap W\times\mathcal{M}; \tilde t, \rho)]=
\\
=&
\mathbb{E}^{!(x,m)}\left[
\sum_{(x_1,m_1), \ldots, (x_{n-1},m_{n-1}) \in Y\cap W\times\mathcal{M}}^{\ne}
\frac{
  \tilde t((x,m),(x_1,m_1),\ldots,(x_{n-1},m_{n-1}))
  }{\rho(x,m) \rho(x_1,m_1) \cdots \rho(x_{n-1},m_{n-1})}
\right]
.
\end{align*}
Hence, our starting point will be the reduced Campbell-Mecke formula.
Consider an arbitrary bounded $A\times E\in\mathcal{B}(\mathbb{R}^d \times \mathcal{M})$. It follows that
\begin{align*}
  &
  \mathbb{E}\left[\sum_{(x,m)\in Y \cap A \times E}  \sum_{(x_1,m_1), \ldots, (x_{n-1},m_{n-1}) \in Y \setminus \{ (x,m) \}\cap W\times\mathcal{M}}^{\neq}
  \frac{
  \tilde t((x,m),(x_1,m_1),\ldots,(x_{n-1},m_{n-1}))
  }{\rho(x,m) \rho(x_1,m_1) \cdots \rho(x_{n-1},m_{n-1})}
  \right]
  =
  \\
  =&
  \int_{A\times E}
  \mathbb{E}^{!(x,m)} \left[
\sum_{(x_1,m_1), \ldots, (x_{n-1},m_{n-1}) \in Y\cap W\times\mathcal{M}}^{\ne} \frac{
  \tilde t((x,m),(x_1,m_1),\ldots,(x_{n-1},m_{n-1}))
  }{\rho(x_1,m_1) \cdots \rho(x_{n-1},m_{n-1})}\right]
  \text{d}x \nu(dm).
\end{align*}
On the other hand, by the Campbell formula we have that
\begin{align*}
  &
  \mathbb{E}\left[\sum_{(x,m)\in Y \cap A \times E}  \sum_{(x_1,m_1), \ldots, (x_{n-1},m_{n-1}) \in Y \setminus \{ (x,m) \}\cap W\times\mathcal{M}}^{\neq}
  \frac{
  \tilde t((x,m),(x_1,m_1),\ldots,(x_{n-1},m_{n-1}))
  }{\rho(x,m) \rho(x_1,m_1) \cdots \rho(x_{n-1},m_{n-1})}
  \right]
  =
  \\
  =&
  \int_{A\times E}\int_{\mathbb{R}^d \times \mathcal{M}}\cdots\int_{\mathbb{R}^d \times \mathcal{M}}
  \mathbf{1}\{x_1,\ldots,x_{n-1}\in W\}
  \tilde t((x,m),(x_1,m_1),\ldots,(x_{n-1},m_{n-1}))
  \times
  \\
  &\times
  g^{(n)}((x,m),(x_1,m_1),\ldots,(x_{n-1},m_{n-1}))
  \text{d}x_1 \nu(dm_1)
  \cdots
  \text{d}x_{n-1} \nu(dm_{n-1})
  \text{d}x \nu(dm)
  \\
  =&
  \int_{A\times E}
  \int_{\mathbb{R}^d \times \mathcal{M}}\cdots\int_{\mathbb{R}^d \times \mathcal{M}}
  \prod_{i=1}^{n-1}\mathbf{1}\{u_i\in W-x\}
  \tilde t((x,m),(u_1+x,m_1),\ldots,(u_{n-1}+x,m_{n-1}))
  \times
  \\
  &\times
  g^{(n)}((0,m),(u_1,m_1),\ldots,(u_{n-1},m_{n-1}))
  \text{d}u_1 \nu(dm_1)
  \cdots
  \text{d}u_{n-1} \nu(dm_{n-1})
  \text{d}x \nu(dm)
\end{align*}
by the imposed $k$-MIRS and a change of variables, $u_i+x=x_i$.
Hence, since $A\times E\in\mathcal{B}(\mathbb{R}^d \times \mathcal{M})$ was arbitrary, for almost every $(x,m)$ we have that
\begin{align*}
&
\mathbb{E}^{!(x,m)}[L_n((x,m), Y; \tilde t, \rho)]=
\\
=&
\int_{(W-x) \times \mathcal{M}}\cdots\int_{(W-x) \times \mathcal{M}}
  \tilde t((x,m),(u_1+x,m_1),\ldots,(u_{n-1}+x,m_{n-1}))
  \times
  \\
  &\times
  g^{(n)}((0,m),(u_1,m_1),\ldots,(u_{n-1},m_{n-1}))
  \text{d}u_1 \nu(dm_1)
  \cdots
  \text{d}u_{n-1} \nu(dm_{n-1})
 \\
 =&
 \int_{W-x}\cdots\int_{W-x}
 \Bigg(
 \int_{\mathcal{M}}\cdots\int_{\mathcal{M}}
  \tilde t((x,m),(u_1+x,m_1),\ldots,(u_{n-1}+x,m_{n-1}))
  \times
  \\
  &\times
 \frac{f_{0,u_1,\ldots,u_{n-1}}(m,m_1, \ldots, m_{n-1})}{f_{0}(m) f_{u_1}(m_1)\cdots f_{u_{n-1}}(m_{n-1})}
 \nu(dm_1) \cdots \nu(dm_{n-1})
 \Bigg)
 g_g^{(n)}(0, u_1, \cdots, u_{n-1})
 \text{d}u_1 \cdots \text{d}u_{n-1}
  ,
\end{align*}
by Fubini's theorem.

\end{proof}

The first thing we note is that when $Y$ is independently marked then the density ratio in the expression for the expectation vanishes. In addition, if $Y$ is a Poisson process on $\mathbb{R}^d \times \mathcal{M}$ which satisfies being a marked point process with mark space $\mathcal{M}$, then the expectation reduces to an integral with $\tilde t$ as integrand. These observations may be used as benchmarks for when $Y$ exhibits mark (in)dependence and spatial interaction locally.

\subsection{Special cases}

We next illustrate how \eqref{e:GeneralGlobal}, through Definition \ref{def:LocalMarked} and \eqref{e:GeneralLocal}, reduces to several existing summary statistic estimators by varying $\tilde t$ and $\tilde \rho$.

\subsubsection{Ground \textit{K}-functions}
First, set $n=2$ and $\tilde t$ to $\tilde t_r((x,m),(x_1,m_1))=w(x,x_1)\mathbf{1}\{x_1\in x+C\}/ \vert W \vert $, $r\geq0$, where $W\subseteq\mathbb{R}^d$, $\vert  W \vert  >0$, and $w(\cdot)$ is an edge correction term.
If the ground process is stationary with intensity $\rho_g>0$ and $\tilde \rho(x,m)\equiv\rho_g$, then \eqref{e:GeneralGlobal} with $Y$ set to $Y\cap W\times\mathcal{M}$ reduces to an estimator of Ripley's $K$-function when $x+C=x+b[0,r]=b[x,r]$ whereas if the ground process is inhomogeneous and we set $\tilde \rho(x,m)=\rho_g(x)$, it follows that \eqref{e:GeneralGlobal} reduces to an estimator of the inhomogeneous $K$-function \citep{baddeley2000non} for $Y_g$.
The extension to space-time is straightforward; replace the Euclidean ball $b[0,r]$ by
$C = \{ (x, s) : \| x \| \leq r, |s| \leq t\}\in \mathcal{B}(\mathbb{R}^{d+1})$, where $\| \cdot \|$ denotes the Euclidean norm \citep{cronie:lieshout:15,gabriel:diggle:09,iftimi2019second}.

\subsubsection{Marked \textit{K}-functions}
When $n=2$, by instead letting $\tilde t_r((x,m),(x_1,m_1))=w(x,x_1)\mathbf{1}\{x_1\in x+C\}\mathbf{1}\{m\in E, m_1 \in E_1\}/(|W|
\nu(E)\nu(E_1))$ and $\tilde\rho=\rho$ in \eqref{e:GeneralLocal}, using a suitable edge correction function $w(\cdot)$, then $G(r,Y\cap W\times \mathcal{M})$ in \eqref{e:GeneralGlobal}
reduces to an estimator of the \textit{marked second order reduced moment measure} $\mathcal{K}^{E E_1}(C)$ of \cite{iftimi2019second}, which measures the intensity reweighted interactions between points with marks in $E$ and points with marks in $E_1$, when their separation vectors belong to $C \in \mathcal{B}(\mathbb{R}^d)$. We note that measures of this kind are in general not symmetric, i.e.\  $\mathcal{K}^{ E E_1}(\cdot) \ne \mathcal{K}^{E_1 E}(\cdot)$ \citep{iftimi2019second}. Furthermore, choosing $C$ to be the closed origin-centred ball $b[0,r]$ of radius $r \geq 0$, we consider the marked inhomogeneous $K$-function $K^{E  E_1}_{inhom}(r)$ of \cite{cronie2016summary}, which measures pairwise intensity reweighted spatial dependence within distance $r$ between points with marks in $E$ and points with marks in $E_1$.

By additionally letting $n>2$, we obtain a definition of a \textit{marked $n$-th order reduced moment measure}, $\mathcal{K}^{ E \times_{i=1}^{n-1}E_i}(C_1 \times \cdots \times C_{n-1})$, which measures the intensity reweighted spatial interaction between an arbitrary point with mark in $E$ and distinct $(n-1)$-tuples of other points, where the separation vectors between the $E$-marked point and these $n-1$ points, which have marks in $E_1,\ldots,E_{n-1}$, belong to $C_1,\ldots,C_{n-1}$.
We note that $C_i = b[0,r]$, $i = 1, \ldots, n-1$, $r \geq 0$, yields an $n$-point version of the marked inhomogeneous $K$-function $K_{inhom}^{ E \times_{i = 1}^{n-1} E_i}(r)$ of \cite{cronie2016summary}, which may be used to analyse intensity reweighted interactions between a point with mark in $ E$ and $n-1$ of its $r$-close neighbours, which have marks belonging to the respective sets $E_1,\ldots,E_{n-1}$.

\subsubsection{Weighted marked reduced moment measures and \textit{K}-functions}

    Finally, by letting $\tilde\rho=\rho$ and $\tilde t((x,m),(x_1,m_1),\ldots,(x_{n-1},m_{n-1}))$ be given by the product of
    \begin{align}
    \label{e:ProductTestFun}
    \tilde t(m,m_1,\ldots,m_{n-1}) =&
    t(m,m_1,\ldots,m_{n-1})
    \frac{

    \mathbf{1}\{ m \in E\}
    }{\nu(E)}
    \prod_{i=1}^{n-1}
    \frac{\mathbf{1}\{m_i\in E_i\}}{\nu(E_i)}
    ,
    \\
    \tilde w(x,x_1,\ldots,x_{n-1}) =&
    w(x,x_1,\ldots,x_{n-1})

    \prod_{i=1}^{n-1}
    \mathbf{1}\{x_i \in (x + C_i)\}

    ,\nonumber
    \end{align}
     for $E\in \mathcal{B(M)}$, $\nu(E)>0$, and $C_i \times  E_i \in \mathcal{B}(\mathbb{R}^d) \times \mathcal{B(M)}= \mathcal{B}(\mathbb{R}^d \times \mathcal{M})$,  $\nu(E_i)>0$, $i=1,\ldots,n-1$,
     we obtain an unbiased estimator $\hat{\mathcal{K}}_t^{ E \times_{i = 1}^{n-1}  E_i}(C_1 \times \cdots \times C_{n-1})
  = G(r,Y\cap W\times
  \mathcal{M}
  )$ of the $t$-weighted marked $n$-th order reduced moment measure of \citet{ghorbani2021functional},
\begin{align}
\label{eq:tweight0}
&\mathcal{K}_t^{ E \times_{i = 1}^{n-1}  E_i}(C_1 \times \cdots \times C_{n-1})
  =
  \\
  =&
  \frac{1}{\vert W \vert \nu(E) \prod_{i=1}^{n-1}\nu(E_i)}
  \mathbb{E}\Bigg[\sum_{(x,m)\in Y \cap W \times E}  \sum_{(x_1,m_1), \ldots, (x_{n-1},m_{n-1}) \in Y \setminus \{ (x,m) \}}^{\neq} \frac{t(m,m_1,\ldots,m_{n-1})}{\rho(x,m)}
  \times
  \nonumber
  \\
  & \times
  \prod_{i=1}^{n-1}\frac{\mathbf{1}\{x_i-x \in C_i\}\mathbf{1}\{ m_i \in  E_i\}}{\rho(x_i,m_i)}
  \Bigg]
  \nonumber
\end{align}
assuming that the edge correction function $w$ is such that unbiasedness holds.
Examples of such $w$ include the minus sampling edge correction and the translational edge correction \citep{ghorbani2021functional}.
Note here that one just as well could have merged the scaled indicators in the expression for $\tilde t$ with $t$ so that $\tilde t=t$; \cite{ghorbani2021functional} included this mark set filtering to highlight that their summary statistic generalises previously proposed ones.

\subsection{Local t-weighted marked $n$-th order  inhomogeneous K-function}

In this section, we provide the estimator corresponding to the local contributions of \eqref{eq:tweight0} and discuss its properties.

\begin{definition}
\label{def:LocalK}
Let $\tilde t$ be (up to indicator-scaling) as in \eqref{e:ProductTestFun} and consider
\begin{equation}
    \begin{split}
&\hat{ \mathcal{K}}_t^{(x,m) \times_{i = 1}^{n-1}  E_i}(C_1 \times \cdots \times C_{n-1}) = L_n((x,m), Y\setminus\{(x,m)\}\cap W\times\mathcal{M}; \tilde t, \tilde  \rho)=
\\
=&
\frac{1}{\tilde{\rho}(x,m)\nu(E) \prod_{i=1}^{n-1}\nu( E_i)}
\sum_{(x_1,m_1), \ldots, (x_{n-1},m_{n-1}) \in Y \setminus \{ (x,m) \}\cap W\times\mathcal{M}}^{\neq}  w(x,x_1,\ldots,x_{n-1})
\times
\\
  &\times
  t(m,m_1,\ldots,m_{n-1})
  \prod_{i=1}^{n-1}\frac{\mathbf{1}\{x_i-x \in C_i\}\mathbf{1}\{ m_i \in E_i\} }{\tilde{\rho}(x_i, m_i)},
  \qquad
  (x,m)\in Y\cap W\times\mathcal{M},
  \label{eq:lo2}
    \end{split}
\end{equation}
for some suitable edge correction $w$ in \eqref{e:ProductTestFun},
$W\in\mathcal{B}(\mathbb{R}^d)$, $E\in\mathcal{B}(\mathcal{M})$, $\nu(E)>0$, and $C_i \times  E_i \in \mathcal{B}(\mathbb{R}^d \times \mathcal{M})$, $\nu(E_i)>0$, $i=1,\ldots,n-1$.
We refer to
$\hat{ \mathcal{K}}_t^{(x,m) \times_{i = 1}^{n-1}  E_i}(r)=\hat{ \mathcal{K}}_t^{(x,m) \times_{i = 1}^{n-1}  E_i}(b[0,r]^{n-1})$, $r\geq0$,
as a \textit{local t-weighted marked $n$-th order  inhomogeneous $K$-function}. In particular, $\hat{\mathcal{K}}_{t,n}^{(x,m)}(r)=\hat{\mathcal{K}}_t^{(x,m) \times \mathcal{M}^{n-1}}(r)$ does not perform any explicit mark set filtering.

\end{definition}

Note first that when there is a common mark distribution which coincides with the reference measure on $\mathcal{M}$, setting $\tilde\rho=\rho$ we, for instance, obtain
\begin{align*}
\hat{\mathcal{K}}_{t,n}^{(x,m)}(r)
=&
\sum_{(x_1,m_1), \ldots, (x_{n-1},m_{n-1}) \in Y \setminus \{ (x,m) \}\cap (b[x,r]\cap W)\times\mathcal{M}}^{\neq}
\frac{t(m,m_1,\ldots,m_{n-1}) w(x,x_1,\ldots,x_{n-1})}
{\rho_g(x)\rho_g(x_1)\cdots\rho_g(x_{n-1})}
\end{align*}
since $\nu$ must be a probability measure here.

Regarding the distributional properties of \eqref{eq:lo2}, when $Y$ is $k$-MIRS,  Theorem \ref{thm:Local} tells us that the expectation is given by
\begin{align*}
&
\frac{1}{\nu(E)}
\prod_{i=1}^{n-1}
    \frac{1}{\nu(E_i)}
\int_{\mathbb{R}^d}\cdots\int_{\mathbb{R}^d}
w(x,x_1+x,\ldots,x_{n-1}+x)
    \prod_{i=1}^{n-1}
    \mathbf{1}\{x_i \in (x + C_i)\cap(W-x)\}

    \times
  \\
  \times&
 \Bigg(
 \int_{E_1}\cdots\int_{E_{n-1}}
 t(m,m_1,\ldots,m_{n-1})
 \frac{f_{0,x_1,\ldots,x_{n-1}}(m,m_1, \ldots, m_{n-1})}{f_{0}(m) f_{x_1}(m_1)\cdots f_{x_{n-1}}(m_{n-1})}
 \nu(dm_1) \cdots \nu(dm_{n-1})
 \Bigg)
    \times
    \\
    \times&
 g_g^{(n)}(0, x_1, \ldots, x_{n-1})
 \text{d}x_1 \cdots \text{d}x_{n-1}
  .
\end{align*}
In particular, under independent marking the mark related integral within brackets reduces to
$\int_{E_1}\cdots\int_{E_{n-1}}
t(m,m_1,\ldots,m_{n-1})
\nu(dm_1) \cdots \nu(dm_{n-1})$, whereby \eqref{eq:lo2} is given by the product of this term and a term measuring intensity reweighted spatial interaction.

\subsubsection{Test functions for FMPPs}
Turning to the FMPP case, by choosing different test functions $t(\cdot)$ for the functional marks, we may extract different features.
We here focus on pairwise interactions, i.e.\
$n = 2$.

The test function $t$ is intended to reflect similarities between functions. Hence, a natural starting point would be a metric $t(f_1,f_2)= d(f_1,f_2)$ on the function space $\mathcal{M}$, which does not necessarily need to be the underlying assumed metric on $\mathcal{M}$.
The first candidate that comes to mind is an $L_p$-distance:
\begin{equation}
    t(f_1,f_2)=\Bigg(\int_a^b|f_1(t)-f_2(t)|^p\text{d}t\Bigg)^{1/p},
    \quad 1\leq p\leq\infty,
    \label{eq:testl}
\end{equation}
where $p=\infty$ represents the supremum metric.
For any choice of $p$ in \eqref{eq:testl}, similarity between functions implies a small value of the test function. Other tentative functions are semi-metrics based on the $L_p$ distance between the $s$-th derivatives of
the
functions, for different combinations of $p$ and $s$, with the $L_1$ and $L_2$ distances being particular cases, and semi-metrics based on functional principal component analysis.

A further alternative
is the functional marked counterpart of the
test function for the classical variogram, given by
\begin{equation}
    t(f_1,f_2)=\int_a^b(f_1(t)-\Bar{F}(t))(f_2(t)-\Bar{F}(t))\text{d}t,
    \label{eq:testf}
\end{equation}
with $\Bar{F}(t)=(1/n)\sum_{i=1}^n f_i(t)$ being the average functional mark at time $t$ for the observed functional part of the point pattern; such averaging is motivated by the assumption of a common mark distribution.

\section{Local test for random labelling} \label{sec:test}

Simple hypotheses for spatial point patterns, such as Complete Spatial Randomness, are commonly tested using an estimator of a global summary statistic, e.g., Ripley's $K$-function. In this context, one typically resorts to Monte Carlo testing.
The first step is then to generate $Q$ simulations under the null hypothesis, and to
estimate the chosen summary statistic for both the observed pattern and the simulations.
In order to study whether there is \textit{random labelling} in a (functional) marked point process,  the simulations are obtained by permuting the (functional) marks, that is, randomly assigning them to the spatial points of the ground pattern, which are kept fixed. Then, the chosen summary statistic is estimated for each of these permutations and global envelopes at a given nominal level are generated based on them. The result of the test can be assessed graphically: if the summary statistic estimate for the observed pattern
exits
the envelopes, we proceed with the assumption that the
underlying FMPP is
not randomly labelled.
Furthermore, it is possible to calculate a
$p$-value based on the position of the observed summary statistic within the $q$th envelopes, following \cite{myllymaki2017global}.
We know, however, that the conclusion drawn from the application of the above-mentioned global test
pertains
to the whole analysed process, indicating whether all the functional marks
are randomly labelled or not.
Motivated by the will to further detect the specific points, and regions, where the functional marks really do depend on the other marked points,
we propose a \textit{local test for random labelling}. The main idea is to run a global envelope test on each point of the analysed pattern by means of the previously proposed \textit{local t-weighted marked inhomogeneous $K$-functions}, to draw different conclusions about the individual points, based on the obtained $p$-values.
In Algorithm \ref{alg:1} we outline the proposed local test. Note that we alternatively may use sampling without replacement in step \ref{step:resample} of Algorithm \ref{alg:1}. Moreover, if convinced that multiple testing issues are present here, one may adjust the type I error probability $\alpha$ by using e.g.~the Holm-Bonferroni method.
\begin{algorithm}
\caption{Local test of random labelling}\label{alg:1}
  \begin{algorithmic}[1]
  \State Set a fixed nominal value $\alpha$ for type I error;
   \State Consider a (functional) marked point pattern $\mathbf{x}=\{(x_j,m_j)\}_{j=1}^k$, $k\geq1$;
   \State Set a number of simulations, $Q\geq1$;
   \For{each $q = 1, \ldots, Q$:}

        \State\label{step:resample} Randomly sample $k$ (functional) marks, with replacement, from the original $k$ ones;
        \State Denote the resulting point pattern by  $\mathbf{x}_q=\{(x_j,m_j^q)\}_{j=1}^k$;
         \EndFor
      \For{each

      $j=1,\ldots,k$,}
      \State Compute $L_n^{(j,q)} = \{\hat{\mathcal{K}}_t^{(x_j,m_j^q) \times_{i = 1}^{n-1} E_i}(r; \mathbf{x}_q)\}_{r\in[0,r_{max}]}$ for all $q=1,\ldots,Q$;

 \State
    Apply global envelope testing,

    using the functions $L_n^{(j,q)}$, $q=1,\ldots,Q$, to generate the envelopes;
    \State Obtain a $p$-value $p_j$ from the test;
    \State\label{setp:reject} Reject the null hypothesis for the $j^{th}$ point

    if $p_j \leq \alpha$.
    \EndFor

    \end{algorithmic}
    \end{algorithm}

\section{Motivating example and simulation study}\label{sec:sims}

This section is dedicated to simulation studies to assess the performance of our proposed local test. First, section \ref{sec:extest} provides a motivating example of the use of such a test, by means of simulated data resembling seismic events, which in turn have motivated this work. In particular, this means simulating the functional marks as seismic waveforms, following the typical abrupt change in variance of the signal in correspondence with the arrivals of the first P- and S-waves.
Then, section \ref{sec:ex_sims} presents an extensive simulation study, showing diverse and more general settings. Specifically, we assess the performance of the test by summarising the results in terms of classification rates.

\subsection{The need for a local test} \label{sec:extest}

We simulate a homogeneous spatial point pattern with 250 points on the unit square, $W=[0,1]\times[0,1]$, which represents the ground pattern. For each ground point $x_i$, we simulate a functional mark of the from
	\begin{align*}
		f_i(t) =& y(t) = \mu(t)+\epsilon(t),
		\qquad t\in\mathcal{T}= [0,1],
		\\
		\epsilon(t) \sim & N(0,\sigma(t)^2),
		\\
		\sigma(t)^2 =& 0.2+7.5\mathbf{1}\{t>0.4\}-5\mathbf{1}\{t>0.6\},
	\end{align*}
	where the mean signal $\mu(t)$ is taken to be zero.
The spatial
ground point pattern
and the corresponding waveform for a given point are shown in Figure \ref{fig:sim1}(a)-(b).
Since the marks/waveforms are simulated from the same
model, and independently of each other and the spatial locations of the points, we see that such a process is indeed random labelled.

\begin{figure}[htb]
	\centering
\includegraphics[width=.57\textwidth]{F1.pdf}
\includegraphics[width=.42\textwidth]{F2.pdf}
	\caption{Simulated earthquake locations (a);  Simulated waveform  attached to the red point on the left (b); Result of global test (c).}
	\label{fig:sim1}
\end{figure}

Having generated the data, we first run a \textit{global envelope test for random labelling}, by randomly permuting the simulated waveforms, i.e.~the functional marks, keeping the location of the points fixed.
We run the test by means of the t-weighted marked $n$-th order  inhomogeneous $K$-function of \cite{ghorbani2021functional}, with $n=2$, making it a second order summary statistic, and $t$ given by the test function \eqref{eq:testf}, i.e.\ the functional marked counterpart of the test function for the classical variogram.
As previously mentioned, we assume that there is a common mark distribution which coincides with the reference measure on the mark space so that the intensity function is estimated by the ground process intensity estimate.  To be as objective as possible, we do not use the homogeneous intensity estimator $\widehat\rho_g(\cdot)=Y_g(W)/ \vert  W \vert $ here but instead we use a kernel intensity estimator, as in practice it would be unknown to us whether the actual ground process is (in)homogeneous.
We use a Gaussian kernel intensity estimator $\widehat\rho_g(\cdot)$, where we select the bandwidth, $h$, according to \cite{cronie2018non}. More specifically, we minimise the discrepancy between the area of the observation window and the sum of reciprocal estimated intensity values at the points of the point pattern, i.e.\ we minimise $CvL(h) = (|W| - \sum_i 1/\hat\rho_g(x_i;h))^2$, where the sum is taken over all the data points $x_i$ and $\hat\rho_g(x_i;h)$ is the kernel intensity estimate with bandwidth $h$, evaluated in
$x_i$.
Then, once the bandwidth has been selected, the intensity estimate is corrected for edge effects through global edge correction (the option \texttt{diggle=FALSE} in the \texttt{spatstat} function \texttt{density.ppp}), i.e.~dividing the estimate by the convolution of the Gaussian kernel with the window of observation \citep{diggle1985kernel}.
Finally, for $w$ we use Ripley's isotropic edge correction in the summary statistic to correct for edge effects.
We repeated the procedure $39$ times, obtaining the result depicted in Figure \ref{fig:sim1}(c).
We stress that our approach seems to be robust with respect to the bandwidth specification, i.e.~the choice of bandwidth selection approach plays a minor role for the final result.

As evident from Figure \ref{fig:sim1}(c), the observed summary statistic completely lies within the envelopes, and this confirms the expected result of lack of spatial dependence/structure of the functional marks.
This result is further corroborated by the non-significant $p$-value, equal to $0.1$.

\subsubsection{Simulating spatially dependent functional marks}

To make the functional marks spatially dependent, we then superimpose a homogeneous spatial point pattern with $50$ points, generated in the $[0,0.5] \times [0,0.5]$ square, i.e. the bottom left region of the entire study region $W$. For these additional points, we generate different functional marks than before, namely with the underlying trend $\mu(t)=10+6\sin(3\pi z_t)$. Consequently, we have simulated a FMPP with spatially varying functional marks, i.e. not random labelled. We therefore expect a global test of random labelling to confirm this.

\begin{figure}[htb]
	\centering
\includegraphics[width=.425\textwidth]{F5.pdf}
\includegraphics[width=.275\textwidth]{F8.pdf}
	\caption{
	Result of global test for the spatially dependent simulated data (a);
	Output of the local test: significant points for which the hypothesis of random labelling is rejected are in pink (b).}
	\label{fig:5}
\end{figure}

We first run the same global test of random labelling as before.
We use $Q = 39$ and obtain a global $p$-value of $0.025$. This, together with the observed $K$-function lying outside the envelopes (Figure \ref{fig:5}(a)), indicates the ability of the global test to correctly detect the spatial dependence of the functional marks.

We know, however, that this conclusion should not be drawn for each point of the pattern, if we consider local restrictions of it, but specifically for those in the vicinity of the $[0,0.5] \times [0,0.5]$ square.
We therefore proceed by running our proposed local test, based on the proposed second order local $K$-function $\hat{\mathcal{K}}_{t,2}^{(x,m)}(r)$, $r\in[0,r_{max}]$, in Definition \eqref{def:LocalK},
with the same choice of test function $t(\cdot)$ and the same intensity estimation scheme as for the global one.
Figure \ref{fig:5}(b) depicts the points of the simulated point pattern, and it displays in pink those points for which the local test came out significant. Hence, this illustrates that the proposed local test is able to correctly identify some of the points, and consequently some parts of the region, where the hypothesis of random labelling does not hold locally.
Note that a universally preferable option for  $r_{max}$ does not exist.
In this paper, it is set to $\min(x_W,y_W)/4$, where $x_W$ and $y_W$ represent the maximum width and height of the observation region $W$, respectively; note that this rule of thumb is supported by \cite{diggle:13}.
Indeed, changing the value of  $r_{max}$ has an impact on the final results, and we found that our choice provided the best compromise among the options.

\subsection{Extended simulation study}  \label{sec:ex_sims}

This section aims to study the proposed method's performance in terms of classification rates considering different scenarios, concerning both the ground processes and the functional marks' structures.
To this end, we simulate under different such scenarios, to obtain a comprehensive understanding of the results of the local test in different settings.

In detail, we consider three types of ground process structures, all with an expected point count of 200: (1) a homogeneous Poisson process; (2) an inhomogeneous Poisson process with intensity function $\rho_g(x)=\rho_g(x_1,x_2)=\exp(3.5 + 3x_2)$, $x\in W$; (3) a Thomas process, with intensity of the Poisson process of cluster centres equal to 25, standard deviation of random displacement of a point from its cluster centre equal to 0.05, and mean number of points per cluster equal to 7.
They are all generated in $W$, i.e.\ the unit square, and will be referred to as the \textit{base patterns}.
Then, we superimpose additional simulated patterns in the $[0,0.5] \times [0,0.5]$ square, coming from the same generating processes, but with an expected number of points of 50; hereby the expected total number of points on $[0,0.5] \times [0,0.5]$ is $50+200/4=100$ and on its complement it is $150$. These additional patterns will be referred to as \textit{feature patterns}.

As for the functional marks, we consider the time domain $\mathcal{T}=[0,10]$ and, practically, we sample each simulated mark function in 100 equally spaced time points in $\mathcal{T}$.
We assume that each functional mark satisfies $f_i(t)=Z(x_i,t)$, where $x_i$ is the $i$th ground point and
\begin{align}
\label{e:BaseModel}
Z(x,t) = \mu + \xi(x,t), \quad (x,t)\in W\times\mathcal{T},
\end{align}
for a zero-mean stationary Gaussian random field $\xi$ with covariance function $C(h,u)$; here $h$ and $u$ denote the spatial and the temporal lags, respectively. For the base patterns, we consider $\mu=5$ and a pure nugget effect model with covariance function $C(h,u)=\sigma^2\mathbf{1}\{h=0\}$, $\sigma^2=0.01$. In other words, each $f_i$ is random noise with mean 5 and variance 0.01 and all $f_i$'s are iid; see the grey curves in the bottom panel of Figure \ref{fig:sims}.
For the feature patterns, we consider three different marking models:
\begin{enumerate}
    \item \label{itm:first} Shifted base model: We here let $\xi$ have the same form as in the base model but let $\mu=5.5$.
    \item \label{itm:second} Decreased variance base model: We here let $\xi$ have the same form as in the base model but let $\sigma^2=0.001$.
    \item \label{itm:third} Non-separable space-time model: We here let $\mu=5$ and consider a space isotropic

    covariance function given by $C(h,u)= (\psi(u)+1)^{-\delta/2} \phi(h /\sqrt{\psi(u) +1})$. Here, $\phi$ is a normal mixture and the corresponding covariance function only depends on the distance

    between two points, while

    $\psi$ is a variogram model, which we choose according to a fractal Brownian motion with fractal dimension $\alpha = 1$; this is an intrinsically stationary isotropic variogram model.

\end{enumerate}
We note that the first two of these scenarios represent independent but not identically distributed marks, whereas in the third scenario we additionally have that the marks are also dependent.
A graphical representation of the scenarios comes in Figure \ref{fig:sims}. On the top panel, we display the three ground patterns. On the bottom ones, the corresponding functional marks are depicted.

\begin{figure}[htb]
	\centering
\subfloat{\includegraphics[width=.33\textwidth]{hom.pdf}}
\subfloat{\includegraphics[width=.33\textwidth]{inh.pdf}}
\subfloat{\includegraphics[width=.33\textwidth]{tho.pdf}}\\
\vspace{-1.5cm}
\subfloat{\includegraphics[width=.33\textwidth]{hom2.pdf}}
\subfloat{\includegraphics[width=.33\textwidth]{hom3.pdf}}
\subfloat{\includegraphics[width=.33\textwidth]{hom4.pdf}}
	\caption{Simulation scenarios. \textit{Top panels}: spatial ground patterns; \textit{Bottom panels}: functional marks of model \eqref{e:BaseModel} (in grey) and of the marking models in item \ref{itm:first}, \ref{itm:second}, and \ref{itm:third}, from left to right (in pink).}
	\label{fig:sims}
\end{figure}

We show the results of the local test in terms of true-positive rate (TPR), false-positive rate (FPR), and accuracy (ACC), averaging over 100 simulated point patterns in Table \ref{tab:res}.
The rates are defined as
\begin{equation*}
    TPR = \frac{\text{true positives}}{\text{positives}}, \quad FPR = \frac{\text{false negatives}}{\text{negatives}}, \quad ACC = \frac{\text{true positives and negatives}}{\text{positives and negatives}}.
\end{equation*}
We of course wish to have TPR and ACC close to 1 and FPR close to 0.

As shown in Table \ref{tab:res}, the performance of the local test in terms of classification rates strongly depends on the difference in the functional marks. Specifically, changing only the mean of the underlying random field is not enough for properly identifying the points of the feature patterns.
This sufficiently improves when changing the variance only, but the best result is obtained when the whole model is changed, that is, changing the correlation structure.
The effect of the type of ground pattern is less evident but still present. The inhomogeneous Poisson scenario reports the best classification rates, followed by the Thomas and homogeneous Poisson ones.

Finally, we found that the test function $t(\cdot)$ based on the $L_2$ distance in Equation  \eqref{eq:testl} gave the better results overall. To further explore how the choice of test function influences the test, we also compared to a test function incorporating a derivative function accounting for the shape of the functional marks. This yielded similar results but turned out to be more computationally demanding.

\begin{table}[htb]
\centering
\caption{Results of the local test averaged over 100 simulated point patterns with an expected point count of 250 each.
}
\begin{tabular}{l|l|ccc}
 \toprule
Ground process&Marking model&TPR&FPR&ACC\\
  \midrule
Homogeneous Poisson&\eqref{itm:first}&0.112 &0.346 &0.583\\
Homogeneous Poisson &\eqref{itm:second}&0.583 &0.066 &0.820 \\
Homogeneous Poisson&\eqref{itm:third}&0.870 &0.024 &0.896 \\
\addlinespace
Inhomogeneous Poisson&\eqref{itm:first}&0.032 &0.585& 0.449\\
Inhomogeneous Poisson&\eqref{itm:second}&0.648& 0.084& 0.856 \\
Inhomogeneous Poisson&\eqref{itm:third}&0.895& 0.023& 0.932\\
\addlinespace
Thomas&\eqref{itm:first}&0.109 &0.394 &0.571\\
Thomas&\eqref{itm:second}&0.637 &0.088& 0.846\\
Thomas&\eqref{itm:third}&0.865 &0.025 &0.925\\
  \bottomrule
\end{tabular}
\label{tab:res}
\end{table}

\section{Real seismic data analysis}\label{sec:real}

We analyse data coming from the \textit{ISTANCE} dataset, presented in Section \ref{sec:data}.
More specifically, we analyse a sample dataset provided at \url{http://www.pi.ingv.it/instance/}.
The dataset contains 10000 records of 300 events, together with the associated metadata.
Figure 	\ref{fig:pre1} shows the earthquake locations and time occurrences.

\begin{figure}[htb]
	\centering
		\includegraphics[width=.35\textwidth]{pre1.pdf}
			\includegraphics[width=.55\textwidth]{times.pdf}
	\caption{Earthquake locations and time occurrences}
	\label{fig:pre1}
\end{figure}

We first compute the proposed local $K$-function. The left panels of Figure \ref{fig:x cubed graph13} depict the estimated local summary statistics. In particular, the green lines represent the global statistics, while the grey ones represent the individual contributions. In blue we also represent the theoretical value. In the top-left panel, the $K$-function is based on a kernel intensity estimate whose bandwidth is selected by \cite{diggle:13}'s rule, while in the bottom-left panel the bandwidth is chosen as in \cite{cronie2018non}. We observe some relevant differences: while with \cite{diggle:13}'s rule we depict different local $K$-functions deviating from the global one, following \cite{cronie2018non}, we find a unique outlying local $K$-function. This may be explained by the fact that \cite{cronie2018non}'s approach tends to yield a bit too large bandwidths when large parts of the study region contain no points, while \cite{diggle:13}'s approach tends to yield too small bandwidths in general; see \cite{cronie2018non} for details. Note that by increasing the bandwidth we decrease the intensity estimate and, as a consequence, the summand denominators in \eqref{eq:lo2} are decreased.
Therefore, we run the proposed local test of random labelling with both options for the bandwidth selection and, as expected, the differences observed in the computation of the local $K$-functions are reflected in the results of the test.

\begin{figure}[htb]
	\centering
	\subfloat{\includegraphics[width=.33\textwidth]{plot1.pdf}}
		\subfloat{\includegraphics[width=0.33\textwidth]{res1.pdf}}
			\subfloat{\includegraphics[width=0.33\textwidth]{res2.pdf}}
		\\
	\subfloat{\includegraphics[width=.33\textwidth]{plot2.pdf}}
		\subfloat{\includegraphics[width=0.33\textwidth]{res3.pdf}}
	\subfloat{\includegraphics[width=0.33\textwidth]{res4.pdf}}
	\caption{ \textit{Left panels:} Local $K$-functions. \textit{Center and right panels:}  Results of the local test at $\alpha = 0.1$. \textit{Top panels:} The $K$-function is based on a kernel intensity estimate whose bandwidth is selected by \cite{diggle:13}'s rule. \textit{Bottom panels:} The bandwidth is chosen as in \cite{cronie2018non}.}
	\label{fig:x cubed graph13}
\end{figure}

Figure	\ref{fig:x cubed graph13} displays the significant points (center panels) and the non-significant ones (right panels).
The top panels show the results with \cite{diggle:13}'s bandwidth while the bottom ones are obtained with \cite{cronie2018non}'s bandwidth. For both choices, we selected a
significance level of $0.1$.
We observe that the significant points tend to be similar in both cases, therefore the choice of bandwidth (selection method) does not seem to be crucial. We note that such bandwidth-induced differences were missing in the previously run simulation study. We attribute this sensitivity of the procedure to the shapes of the functional marks, that  are obviously more variable, if compared to the simulated ones.

Nevertheless, both bandwidths lead to significant events belonging to important well known Italian seismic sequences. Of course these sequences are likely generated by different underlying processes, giving rise to long-term and highly correlated aftershocks.

\section{Conclusions}
\label{sec:conc}

In this work, we have proposed a general form for local summary statistics for marked point processes, which has been exploited to define the family of local inhomogeneous mark-weighted summary statistics for spatial point processes with functional marks, i.e. Functional Marked Point Processes (FMPP). We have employed such local summary statistics to construct a local test for random labelling, that is, to identify points, as well as regions, where this hypothesis does not hold.

More specifically, we first introduce a general local function for marked point patterns.
With this specification, we are able to show that this function may be exploited to generate most summary statistics established in the literature.
With particular reference to the functional marked context, we define the family of local $t$-weighted marked $n$-th order inhomogeneous summary statistics based on the $K$-function, which is a local contribution to a global summary statistic estimator. We obtain a result for the expectation of the general local summary statistic and exploit it to derive an expression for the expectation of
our $t$-weighted local statistics.

Having access to these tools, we have proposed a local test of random labelling, resorting to the second order version of our proposed local estimator, obtaining a local test useful for identifying specific regions where a global test would not detect atypical behaviour of the points.

To study the performance of the test in terms of classification rates, we have conducted a simulation study, considering a number of scenarios with different ground processes and structures for the functional marks. Such simulations have shown that in many settings, the local test performs well in identifying points of a pattern where the hypothesis of random labelling is not verified.

We can draw a number of future work paths.
Nevertheless, the local functions proposed in this paper can be considered as a very informative synthesis of the local second order behavior, useful for characterising the study area by an extended marked model, based on the FMPP theory. Incorporating local characteristics as functional marks would become part of the so called
\textit{Constructed functional marks} (CFMs), which are marks reflecting the geometries of point configurations in neighbourhoods of the individual points.

Concerning the application to seismic data, we aim at including also auxiliary (non-functional) marks into the analysis. These could contain synthetic information about the waveforms, such as the arrival times of the seismic event, or the inter-time between the two.
The achievement of the unification of earthquake data and the FMPP theory would result in building a framework where it would be possible to exploit the available information of the seismic point process altogether.

A final comment concerns the possible extension of this paper's tools to spatio-temporal ground processes, which of course are of importance for processes which typically exhibit spatio-temporal interactions, such as the seismic one.

redpajama_set_name: RedPajamaArXiv


text:
National / Media | BIG IN JAPAN
Why marry, or worry, when we can be alone together in ohitorisama Japan?
All by myself: Ohitorisama (singles) culture is booming in Japan. | AP
Maybe humans were meant to live alone.
Two facts militate against that hypothesis: the sex drive and its natural consequence, the birth of children. The family seems an inevitable byproduct. Throughout history it has taken many forms, from tribal and clannish to nuclear. But families there have always been.
Does it follow that there always will be? Certain novelties peculiar to our age sow doubts. One is the primacy of individual happiness. Happiness was always desirable, always hoped for, but it was secondary. Obligations deemed sacred, conventions considered "natural," came first. They no longer do.
Marriage traditionally was a matter of course, more or less forced on people who felt unsuited to it. You could resist, but it took very strong character. As recently as 1990, a mere 5 percent of men and 4 percent of women in Japan were "lifetime singles," defined as people over 50 who have never married. By 2010 the percentages were 20.14 and 10.61, respectively. By 2030, demographers say, they will be 30 and 23. Nearly a third of all men and a quarter of all women, never marrying! The exclamation point seems warranted. From a historical perspective, it's an astonishing development.
It's where we're heading, and there's no end in sight. Marriage serves its purposes more or less well, protecting children and fostering social stability, but happiness? Maybe, if you're lucky — but other roads to it certainly look less chancy.
One hardly knows whether to laugh or cry, reading Shukan Post's article on henpecked husbands. It's a theme as old as marriage, usually played for laughs. Edo Period (1603-1867) rakugo (comic stories) made much of it. Sure, women were submissive; sure, men were domestic tyrants — that's the myth, but everyone knows who really rules, who really submits.
As then, so now, only worse, Shukan Post claims — "dramatically."
The evidence is anecdotal rather than scientific, but husbands do seem to be an aggrieved species, the more so as they age and shed youthful illusions.
"Mr. A," a real-estate broker in his 50s, leaves the house at 7 a.m. and gets back at 9 p.m. To what? Some well-deserved relaxation? Far from it. There are chores to do — dishes to wash, a bathtub to clean. Which wouldn't be so bad, but his wife superintends, and she's a hard taskmaster, never satisfied, always finding fault.
"You call that clean?"
"Do it yourself then," grumbles Mr. A under his breath.
Why under his breath? Because "If I spoke up, she'd get fired up and there'd be no end to it."
"I work too, you know," she'd remind him. She does — from 10 a.m. to 4 p.m. You'd think his hours would trump hers, but she doesn't see it that way, and poor Mr. A is simply too weary to insist.
Wage-earning employment gives a wife dignity and confidence, but housewives seem no less demanding.
"You think it's easy preparing meals for you every day?" remonstrates "Ms. B." "The husband next door can cook; he gives his wife a break now and then." Mr. B. can't cook, and if the price of home cooking is allowing himself to be led around by the nose, he, like Mr. A, will swallow his pride and bow his head in shame and submission.
There's the perennial issue of spending money. Japanese wives have traditionally controlled the household budget, husbands surrendering their salary and subsisting on a weekly "allowance." When the economy tanked 20 years ago, allowances began shrinking. They still are.
"Thanks to Abenomics, my bonus went up a little," says "Mr. C," a company employee in his 40s. "You'd think my allowance would too, no?" No. "It went down — don't ask me why.
"I say, 'I can't eat lunch on this.' She says, 'There are cheap ramen restaurants all over the place!' Or she says, 'Give up drinking after work and have a nice lunch instead.' But she goes drinking with her friends! Well, good, it gives me a nice quiet evening at home. But then at midnight, the phone rings: 'Come pick me up at the station.' 'Pick you up at the station! I have to work tomorrow!' 'You don't care if something dreadful happens to me!' 'All right, all right . . .' "
On and on it goes. A father can't give his kid a good scolding without Mom taking the kid's side: "That's not how to bring up a child!" "No wonder the kids don't listen to me!" grouses one husband whose efforts to discipline the children end up with him being disciplined by his wife — in front of the children.
Men no longer feel at home at home. Where to seek refuge? The toilet is one answer, and Shukan Post quotes a humorous haiku to that effect: "Territorial rights: She gets the living room, I get the toilet." Even that is qualified: "She won't let me read in there — says it makes the books dirty."
Sociologists and family consultants have their explanations for the extreme submissiveness they increasingly see in husbands. One, of course, is the blurring of once clearly distinct gender roles. Another is the fact that men, for all their worldly experience, seem less communicative and less socially sophisticated than women. They don't speak up for themselves because they can't. Maybe they should learn before their downward slide into domestic oblivion goes much farther.
So this is marriage! Not inevitably, not for everyone, but what's a young single adult to think, reading Shukan Post's story? One of two things: "My marriage will be different" — or, "My marriage won't be different; to hell with marriage, I'm staying single!"
Last month's edition of Shincho 45 magazine profiled several Japanophile foreigners (BIJ, Feb. 2). What do they like about Japan? One of them, Swiss-born TV personality Haruka Christine, praised "ohitorisama culture." "Ohitorisama" refers to people living and doing things alone. Japan seems to be spawning the trend faster than other countries — certainly faster than Switzerland, she says, where being alone is seen as pathetic rather than bold and potentially fulfilling. In Japan people dine out alone, sing karaoke alone — and, increasingly, live alone. Thirty-two percent of all households nationwide are single-occupant.
Is Japan evolving into an ohitorisama nation? Time will tell, but for now it's easy to imagine Shukan Post's harassed, aging marriage victims sighing, "If only ohitorisama culture had been around 30 years ago. I might have lived, instead of . . ."
gender, women, relationships, marriage

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: stuck trying to append a Meme for my meme generator I'm stuck trying to append a meme to the page for an assignment I have, here are the requirements for the assignment:
Meme Generator
For this assignment, you'll be building a meme generator in the browser using HTML, CSS, and JavaScript.
Your generator should consist of a form that accepts a link to an image, text for the top of the meme, and text for the bottom of the meme. When the user submits the form, use JavaScript to append to the DOM a div which contains the meme, including the image and its text.
Requirements
User should be able to submit a form on the page to generate a new meme on the page, and should be able to add multiple memes to the page by submitting the form multiple times.
Users should be able to click on a button to remove a meme from the page.
When the meme form is submitted, values in the form inputs should be cleared.
here's what I have so far, I'm getting an error:
memeproject.js:13 Uncaught TypeError: Cannot read properties of undefined (reading 'add')
at HTMLFormElement. (memeproject.js:13)
const form = document.querySelector("#memeform");
const topInput= document.querySelector('input[name="top"]');
const bottomInput= document.querySelector('input[name="bottom"]');
const img= document.querySelector('input[name="image"]');
form.addEventListener('submit', function(evt){
    evt.preventDefault();
    const memeform = document.createElement("div");
    const topInput= document.createElement("div");
    const bottomInput = document.createElement("div");
    const img = document.createElement("img");

    img.src= document.getElementById("imageLink").value;
    topText.classlist.add("topText");
    topInput.innerHTML= document.getElementById("topText").value;

    bottomInput.classList.add("bottomText");
    bottomInput.innerHTML= document.getElementByIc("bottomText").value;

    memeform.classList.add("meme");
    memeform.append(textTop);
    memeform.append(textBottom);
    memeform.append(img);
    let memeLocation = document.getElementById("location");
    memeLocation.append(meme);

form.reset()
});

<!DOCTYPE html>

   <meta charset="UTF-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Document</title>

DANK MEME MAKER THINGY

   <form id="memeform">

Top Text: <input id="topText" type="text" name="top">

</he>Bottom Text: <input id="bottomText" type="text" name="bottom">

Image Link: <input id="imageLink" type="url" name="image">

           <input id="Create Meme!" type="submit" value="Create Meme!">

     </form>

A: You did not find topText by querySelector which is not defined.
That is why you got error in line 13

redpajama_set_name: RedPajamaStackExchange


Journey Journey and Def Leppard are proud to announce Cheap Trick will be joining them as special guests on Friday, August th at Busch Stadium Read More Gurney Journey This weblog by Dinotopia creator James Gurney is for illustrators, plein air painters, sketchers, comic artists, animators, art students, and writers You ll find practical studio tips, insights into the making of the Dinotopia books, and first hand reports from art schools and museums. Hero s journey In narratology and comparative mythology, the monomyth, or the hero s journey, is the common template of a broad category of tales that involve a hero who goes on an adventure, and in a decisive crisis wins a victory, and then comes home changed or transformed. The study of hero myth narratives started in with anthropologist Edward Burnett Tylor s observations of common patterns in plots NASA s Journey to Mars NASA NASA is developing the capabilities needed to send humans to an asteroid by and Mars in the s goals outlined in the bipartisan NASA Authorization Act of and in the U.S National Space Policy, also issued in . Annenberg Learner Teacher Professional Development Digital Learning Day Feb Today is Digital Learning Day Below are three ways Annenberg Learner and our partner, Journey North, can help you Ways to Engage Students in Their Communities As educators, we know it s important to engage students by providing real world applications of classroom content. List of Series to be Discontinued on December , PLEASE NOTE Over time Moon to Mars NASA Moon to Mars NASA s plans to enable human exploration of the Moon as preparation for human missions to Mars and deeper into the solar system. Lewis and Clark PBS Lewis and Clark, the companion Web site to the Ken Burns film, Lewis and Clark The Journey of the Corps of Discovery. Powell s Books The World s Largest Independent Bookstore Powell s Blog Playlists Sophia Shalmiyev s Playlist for Mother Winter by Sophia Shalmiyev This is the song I would say describes how I really feel inside and who I want to be If I could have written any song in the whole wide world, this would be the one My Journey Into The Orthodox Church Real Jew News What s a nice Jewish boy doing in the Russian Orthodox Church some of you may be asking Well, it shouldn t seem all that strange For after all, the founders of the Orthodox Church were all Jews beginning with St Peter and St Paul But, I wouldn t even begin to compare myself with them The Hobbit The Battle of the Five Armies Official Movie The official movie site for The Hobbit The Battle of the Five Armies.
About " Edward Abbey Jim Stiles "


text:
Q: unable to Webscrape dropdown item [Python][beautifulsoup] i am new to webscraping, i am scraping a website - https://www.valueresearchonline.com/funds/22/uti-mastershare-fund-regular-plan/
In this,i want to scrape this text - Regular Plan

But the thing is, when i do it using inspect element,
code -
import requests
from bs4 import BeautifulSoup
import csv
import sys

url = 'https://www.valueresearchonline.com/funds/newsnapshot.asp?schemecode=22'
res = requests.get(url)
soup = BeautifulSoup(res.text, "html.parser")
regular_direct = soup.find('span',class_="filter-option pull-left").text

print(regular_direct)

i get none in printing, and i don't know why, the code in inspect element and view page source is also different, because in view page source, this span and class is not there.
why i am getting none?? can anyone please tell me and how can i get that text and why inspect element code and view page source code are different?

A: You need to change the selector because the html source that gets downloaded is different.
import requests
from bs4 import BeautifulSoup
import csv
import sys

url = 'https://www.valueresearchonline.com/funds/newsnapshot.asp?schemecode=22'
res = requests.get(url)
soup = BeautifulSoup(res.text, "html.parser")
regular_direct = soup.find("select", {"id":"select-plan"}).find("option",{"selected":"selected"}).get_text(strip=True)

print(regular_direct)

Output:
Regular plan


text:
Authentic old and antique maps of Florida for sale. Our rare Florida map inventory often features sea charts of the Florida coast, Florida Keys charts, maps of the Everglades, and city views and plans of Miami, Palm Beach, Tampa and elsewhere. Vintage pictorial maps of Florida are also for sale.
La Descrittione Di Tutto Il Peru
Stock# 36265sh
Download Small Image
Paolo Forlani
Publication Place / Date
Venice / 1562 circa
Image Dimensions
Uncolored
Sell Us a Map
Image purchase not available
All of our maps are authentic antique maps, printed or drawn on or about the date shown in the description. In rare instances when we offer facsimiles, we will specifically describe the map as a later facsimile and include the date of publication. Certificates of Authenticity are available upon request. Simply mention your desire to receive one in the Notes section at checkout.
Fast, Global Shipping
Last year we shipped over 4,500 antique maps to more than 50 countries. Maps are shipped Monday through Friday year-round. If an order is received before 2 PM PST, we will ship the order that day. If an order is received after that time, we will ship the next day. We ship maps either flat in custom packages or in specially ordered thick tubes. Shipping rates are provided as part of the checkout process.
Forlani's Map of South America—The Only Lafreri School Map of The Continent
Rare map of South America by Paolo Forlani. It was the first map of South America to show the interior in considerable detail and is the only map of the continent produced by the Lafreri School.
The map, one of the earliest continental maps of South America printed, features South America and much of the West Indies. Central America and a truncated Florida are included. The continent is shown in a stout, diamond form, with the Straits of Magellan separating the mainland from a large Tierra del Fuego. Tierra del Fuego continues into the map's southern edge, a suggestive coast of a larger, unknown southern continent.
Unlike Forlani's world maps—he released four in the 1560s—this map shows the Amazon with an east-west orientation, as opposed to north-south. The mighty river branches into several more in the interior, which is also filled with mountains. The Rio de la Plata delta is exaggeratedly wide and dotted with islands.
A glance over the toponyms offers many familiar names, although their placement reflects the still uncertain geographic knowledge about South America that was circulating in Europe in the mid-sixteenth century. Quito is in the center of the continent, with Cartagena far inland too. Lake Titicaca, here written as Titicacha, is also nestled deep into the central area of the landmass.
The continent itself is labeled Peru, rumored to be rich in rare metals and jewels. The Spanish invasion and conquest of the Inca Empire was ongoing while the map was made, fueling these rumors.
In the upper right corner is a fine strapwork cartouche with the title and a dedication. This dedication is to Giovanni Pietro Contarini, Forlani's parton and a history writer. In the stippled waters of the South Seas is an embellished compass rose.
One source for this map was the work of Giacomo Gastaldi, who, like Forlani, worked in Venice. A near contemporary of this map is the 1562 wall map of the Americas by Diego Gutierrez. However, Forlani's work sharply diverges from Gutierrez's interpretation. Gutierrez's continent is less stretched east-west and has very different river configurations, especially of the Amazon and Rio de la Plata.
The map is a fine example of the Lafreri School's output and of Forlani's distinctive style. It is a treasure of elite institutional collections and is rare on the market.
The Lafreri School
Forlani was a skilled and prolific engraver and mapmaker. His maps were frequently used in the famous Lafreri atlases, sets of maps—not necessarily uniform—selected and bound together on demand. The Lafreri School is a commonly used name for a group of mapmakers, engravers, and publishers who worked in Rome and Venice from ca. 1544 to 1585.
The makers, who were loosely connected via business partnerships and collaborations, created maps that were then bound into composite atlases; the maps would be chosen based on the buyer or compiler's interests. As the maps were initially published as separate-sheets, the style and size of maps included under the umbrella of the "School" differed widely. These differences can also be seen in the surviving Lafreri atlases, which have maps bound in with varying formats including as folded maps, maps with wide, trimmed, or added margins, smaller maps, etc.
The most famous mapmakers of the School included Giacomo Gastaldi and Paolo Forlani, among others. The School's namesake, Antonio Lafreri, was a map and printseller. His 1572 catalog of his stock, entitled Indice Delle Tavole Moderne Di Geografia Della Maggior Parte Del Mondo, has a similar title to many of the composite atlases and thus his name became associated with the entire output of the larger group.
Ashley Baynton-Williams, "The 'Lafreri School' of Italian Mapmakers circa 1544-1602" MapForum; R.V. Tooley: Maps in Italian Atlases of the Sixteenth Century, being a comparative list of the Italian maps issued by Lafreri, Forlani, Duchetti, Bertelli and others, found in atlases, Imago Mundi III (1939) (reprint edition, Amsterdam: N. Israel, 1964), 93; David Woodward: The Maps and Prints of Paolo Forlani A Descriptive Bibliography (Chicago, Newbery Library, 1990), 11, map 3. KAP
Paolo Forlani Biography
Paolo Forlani (fl. ca. 1560-1571) was a prolific map engraver based in Venice. All that is known of his life are his surviving maps and prints, of which there are almost 100 (185 with later states included in the total). He also produced a globe and two town books. It is likely he came from Verona and that he died in Venice in the mid-1570s, possibly of the plague.
Antique Maps / United States / Florida
Antique Maps / Caribbean & Central America / Caribbean
Antique Maps / Caribbean & Central America / Central America
Antique Maps / South America / South America
Daytona Beach Resort Area
The World's Most Famous Beach -- 13 Mile Driving Beach
Carte de L'Ocean Atlantique Septentrional Dressee en 1852 par Mr. P. Daussy . . . 1854
Illustrating the Gulf Stream and Scarce sea chart of the North Atlantic, published by the French Depot De La Marine in 1854.
Pascaerte van 't westelyckste deel vande Spaense Zee, Tuschen Brasil, de zoute en Vlaemse Eylanden, en voorwestwart op
Rare Dutch Sea Chart of the Western Atlantic and Approaches To North America
The coast of South America, from latitude 2° south to 9° north, long. 45° to 61° west. Drawn & engraved by Charles Copley, under the direction of George W. Blunt. . . . 1848
Rare separately published American Sea chart of the Northeastern coastline of South America, drawn by Charles Copley and published by Blunt.
South America as Divided amongst The Spaniards and The Portuguese, The French and The Dutch
From Dunn's New Atlas or Mundane System of Geography, published by Laurie & Whittle.
Album Filatelico y Geografico de la America del Norte (and) America Del Norte Filatelica (anonymous manuscript illustrations)
Award winning pair of manuscript cards, prepared by Antonio Raggio for the 11th Congreso de la Union Postal Universal (World Postal Congress) Exposition Filatelica Internacional, held in Buenos Aires, Argentina, in 1939.


text:
DOTr names its Visayas representatives
Jul 3, 2019 DOTr, Michael Dino, OPAV, Visayas
Transportation Secretary Arthur Tugade named two officials to represent the agency in the Visayas.
He is referring to Department of Transportation (DOTr) OIC-Undersecretary Mark Richmund de Leon and Eymard Eje,Assistant Secretary for Rails and Project Implementation-Mindanao, as the alternative representative.
In a press release sent by the Office of the Presidential Assistant for the Visayas (OPAV), the designation of de Leon is a result of the request of Secretary Michael Dino.
"I am really happy that Secretary Tugade has finally assigned representatives here in the Visayas, this goes to show how serious DOTr, OPAV, and the Duterte Administration in implementing and expediting DOTr projects in the Visayas," said Dino.
De Leon and Eje will be DOTr's representatives during the Regional Development Committee (RDC) of the National Economic Development Authority (NEDA) in Visayas regions.
"The designated permanent representative is tasked to attend the NEDA-Regional Development Committee (NEDA-RDC) meetings and other coordination meetings for the effective and efficient implementation of projects involving the participation of the DOTr," the letter of Secretary Tugade reads.
Secretary Tugade also made their appointments to take effect immediately.
The call of Secretary Dino for a representative of DOTr in the Visayas is to make sure that the agency's projects on mass transport systems, airports, and seaports needed in the Visayas be implemented as quickly as possible.
"We welcome both Usec. De Leon and Asec. Eje in the Visayas, both are highly competent and hardworking that can help us here in the Visayas," he added.
He also said that this will expedite the Integrated Inter-Modal Transport System (IITS) in Cebu. The IITS will include a Bus Rapid Transit that will serve as feeder system to the backbone monorail transport system in Cebu.
Sec. Dino also revealed that after his recent meeting with the consultant from DOTr, there will be new alignments for the project to address the riding needs of the public, and promised that there will be at least two lanes per direction for private vehicles together with the planned transport systems.
Both Usec. de Leon and Asec. Eje were among those who met with Secretary Dino and other regional directors in Central Visayas on June 3, 2019 to talk about the Cebu IITS. /PR, OPAV
UK variant of SARS-CoV-2 virus now in PH
Duterte names Boholano dismissed for anomalies
Jan 5, 2021 Bohol Island News
Robredo wants transparency on PSG's unauthorized Covid-19 vaccinations


The future of train travel looks more exciting than ever, thanks to the announcement of an extension to the Trans-Siberian Railway that could bring passengers from London to Tokyo on a 13,518-kilometer route.
For years, a journey on the historic railway had been hailed as a milestone for lovers of train travel as the current 9900-kilometer route between Moscow and Vladivostok is believed to be the longest train journey of its time.
According to The Independent, the Russian government has announced plans to extend the current railway to Japan. The new plan would take passengers through Germany, Poland, and Russia, before arriving in Hokkaido, where it would link up with the Japanese rail network.
In light of tensions between the two countries following World War II, this plan has been nicknamed the "bridge across history" as it looks set to strengthen relations should it come to fruition.


text:
You are here: Home News Catholic actor Fraiser's John Mahoney dies aged 77
Catholic actor Fraiser's John Mahoney dies aged 77
Tuesday, 6th February 2018
British-born Catholic actor John Mahoney, famous for his role as Martin Crane in hit US sitcom Frasier, has died at the age of 77.
Mahoney, who appeared in the long-running series for 11 years, died in Chicago on Sunday 4th February.
He earned legions of fans and a Screen Actors Guild award for his portrayal of the cranky retired detective and army veteran Marty, father of Kelsey Grammer's Frasier.
He starred in Frasier from its first episode in 1993 to its final show in 2004 and was twice nominated for an Emmy for the role. He was joined in 193 episodes by Eddie, Marty's beloved terrier.
The sitcom's casting director, Jeff Greenberg, paid tribute to Mahoney, tweeting: 'I've not known a kinder man nor more brilliant actor. We were all blessed to have spent 11 glorious years together.'
Meanwhile, US actress Peri Gilpin, who appeared alongside him throughout Frasier's 263 episodes as Roz Doyle, tweeted a picture of Mahoney singing at her wedding, adding: 'Watch Moonstruck, Say Anything and/or Frasier or anything you can with him in it and raise a glass to John. Remember him well.'
Mahoney was born in Bispham, Blackpool, on 20th June 1940 after his Irish-Catholic family was evacuated there from their home city of Manchester during the Second World War.
Mahoney opened up about his faith during his time on Fraiser when The Chicago Tribune interviewed him in 1996.
"I was raised a Catholic and still practice, though probably not as often as I should," he told the paper. "But when I say my prayers every day, I ask for love and respect and dignity. And I try to give those things too."
Mahoney was educated at St Joseph's Catholic College in Blackpool and, following the war, the family eventually moved back to Manchester, where he attended the Stretford Children's Theatre.
Mahoney later moved to the US where he was granted citizenship after service in the military.
After teaching English at Western Illinois University, Mahoney decided to take up acting and joined the Steppenwolf Theatre in the mid-1970s.
As well appearing in Frasier, Mahoney starred in a vast array of TV shows and films, including Tin Men, the aforementioned Moonstruck and the Coen Brothers' Barton Fink.
He most recently appeared on TV screens in 2015, when he portrayed businessman Andrew Del Mar in an episode of ITV drama Foyle's War. He took time to revisit parts of North West England from his childhood while filming the ITV show.
Mahoney lived in Oak Park, Illinois, and admitted to falling in love with Chicago after visiting there as a student.
Picture: John Mahoney. (Globe Photos/SIPA USA/PA).
Tags: Andrew Del Mar, Barton Fink, Bispham, Blackpool, Chicago, Coen, Coen Brothers, Coens, Eddie, Emmy, Foyle's War, Fraiser Crane, Frasier, Illinois, Irish Catholic, ITV, Jeff Greenberg, John Mahoney, Kelsey Grammer, Mahoney, Manchester, Martin Crane, Marty Crane, military, Moonstruck, North West England, Oak Park, Peri Gilpin, Roz Doyle, Say Anything, Screen Actors Guild, Second World War, St Joseph's College, St Joseph's Catholic College, Steppenwolf Theatre, Stretford, Stretford Children's Theatre, Tin Men, US, Western Illinois University
< Previous - Next >


See the ShareThe.TV thread for more information.
Show off your entire movie collection online with your ShareThe.TV profile! By enabling this addon, you can keep your XBMC movie collection in sync with your ShareThe.TV profile so that others can check out your collection. You can also follow other users who share similar tastes, with the goal of getting ideas on more movies you can add to your collection.
This page was last edited on 3 February 2019, at 02:25.


text:
Back to the Basics: What is Negligence in Florida?
By Jimmy Fasig
Negligence is a word that most of us know. A person can be negligent in their actions, or negligent in their duty, or the use of a particular word or phrase might have been negligent. However, most of us haven't had the opportunity to understand the legal implications of the term negligence. While much of the legal world is populated by what are called intentional torts, negligence is a very common "catch-all" that applies in a variety of circumstances, including most Tallahassee car accidents.
Negligence & Liability in Florida
In a legal sense, negligence is comprised of four factors: duty, breach, causation, and harm.
Duty exists when a person has a legal obligation to perform in a certain way. A good way of explaining this concept is in the situation of the automobile driver. When driving a car, motorcycle, boat, or plane, the driver has a duty to operate their vehicle in a manner consistent with the laws and rules of the road. While following all the rules can still sometimes result in an accident, the idea is that the rules will help prevent injury and damage. The laws, therefore, exist to impose the duty on the driver. Violating this duty by breaking the law, operating in an unsafe manner, or otherwise breaching a statutorily defined rule is the first step in being found guilty of negligence.
Breach is a very simple concept in most cases. In order for a breach to exist, there must first be a duty. A speed limit, for example, imposes the duty on drivers to operate their vehicles within the acceptable limits outlined by statute. Breaking the speed limit, therefore, is a breach of duty. Similarly, operating the vehicle in other unsafe ways, such as random swerving out of the lane, running red lights, or otherwise operating a vehicle in a dangerous manner are all breaches of duty.
Causation is the connection between the breach of a duty and the harm suffered. For example, if someone is speeding down the highway at twice the speed limit and someone going the other way runs off the road for an unrelated reason, there is no connection between the speeder and the person who lost control of their vehicle. Therefore, there is no causation between the breach of duty and the harm suffered; the injured party cannot sue the other for negligence. Other ways the breach of a duty can be interrupted is through an intervening cause, which removes the liability of the original person breaching their duty.
Finally, for negligence to be applicable, there must be some sort of harm suffered. The victim must have some type of measurable harm. Most often this manifests in physical damages to the victim such as a broken bone or other damage to their physical person. There are, however, special forms of damages specifically designed to address mental anguish, fallout from other damages, or even statutorily defined categories of damages unique to a specific state.
Florida Accident Lawsuits
So why is this in any way relevant or important to your personal injury or automotive accident case?
Most accidents resulting in an injury include negligence claims. There are many legal cases that allow for the recovery of damages where one person intentionally harms another (i.e. assault and battery). However, in most cases that lead to injury lawsuits, negligence is the underlying principle involved.
Negligence functions whether or not the person at fault intended the damage that occurred. The reason why it is so common in auto accidents, is that most accidents are not intentional. For this reason, it is important to make sure you retain experienced legal counsel in order to tailor your legal case to the specific needs of your situation.
Let the skilled attorneys at Fasig & Brooks in Tallahassee help. Contact us today for a free initial consultation.