mml: MML estimator

Description Usage Arguments Value Examples

View source: R/apis_functions.R

Description

This function estimates a space time linear model according to the specified formula using the MML (or MML/BCLSDV) estimator as in Elhorst (2010) doi:10.1016/j.regsciurbeco.2010.03.003. The estimator maximizes a full-log-likelihood function where the parameter of spatial dependence is constrained.

Usage

1
mml(Rho, ff, dataset, wmat, var.agg, m = 10)

Arguments

Rho

the constrained parameter of spatial dependence

ff

Formula of the linear model. It excludes the spatial lag

dataset

Data frame with the data

wmat

Spatial weight matrix

var.agg

Spatial index of the data frame

m

How many time periods have passed since the beginning of the space-time process

Value

The estimates tables

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
library(rgdal)
set.seed(123)
sd = sim_data_fe(dataset=regsamp,N=50,T=8,
                spatial = 80,Tau = -0.2,Rho = 0.4,
                Beta = 2,sdDev = 2,startingT = 10,
                LONGLAT = TRUE);sd[[1]]$X2 = stats::rnorm(nrow(sd[[1]]@data))
est_mml = mml(dataset = sd[[1]]@data,Rho = 0.4,
              ff = Y~X1+X2,
              wmat = sd[[2]],var.agg = c('Anno','Cod_Provincia'),
              m = 10)
est_mml

## End(Not run)

edoardoBaldoni/AGPRIS documentation built on Sept. 27, 2020, 12:04 a.m.