sim_sar: Simulates a SAR model

Description Usage Arguments Details Value

View source: R/sarabc.R

Description

Simulates a SAR model

Usage

1
2
3
sim_sar(G, X, rho, beta, p = 5, xmean = rep(0, nrow(G)))

sar_sim(G, X, rho, beta, p = 5, xmean = rep(0, nrow(G)))

Arguments

G

Square matrix of class dgCMatrix of size n*n.

X

Numeric matrix of covariates of size n * k.

rho

Numeric scalar.

beta

Numeric colvector of length k.

p

Number of iterations in the approximation to (I_n - ρ W)^{-1}.

xmean

Numeric vector of length n.

Details

Follows a model SAR

y = rho * W * y + X*beta + eps, eps ~ MVN(0, sigma^2 *I_n)

Value

A numeric vector of length n.


gvegayon/sarabc documentation built on May 17, 2019, 9:30 a.m.