hbstm: Fitting Hierarchical Bayesian Space Time models

hbstmR Documentation

Fitting Hierarchical Bayesian Space Time models

Description

hbstm is used to fit Hierarchical Bayesian Space Time models.

Usage

	hbstm(Zt,K,newGrid,reglag,seas,spatlags,hyperpriors,initialvalues,
	nIter,nBurn,fit,plots,posterior,save,control)

Arguments

Zt

: MxT "data.frame" containing the data. The rows contains the "M" spatial points and the columns the "T" temporal observations.

K

: MxS "matrix" that relates the observed spatial points with the new Grid. S is the number of predicted spatial points.

newGrid

An Sx2 "data.frame" containing the "Longitude" and the "Latitude" of the new Grid.

reglag

A vector containing the temporal autoregressive lags of the model.

seas

A vector containing the seasonal coefficients of the model.

spatlags

A vector of length 4 containing the spatial lags of the model. See details for more information.

hyperpriors

An object of class Hyperpriors containing all the values of the model hyperpriors.

initialvalues

An object of class Parameters containing all the initial values of the model parameters.

nIter

Number of Gibbs Sampling iterations. Default value is 1000.

nBurn

Number of burn-in samples. This number of samples will be discarded before making any inference. Default value is the 20 percent of nIter.

fit

A "logical" indicating whether the HBSTM is fitted.

plots

A "logical" indicating whether the method shows the plots of the execution (The mse, Zt vs X*Yt and the ACF/PACF of the residuals.

posterior

A "character" indicating whether the function returns the 'mean' and 'sd' the fitted values of Yt or returns the 'median' with its 95 percent credibility intervals.

save

A "character" indicating if, for each iteration, the algorithm saves the estimation of certain parameters. See "Details"s for more information.

control

a list of control parameters. See "Details".

Details

Each position of the argument spatlags refers to the spatial lags of a specified direction. These four directions are "east-west", "north-south", "northwest-southeast" and "northeast-southwest".

The save argument is a "character" that can have any of the following options:

-"all": Save an object of class Parameters.

-"Mu": Save an object of class Mu.

-"Mt": Save an object of class Mt.

-"Xt": Save an object of class Xt.

The control argument is a list that can supply any of the following components:

-time: A "logical" indicating whether the method shows the estimated time of execution.

-timerem: A "logical" indicating whether the method shows the estimated remaining time of execution

-seed: The seed to use in the function "set.seed" and set it to fit the model.

Value

hbstm returns an object of class HBSTM

Author(s)

Pilar Munyoz and Alberto Lopez Moreno

See Also

Overview: HBSTM-package
Classes : HBSTM,Parameters,Mu,Mt,Xt,Autoregressive,Seas,SpatParam,VectSubdiag, Hyperpriors,Mu0,Mt0,Xt0,Seas0,Autoregressive0,SpatParam0,VectSubdiag0
Methods : hbstm,hbstm.fit,results,estimation,resid,mse
Plot : plotRes,plotFit
Data: hirlam,coordinates

Examples

## See 'tutorial.pdf', included in the documentation of the package, to see a full example

HBSTM documentation built on May 28, 2022, 5:05 p.m.