fit_splm: Estimate a spatial linear model

View source: R/fit_splm.R

fit_splmR Documentation

Estimate a spatial linear model

Description

Estimate parameters for spatial linear model and form object of class splm.

Usage

fit_splm(X, y, cov_type, theta_ini = NULL, dist_mtx = NULL,
  dist_K = NULL, dist_S = NULL, est_meth, include_hessian = F,
  knot_coord = NULL)

Arguments

X

Design matrix. Must include column of 1's for intercept.

y

Numeric response vector.

cov_type

character. Type of covariance model: exponential, gaussian, or spherical.

theta_ini

numeric vector. Initial values for covariance parameters: logarithm transformed nugget, partial sill, and range, in that order. If not specified uses default initialization.

dist_mtx

Distance matrix used to compute covariance matrix.

dist_K

Distance matrix for knot locations.

dist_S

Distance matric between data locations and knots (nrow is number of data points and ncol is number of knots).

est_meth

character. Estimation method: 'REML' for restricted maximum likelihood, or 'ML' for maximum likelihood.

include_hessian

logical. Whether or not to compute hessian matrix when running optim.

knot_coord

data frame or matrix. Coordinates of knots used for reduced rank method. Optional to include (coordinates are just saved in splm object for later reference).

Details

The purpose of this function is to automate the process of fitting a spatial model using optim and forming an object of class splm, which contains the attributes of that fitted model, using make_splm.

Value

List of class splm containg features of fitted spatial linear model (e.g., covariance matrix, predictor coefficients, ...).

Author(s)

Eric W. Fox


ericwfox/slmrf documentation built on Feb. 24, 2024, 11:02 p.m.