﻿

# c# pdf to image pdfsharp : Convert pdf into fillable form application Library tool html asp.net windows online wbook4-part70

Chapter 2
Spatial autoregressive models
Thischapterdiscussesindetailthespatialautoregressivemodelsintroduced
inChapter1.Aclassofspatialautoregressivemodelshavebeenintroduced
tomodelcross-sectionalspatialdatasamplestakingtheformshownin(2.1)
(Anselin,1988).
y = W
1
y+X+u
(2.1)
u = W
2
u+"
"  N(0;
2
I
n
)
Whereycontainsannx1vectorofcross-sectionaldependent variablesand
Xrepresentsannxkmatrixofexplanatoryvariables.W
1
andW
2
areknown
nxn spatialweightmatrices,usuallycontainingrst-ordercontiguityrela-
tionsorfunctions ofdistance. As s explainedinSection1.4.1, arst-order
contiguitymatrixhaszeros onthe maindiagonal,rowsthatcontainzeros
inpositionsassociatedwithnon-contiguousobservationalunitsandonesin
positionsreﬂectingneighboringunitsthatare(rst-order)contiguousbased
ononeofthecontiguitydenitions.
Fromthegeneralmodelin(2.1)wecanderivespecialmodelsbyimposing
restrictions.Forexample,settingX=0andW
2
=0producesarst-order
spatialautoregressivemodelshownin(2.2).
y = W
1
y+"
(2.2)
"  N(0;
2
I
n
)
Thismodelattemptstoexplainvariationinyasalinearcombinationof
contiguousor neighboringunitswithnootherexplanatoryvariables. The
30
Convert pdf into fillable form - C# PDF Form Data fill-in Library: auto fill-in PDF form data in C#.net, ASP.NET, MVC, WinForms, WPF
Online C# Tutorial to Automatically Fill in Field Data to PDF
asp.net fill pdf form; add fillable fields to pdf online
Convert pdf into fillable form - VB.NET PDF Form Data fill-in library: auto fill-in PDF form data in vb.net, ASP.NET, MVC, WinForms, WPF
VB.NET PDF Form Data fill-in library: auto fill-in PDF form data in vb.net, ASP.NET, MVC, WinForms, WPF
change pdf to fillable form; convert pdf into fillable form
CHAPTER2. SPATIALAUTOREGRESSIVEMODELS
31
modelistermedarstorderspatialautoregressionbecauseitsrepresentsa
spatialanalogytotherstorderautoregressivemodelfromtimeseriesanal-
ysis,y
t
=y
t−1
+"
t
,wheretotalrelianceisonthepastperiodobservations
toexplainvariationiny
t
.
SettingW
2
=0producesamixedregressive-spatialautoregressivemodel
shownin(2.3). Thismodelisanalogoustothelaggeddependent t variable
matrix X that t serve to explain variationiny over r the spatialsample of
observations.
y = W
1
y+X+"
(2.3)
"  N(0;
2
I
n
)
LettingW
1
=0resultsinaregressionmodelwithspatialautocorrelation
inthedisturbancesasshownin(2.4).
y = X+u
(2.4)
u = W
2
u+"
"  N(0;
2
I
n
)
Thischapterisorganizedintosections thatdiscuss andillustrateeach
ofthesespecialcasesofthespatialautoregressivemodelaswellasthemost
generalmodelformin(2.1).Section2.1dealswiththerst-orderspatialau-
toregressivemodelpresentedin(2.2). Themixedregressive-spatialautore-
gressivemodelistakenupinSection2.2.Section2.3takesuptheregression
modelcontainingspatialautocorrelationinthedisturbancesandillustrates
various testsfor spatialdependence usingregressionresiduals. Themost
generalmodel is s thefocus of Section2.4. Applied illustrationsofallthe
modelsareprovidedusingavarietyofspatialdatasets. Spatialeconomet-
ricslibraryfunctionsthatutilizeMATLABsparsematrixalgorithmsallow
ustoestimatemodels withover3,000observationsinaround100seconds
onaninexpensivedesktopcomputer.
2.1 The rst-order spatial AR model
Thismodelisseldomusedinappliedwork,butitservestomotivatesome
ofthe ideas that wedrawoninlater sectionsofthechapter. The model
whichwelabelFAR,takestheform:
C# Create PDF from OpenOffice to convert odt, odp files to PDF in
public override void ConvertToDocument(DocumentType targetType, Stream stream). Description: Convert to PDF/TIFF and save it into stream. Parameters:
converting a word document to a fillable pdf form; convert word doc to fillable pdf form
C# Create PDF from Excel Library to convert xlsx, xls to PDF in C#
Turn all Excel spreadsheet into high quality PDF without Create searchable and scanned PDF files from Excel. Convert to PDF with embedded fonts or without
convert word form to pdf with fillable; convert pdf to form fill
CHAPTER2. SPATIALAUTOREGRESSIVEMODELS
32
y = Wy+"
(2.5)
"  N(0;
2
I
n
)
WherethespatialcontiguitymatrixW hasbeenstandardizedtohaverow
sumsofunityandthevariablevectoryisexpressedindeviationsfromthe
meansformtoeliminatetheconstantterminthemodel.
Toillustratetheproblemwithleast-squaresestimationofspatialautore-
gressivemodels,considerapplyingleast-squarestothemodelin(2.5)which
wouldproduceanestimateforthesingleparameterinthemodel:
^=(y
0
W
0
Wy)
−1
y
0
W
0
y
(2.6)
Can we showthat t this estimateis unbiased? If not, is it consistent?
Takingthesameapproachasinleast-squares,wesubstitutetheexpression
foryfromthemodelstatementandattempttoshowthatE(^)=toprove
unbiasedness.
E(^) = (y
0
W
0
Wy)
−1
y
0
W
0
(Wy+")
= +(y
0
W
0
Wy)
−1
y
0
W
0
"
(2.7)
Notethatthe least-squaresestimate isbiased,sincewecannotshowthat
E(^)=. TheusualargumentthattheexplanatoryvariablesmatrixXin
least-squaresisxedinrepeatedsamplingallowsonetopasstheexpecta-
tionoperator overterms like (y
0
W
0
Wy)
−1
y
0
W
0
andargue thatE(")= 0,
eliminatingthebiasterm.Herehowever,becauseofspatialdependence,we
cannotmakethecasethatWyisxedinrepeatedsampling.Thisalsorules
outmakingacaseforconsistencyoftheleast-squaresestimateof,because
theprobabilitylimit(plim)forthetermy
0
W
0
"isnotzero. Infact,Anselin
(1988)establishesthat:
plimN
−1
(y
0
W
0
")=plimN
−1
"
0
W(I−W)
−1
"
(2.8)
Thisisequaltozeroonlyinthetrivialcasewhereequalszeroandwehave
nospatialdependenceinthedatasample.
Giventhatleast-squareswillproducebiasedandinconsistentestimates
ofthespatialautoregressiveparameterinthismodel,howdoweproceed
to estimate? Themaximumlikelihoodestimatorfor requires thatwe
ndavalueofthatmaximizesthelikelihoodfunctionshownin(2.9).
C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF
for turning all PowerPoint presentation into high quality PDF Convert to PDF with embedded fonts or without Convert multiple pages PowerPoint to fillable and
convert word form to fillable pdf; add fillable fields to pdf
C# Create PDF from Word Library to convert docx, doc to PDF in C#.
NET control able to turn all Word text and image content into high quality PDF without losing formatting. Convert multiple pages Word to fillable and editable
create fillable pdf form from word; pdf fill form
CHAPTER2. SPATIALAUTOREGRESSIVEMODELS
33
L(yj;
2
)=
1
22
(n=2)
jI
n
−Wjexpf−
1
22
(y−Wy)
0
(y−Wy)g (2.9)
In order to simplify the maximizationproblem, we obtain a concen-
trated log likelihood function based on eliminatingthe parameter 
2
for
the variance of the disturbances. This is accomplished by substituting
^
2
= (1=n)(y−Wy)
0
(y−Wy) in the likelihood(2.9) and taking logs
whichyields:
Ln(L)/−
n
2
ln(y−Wy)
0
(y−Wy)+lnjI
n
−Wj
(2.10)
Thisexpressioncanbemaximizedwithrespecttousingasimplexunivari-
ateoptimizationroutine.Theestimatefortheparameter
2
canbeobtained
usingthevalueofthatmaximizesthelog-likelihoodfunction(say,~)in:
^
2
=(1=n)(y−~Wy)
0
(y−~Wy). Inthenextsection,wediscussasparse
matrixalgorithmapproachtoevaluatingthislikelihoodfunctionthatallows
ustosolveproblemsinvolvingthousandsofobservationsquicklywithsmall
amountsofcomputermemory.
Twoimplementationdetailsarisewiththisapproachtosolvingformaxi-
mumlikelihoodestimates.First,thereisaconstraintthatweneedtoimpose
ontheparameter. Thisparametercantakeonfeasiblevaluesintherange
(AnselinandFlorax,1994):
1=
min
<<1=
max
where
min
representstheminimumeigenvalueofthestandardizedspatial
contiguitymatrixW and
max
denotesthelargesteigenvalueofthismatrix.
Thissuggeststhatweneedtoconstrainouroptimizationproceduresearch
overvaluesofwithinthisrange.
Thesecondimplementationissueis thatthenumericalhessianmatrix
that wouldresult from agradient-basedoptimizationprocedure andpro-
videestimatesofdispersionfortheparametersisnotavailablewithsimplex
optimization. We canovercomethis problemintwoways. Forproblems
involving a small number of observations, we can use our r knowledge of
the theoreticalinformationmatrixtoproduce estimatesofdispersion. An
asymptoticvariancematrixbasedontheFisherinformationmatrixshown
belowfor theparameters  = (;
2
) can be usedtoprovide measures s of
dispersionfortheestimatesofand
2
.(seeAnselin,1980page50):
[I()]
−1
=−E[
@
2
L
@@
0
]
−1
(2.11)
VB.NET Create PDF from PowerPoint Library to convert pptx, ppt to
Turn all PowerPoint presentation into high quality PDF Convert to PDF with embedded fonts or without Convert multiple pages PowerPoint to fillable and editable
pdf add signature field; convert word to fillable pdf form
VB.NET Create PDF from Word Library to convert docx, doc to PDF in
all Word text and image content into high quality PDF Create PDF files from both DOC and DOCX formats. Convert multiple pages Word to fillable and editable PDF
convert pdf fill form; adding a signature to a pdf form
CHAPTER2. SPATIALAUTOREGRESSIVEMODELS
34
This approach is s computationally impossible whendealing with large
scaleproblems involvingthousandsof observations. Inthesecases s wecan
evaluate the numericalhessianmatrixusingthemaximumlikelihoodesti-
mates of  and 
2
as well as s our sparse matrix function to compute the
likelihood.Wewilldemonstrateresultsfromusingbothoftheseapproaches
inthenextsection.
2.1.1 Thefar()function
Building on the software design set forth in section 1.5 for our spatial
econometricsfunctionlibrary,wehaveimplementedafunctionfartopro-
ducemaximumlikelihoodestimatesfortherst-orderspatialautoregressive
model.WerelyononthesparsematrixfunctionalityofMATLABsolarge-
scaleproblemscanbesolvedusingaminimumoftimeandcomputerRAM
memory. We demonstrate this functioninactionon adata set involving
3,107U.S.counties.
EstimatingtheFARmodelrequiresthatwendeigenvaluesforthelarge
nbynmatrixW,aswellasthedeterminantoftherelatednbyn matrix
(I
n
n
−W)
arerequiredtocomputetheinformationmatrixusedtoproduceestimates
ofdispersion.
Weconstructedafunctionfarthatcanproduceestimatesfortherst-
orderspatialautoregressivemodelinacaseinvolving3,107observationsin
95secondsonamoderatelyfastinexpensivedesktopcomputer. TheMAT-
LABalgorithmsfordealingwithsparsematricesmakeitideallysuitedfor
spatialmodelingbecausespatialweightmatricesarealmostalwayssparse.
Anotherissuewe needtoaddress iscomputingmeasures ofdispersion
fortheestimatesand
2
we cannot rely on the informationmatrixapproachbecause this involves
matrix operations on very large matrices. Anapproach that t we take to
producemeasuresofdispersionistonumericallyevaluatethehessianmatrix
usingthemaximumlikelihoodestimatesofand
2
.Theapproachbasically
producesanumericalapproximationtotheexpressionin(2.11). Akeyto
usingthisapproachistheabilitytoevaluatetheloglikelihoodfunctionusing
thesparsealgorithmstohandlelargematrices.
ItshouldbenotedthatPaceandBarry(1997)whenconfrontedwiththe
basedonsparsealgorithmssuggestusinglikelihoodratioteststodetermine
thesignicanceoftheparameters.Theapproachtakenheremaysuerfrom
VB.NET Create PDF from Excel Library to convert xlsx, xls to PDF
Turn all Excel spreadsheet into high quality PDF without Create searchable and scanned PDF files from Excel in VB Convert to PDF with embedded fonts or without
pdf fillable form; convert word to pdf fillable form online
VB.NET Create PDF from OpenOffice to convert odt, odp files to PDF
Convert OpenOffice Spreadsheet data to PDF. Export PDF document from OpenOffice Presentation. Turn ODT, ODS, ODP forms into fillable PDF formats.
convert word document to pdf fillable form; convert fillable pdf to html form
CHAPTER2. SPATIALAUTOREGRESSIVEMODELS
35
theoretical informationmatrix, but has s the advantage that users will be
tialautoregressive estimationproblems usingsparse matrixalgorithms in
MATLABcomparestoone proposedby PaceandBarry(1997),whenwe
applythefunctionfartoalargedatasetinthenextsection.
Documentationforthefunctionfar ispresentedbelow. This s function
waswrittentoperformonbothlargeandsmallproblems. Iftheproblem
issmall(involvinglessthan500observations),thefunctionfarcomputes
measuresofdispersionusingthetheoreticalinformationmatrix.Ifmoreob-
servationsareinvolved,thefunctiondeterminesthesemeasuresbycomput-
inganumericalhessianmatrix.(Usersmayneedtodecreasethenumberof
observationstolessthan500iftheyhavecomputerswithoutalargeamount
ofRAMmemory.)
PURPOSE: computes1st-order spatial autoregressive estimates
y = p*W*y y + e, using sparsematrix x algorithms
---------------------------------------------------
USAGE: results = far(y,W,rmin,rmax,convg,maxit)
where: y = dependentvariable e vector
W = standardizedcontiguitymatrix
rmin = (optional) ) minimum value of rho to use in search
rmax = (optional) ) maximum value of rho to use in search
convg = (optional) ) convergence criterion (default = 1e-8)
maxit = (optional) ) maximum # of iterations(default = 500)
---------------------------------------------------
RETURNS: a structure
results.meth = 'far'
results.rho
= rho
results.tstat = asymptotic c t-stat
results.yhat = yhat
results.resid = residuals
results.sige = sige e = (y-p*W*y)'*(y-p*W*y)/n
results.rsqr = rsquared
results.lik
= -log g likelihood
results.nobs = nobs
results.nvar = nvar r = 1
results.y
= y y data vector
results.iter
= # # of iterationstaken
results.romax = 1/max eigenvalue e of W (or r rmax if input)
results.romin = 1/min eigenvalue e of W (or r rmin if input)
--------------------------------------------------
Oneoptionweprovideallowstheusertosupplyminimumandmaximum
valuesofratherthanrelyontheeigenvaluesofW. Thismightbeusedif
C# Create PDF Library SDK to convert PDF from other file formats
Create fillable PDF document with fields. with 2 blank pages PDFDocument doc = PDFDocument.Create(2); // Save the new created PDF document into file doc
convert pdf to fill in form; create pdf fillable form
VB.NET Create PDF Library SDK to convert PDF from other file
Best VB.NET component to convert Microsoft Office Word cake, as it can be easily integrated into many MS Visual Studio .NET applications to create PDF with just
attach file to pdf form; change font size in fillable pdf form
CHAPTER2. SPATIALAUTOREGRESSIVEMODELS
36
wewishedtoconstraintheestimationresultstoarangeofsay0<<1.
Notealsothatthiswouldsavethetimeneededtocomputethemaximum
andminimumeigenvaluesofthelargeW matrix.
2.1.2 Appliedexamples
Givenourfunctionfarthatimplementsmaximumlikelihoodestimationof
smallandlargerst-orderspatialautoregressivemodels,weturnattentionto
to the estimationfunctions, we have functions prtand plt that provide
printedandgraphicalpresentationoftheestimationresults.
Example2.1providesanillustrationofusingthesefunctionstoestimate
arst-orderspatialautoregressivemodelforneighborhoodcrimefromthe
Anselin(1988)spatialdatasample.Notethatweconvertthevariablevector
containingcrimeincidentstodeviationsfromthemeansform.
% ----- Example 2.1 Using the far()function
% standardized 1st-order contiguitymatrix
load anselin.dat; % load Anselin n (1988) Columbusneighborhood crime data
y = anselin(:,1);
ydev = y y - mean(y);
W = wmat;
vnames= strvcat('crime','rho');
res = = far(ydev,W); % do 1st-orderspatial l autoregression
prt(res,vnames);
% print t the output
plt(res,vnames);
% plot t actual vs predicted d and residuals
Thisexampleproducedthefollowingprintedoutputwiththegraphical
output presented inFigure 2.1. From the output t we would infer r that a
distinctspatialdependence amongthecrimeincidentsforthesampleof49
neighborhoodsexistssincetheparameterestimateforhasat−statisticof
4.259. Wewouldinterpretthisstatisticinthetypicalregressionfashionto
indicatethat the estimatedlies4.2standarddeviationsawayfromzero.
We alsoseethatthis modelexplains nearly44%of the variationincrime
incidentsindeviationsfromthemeansform.
First-order spatialautoregressivemodel Estimates
DependentVariable =
crime
R-squared
=
0.4390
sigma^2
= 153.8452
Nobs, Nvars
=
49,
1
log-likelihood =
-373.44669
# of iterations=
17
min and d max rho =
-1.5362,
1.0000
CHAPTER2. SPATIALAUTOREGRESSIVEMODELS
37
***************************************************************
Variable
Coefficient
t-statistic
t-probability
rho
0.669775
4.259172
0.000095
0
5
10
15
20
25
30
35
40
45
50
-40
-20
0
20
40
FAR   Actual vs. Predicted
0
5
10
15
20
25
30
35
40
45
50
-60
-40
-20
0
20
40
Residuals
Figure2.1: Spatialautoregressivetandresiduals
Anothermorechallengingexampleinvolvesalargesampleof3,107ob-
servationsrepresentingcountiesinthecontinentalU.S.fromPaceandBarry
(1997). Theyexaminepresidentialelectionresults s for thislargesampleof
observationscoveringtheU.S.presidentialelectionof1980betweenCarter
and Reagan. The variable we wish to explainusing the rst-order spa-
bothcandidates. Only y persons 18 years andolder are eligibletovote,so
theproportionisbasedonthosevotingforbothcandidatesdividedbythe
populationover18yearsofage.
PaceandBarry(1997)suggestanalternativeapproachtothatimple-
mentedhereinthefunctionfar.Theyproposeovercomingthedicultywe
CHAPTER2. SPATIALAUTOREGRESSIVEMODELS
38
faceinevaluatingthedeterminant(I−W)bycomputingthisdeterminant
onceoveragridofvaluesfortheparameterrangingfrom1=
min
to1=
max
priortoestimation.Theysuggestagridbasedon0.01incrementsforover
the feasiblerange. Giventhesepre-determinedvalues s forthedeterminant
(I−W),they point out thatonecanquicklyevaluatethelog-likelihood
functionforallvaluesofinthegridanddeterminetheoptimalvalueofas
thatwhichmaximizesthelikelihoodfunctionvalueoverthisgrid.Notethat
theirproposedapproachwouldinvolveevaluatingthedeterminantaround
200timesifthefeasible rangeofwas-1to1. In many y cases therange
is evengreater than thisandwouldrequireeven moreevaluations s of the
determinant. Incontrast,our r functionfarreports thatonly 17iterations
requiringloglikelihoodfunctionevaluationsinvolvingthedeterminantwere
neededtosolvefortheestimatesinthecaseoftheColumbusneighborhood
crimedataset.
theapproximatemaximumlikelihoodvalueofdeterminedfromtheinitial
gridsearch,whereasouruseoftheMATLABsimplex algorithmproduces
anestimatethatisaccuratetoanumberofdecimaldigits.
Aftersomediscussionofthecomputationalsavingsassociatedwiththe
useofsparsematrices,weillustratetheuseofourfunctionfarandcompare
ittotheapproachsuggestedbyPaceandBarry.
Arstpointtonote regardingsparsity isthat largeproblems suchas
thiswillinevitablyinvolveasparsespatialcontiguityweightingmatrix.This
becomesobviouswhenyouconsiderthecontiguitystructureofoursample
of3,107U.S.counties. Atmost,individualcountiesexhibitedonly8rst-
order(rookdenition)contiguityrelations,sotheremaining2,999entriesin
thisrowarezero. Theaveragenumberofcontiguityrelationshipsis4,soa
greatmanyoftheelementsinthematrixW arezero,whichisthedenition
ofasparsematrix.
Tounderstandhowsparsematrixalgorithmsconserveonstoragespace
andcomputermemory,considerthatweneedonlyrecordthenon-zeroele-
mentsofasparsematrixforstorage. Sincetheserepresentasmallfraction
ofthetotal3107x3107=9,653,449elementsintheweightmatrix,wesave
atremendousamountofcomputermemory. Infactforourexampleofthe
3,107U.S.counties,only12,429non-zeroelementswerefoundintherst-
orderspatialcontiguitymatrix,representingaverysmallfraction(farless
than1percent)ofthetotalelements.
MATLABprovidesa functionsparsethat canbe usedtoconstruct a
largesparsematrix by simply indicatingthe rowandcolumnpositionsof
non-zero elements andthevalue of the matrixelement forthese non-zero