Package 'sinar'

Title: Conditional Least Squared (CLS) Method for the Model SINAR(1,1)
Description: Implementation of the Conditional Least Square (CLS) estimates and its covariance matrix for the first-order spatial integer-valued autoregressive model (SINAR(1,1)) proposed by Ghodsi (2012) <doi:10.1080/03610926.2011.560739>.
Authors: Gilberto P. Sassi [aut, cre], Carolina C. M. Paraíba [aut]
Maintainer: Gilberto P. Sassi <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-11-13 02:42:39 UTC
Source: https://github.com/gilberto-sassi/sinar

Help Index


Counts of arthropods in a grid-sampled wheat field

Description

A matrix with the counts of arthropods (carabidae) in a grid-sampled wheat field

Usage

data("carabidae")

Format

A matrix where each row and column is a count of carabidae species at the first cell.

Source

Kevin Wright (2020). agridat: Agricultural Datasets. R package version 1.17. https://CRAN.R-project.org/package=agridat


Conditional least square estimates for a SINAR(1,1) process.

Description

cls computes the conditional least square for a process described by

Xi,j=a10Xi1,j+a01Xi,j1+a11Xi1,j1+ϵi,jX_{i,j}= a_{10} X_{i-1,j} + a_{01} X_{i,j-1} + a_{11} X_{i-1, j-1} + \epsilon_{i,j}

where ϵi,j\epsilon_{i,j} is an iid process with poison distribution. Note the a10,a01,a11a_{10}, a_{01}, a_{11} must belong to the interval [0,1][0,1]. We obtain estimates for a10,a01,a11a_{10}, a_{01}, a_{11} and μϵ\mu_\epsilon. We do not make any asumption about the distribution of the innovation in the process.

Usage

cls(X)

Arguments

X

A integer matrix where each cell is the observed value in the regular lattice.

Value

a vector with the estimates of a10,a01,a11,μa_{10}, a_{01}, a_{11}, \mu.

Examples

data("nematodes")
cls(nematodes)

Empirical estimate for the Covariance matrix in the Klimko-Nelson.

Description

Σ\Sigma is the covariance matrix in the Klimko-Nelson seminal paper. Basically, we know

n(a^10a10,a^01a01,a^11a11,μ^ϵμϵ)MNV(0,Σ)\sqrt{n}(\hat{a}_{10} - a_{10}, \hat{a}_{01} - a_{01}, \hat{a}_{11} - a_{11}, \hat{\mu}_\epsilon - \mu_\epsilon)^\top \sim MNV(0, \Sigma)

where

Σ=V1WV1.\Sigma = V^{-1}W V^{-1}.

For more details, check Klimko and Nelson (1978).

Usage

emp_cov(X)

Arguments

X

A integer matrix where each cell is the observed value in the regular lattice.

Value

The covariance matrix estimated empirically.

Examples

data("nematodes")
emp_cov(nematodes)

Empirical estimate for the matrix V in the Klimko-Nelson.

Description

emp_V is the matrix in the Klimko-Nelson seminal paper. Basically, we know

n(a^10a10,a^01a01,a^11a11,μ^ϵμϵ)MNV(0,Σ)\sqrt{n}(\hat{a}_{10} - a_{10}, \hat{a}_{01} - a_{01}, \hat{a}_{11} - a_{11}, \hat{\mu}_\epsilon - \mu_\epsilon)^\top \sim MNV(0, \Sigma)

where

Σ=V1WV1.\Sigma = V^{-1}W V^{-1}.

For more details, check Klimko and Nelson (1978).

Usage

emp_V(X)

Arguments

X

A integer matrix where each cell is the observed value in the regular lattice.

Value

The matrix V estimated empirically.

Examples

data("nematodes")
emp_V(nematodes)

Empirical estimate for the matrix W in the Klimko-Nelson.

Description

emp_W is the matrix in the Klimko-Nelson seminal paper. Basically, we know

n(a^10a10,a^01a01,a^11a11,μ^ϵμϵ)MNV(0,Σ)\sqrt{n}(\hat{a}_{10} - a_{10}, \hat{a}_{01} - a_{01}, \hat{a}_{11} - a_{11}, \hat{\mu}_\epsilon - \mu_\epsilon)^\top \sim MNV(0, \Sigma)

where

Σ=V1WV1.\Sigma = V^{-1}W V^{-1}.

For more details, check Klimko and Nelson (1978).

Usage

emp_W(X)

Arguments

X

A integer matrix where each cell is the observed value in the regular lattice.

Value

The matrix W estimated empirically.

Examples

data("nematodes")
emp_V(nematodes)

A matrix of counting data with 15 rows and 15 columns.

Description

A matrix of counting data with 15 rows and 15 columns.

Usage

data("nematodes")

Format

Dataset of 15 × 15 regular grid on counts of cereal cyst-nematode (Heterodera avenae collected in soil core).

Source

PERRY, J. N. et al. SADIE: software to measure and model spatial pattern. Aspects of applied biology, v. 46, p. 95-102, 1996.


Simulating SINAR(1,1) process with innovations from a poison distribution.

Description

sinar_pois returns a matrix representing a simulated regular lattice from a SINAR(1,1) process with innovations from a poison distribution.

Usage

sinar_pois(n_row, n_col, a10, a01, a11, l)

Arguments

n_row

Number of rows in the simulated lattice.

n_col

Number of columns in the simulated lattice.

a10

Coefficient from the element Xi1,jX_{i-1, j}.

a01

Coefficient from the element Xi,j1X_{i, j-1}.

a11

Coefficient from the element Xi1,j1X_{i-1, j-1}.

l

Mean of the poison distribution used as innovations.

Details

This function simulates a regular lattice from the model

Xi,j=a10Xi1,j+a01Xi,j1+a11Xi1,j1+ϵi,jX_{i,j}= a_{10} X_{i-1,j} + a_{01} X_{i,j-1} + a_{11} X_{i-1, j-1} + \epsilon_{i,j}

where ϵi,j\epsilon_{i,j} is an iid process with poison distribution. Note the a10,a01,a11a_{10}, a_{01}, a_{11} must belong to the interval [0,1][0,1].

Value

A integer matrix.

Examples

n_row <- 20
n_col <- 50
a10 <- 0.2
a01 <- 0.2
a11 <-  0.5
l <- 1
sinar_pois(n_row, n_col, a10, a01, a11, l)

Compute the value of matrix V using the coefficients.

Description

V is the theoretical matrix from Klimko-Nelson for the SINAR(1,1) model. Basically, we know

n(a^10a10,a^01a01,a^11a11,μ^ϵμϵ)MNV(0,Σ)\sqrt{n}(\hat{a}_{10} - a_{10}, \hat{a}_{01} - a_{01}, \hat{a}_{11} - a_{11}, \hat{\mu}_\epsilon - \mu_\epsilon)^\top \sim MNV(0, \Sigma)

where

Σ=V1WV1.\Sigma = V^{-1}W V^{-1}.

For more details, check Klimko and Nelson (1978).

Usage

teo_V(a10, a01, a11, mu_e, s2_e)

Arguments

a10

is the parameter in the equation X[i,j]a10X[i1,j]+a01X[i,j1]+a11X[i1,j1]+ϵi,jX[i, j]a_{10}X[i - 1, j] + a_{01}X[i, j - 1] + a_{11}X[i - 1, j - 1] + \epsilon_{i,j}

a01

is the parameter in the equation X[i,j]a10X[i1,j]+a01X[i,j1]+a11X[i1,j1]+ϵi,jX[i, j]a_{10}X[i - 1, j] + a_{01}X[i, j - 1] + a_{11}X[i - 1, j - 1] + \epsilon_{i,j}

a11

is the parameter in the equation X[i,j]a10X[i1,j]+a01X[i,j1]+a11X[i1,j1]+ϵi,jX[i, j]a_{10}X[i - 1, j] + a_{01}X[i, j - 1] + a_{11}X[i - 1, j - 1] + \epsilon_{i,j}

mu_e

is the mean of the innovations ϵi,j\epsilon_{i,j}

s2_e

is the standar deviation of the innovations ϵi,j\epsilon_{i,j}

Value

The matrix V estimated empirically.

Examples

n_row <- 20
n_col <- 50
a10 <- 0.2
a01 <- 0.2
a11 <-  0.5
l <- 1 # mean and variance for poison innovations

teo_V(a10, a01, a11, l, sqrt(l))

Variance of standard deviation of epsilon.

Description

σ^ϵ\hat{\sigma}_\epsilon is the standard deviation of SINAR(1,1)SINAR(1,1) model.

Usage

var_hat_sigma(X)

Arguments

X

A integer matrix where each cell is the observed value in the regular lattice.

Value

The variance of standard deviation of the estimate of σϵ\sigma_\epsilon.

Examples

data("nematodes")
var_hat_sigma(nematodes)

Empirical estimate for the variance of innovations.

Description

σϵ2\sigma^2_\epsilon is the variance the innovations for the SINAR(1,1)SINAR(1,1) model.

Usage

var_sinar(X)

Arguments

X

A integer matrix where each cell is the observed value in the regular lattice.

Value

The estimated standard deviation in the SINAR(1,1)SINAR(1,1).

Examples

data("nematodes")
var_sinar(nematodes)