<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Definitely your weights matrix. The matrix must be known and fixed. You should not try to use errorsarlm with only very few spatially identified grouped observations. Only use a multilevel approach, such as that in the HSAR package, see articles referenced
 there, or in an online  article in Spatial Statistics by Zhe Sha and coauthors at:
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
<a href="https://doi.org/10.1016/j.spasta.2017.01.002">https://doi.org/10.1016/j.spasta.2017.01.002</a><br>
<br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Roger Bivand<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Norwegian School of Economics<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Bergen, Norway</div>
<br>
<br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Fra: Javier García<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Sendt: torsdag 3. august, 02.19<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Emne: [R-sig-Geo] Computational problems with errorsarlm<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Til: r-sig-geo@r-project.org<br>
<br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Hello everybody:<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
I am trying to estimate a spatial error model, but I am facing to several problems<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
1)  Running errorsarlm function the following message appears:<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Warning messages:<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
1: In errorsarlm(y ~ z1 + z2 + z3 + z4 + z5 + z6 + z7 + z8 +  :<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
  inversion of asymptotic covariance matrix failed for tol.solve = 1e-10 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
  número de condición recíproco = 3.80991e-16 - using numerical Hessian.<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
2: In sqrt(fdHess[1, 1]) : Se han producido NaNs<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Getting the following results:<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Approximate (numerical Hessian) standard error: NaN<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
    z-value: NaN, p-value: NA<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Wald statistic: NaN, p-value: NA<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
This can be easily “solved” changing tol.solve from 1.0e-10 to, for example, 1.0e-20. Doing this I get  the following results<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Asymptotic standard error: 14.053<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
    z-value: -44.177, p-value: < 2.22e-16<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Wald statistic: 1951.6, p-value: < 2.22e-16<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
2)  However, I have a more serious problema: the estimate of lambda does not make any sense<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Lambda: -620.82, LR test value: 333.5, p-value: < 2.22e-16<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Any idea about what it is happening? I am using a big dataset with 2800 observations (houses), 14 variables, and the spatial weight matrix has been constructed “by hand” with the inverse of the inter-areas distances . Moreover, several observations belong to
 the same area (in total we have only 10 areas). As the intra-area distance is unknown but cannot be considered zero, I calculate it as 1/(0.1*dist_min), being dist_min the distance between the corresponding area and the nearest one (idea borrowed from Pattanayak
 and Butry (2005) “<i>Spatial complementarity of forest and farms: accounting for ecosystem services</i>”, American Journal of Agricultural Economics). Could be due to my particular spatial weight matrix? Any alternative?
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Cheers<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
Javi<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
<b>
<table class="MsoNormalTable" width="100%" border="0" cellpadding="0" cellspacing="3" style="width:100.0%">
<tbody>
<tr>
<td width="99%" rowspan="1" colspan="1" style="width:99.04%;background:black;padding:3.75pt 3.75pt 3.75pt 3.75pt">
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="MsoNormalTable" width="86%" border="0" cellpadding="0" cellspacing="3" style="width:86.58%;background:white">
JAVIER GARCÍA
</table>
</b><br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
<table class="MsoNormalTable" width="100%" border="0" cellpadding="0" cellspacing="3" style="width:100.0%">
<tbody>
<tr>
<td width="99%" rowspan="1" colspan="1" style="width:99.04%;background:black;padding:3.75pt 3.75pt 3.75pt 3.75pt">
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="MsoNormalTable" width="86%" border="0" cellpadding="0" cellspacing="3" style="width:86.58%;background:white">
<b> </b>
</table>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
<table class="MsoNormalTable" width="100%" border="0" cellpadding="0" cellspacing="3" style="width:100.0%">
<tbody>
<tr>
<td width="99%" rowspan="1" colspan="1" style="width:99.04%;background:black;padding:3.75pt 3.75pt 3.75pt 3.75pt">
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="MsoNormalTable" width="86%" border="0" cellpadding="0" cellspacing="3" style="width:86.58%;background:white">
<b>Departamento de Economía Aplicada III (Econometría y Estadística)</b>
</table>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
<table class="MsoNormalTable" width="100%" border="0" cellpadding="0" cellspacing="3" style="width:100.0%">
<tbody>
<tr>
<td width="99%" rowspan="1" colspan="1" style="width:99.04%;background:black;padding:3.75pt 3.75pt 3.75pt 3.75pt">
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="MsoNormalTable" width="86%" border="0" cellpadding="0" cellspacing="3" style="width:86.58%;background:white">
<b>Facultad de Economía y Empresa (Sección Sarriko)</b>
</table>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
<table class="MsoNormalTable" width="100%" border="0" cellpadding="0" cellspacing="3" style="width:100.0%">
<tbody>
<tr>
<td width="99%" rowspan="1" colspan="1" style="width:99.04%;background:black;padding:3.75pt 3.75pt 3.75pt 3.75pt">
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="MsoNormalTable" width="86%" border="0" cellpadding="0" cellspacing="3" style="width:86.58%;background:white">
Avda. Lehendakari Aguirre
</table>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
<table class="MsoNormalTable" width="100%" border="0" cellpadding="0" cellspacing="3" style="width:100.0%">
<tbody>
<tr>
<td width="99%" rowspan="1" colspan="1" style="width:99.04%;background:black;padding:3.75pt 3.75pt 3.75pt 3.75pt">
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="MsoNormalTable" width="86%" border="0" cellpadding="0" cellspacing="3" style="width:86.58%;background:white">
<img src="cid:image001.gif@01D30BFB.1B7B5240" alt="http://www.unibertsitate-hedakuntza.ehu.es/p268-content/es/contenidos/informacion/manual_id_corp/es_manual/images/firma_email_upv_euskampus_bilingue.gif">
</table>
<br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
<table class="MsoNormalTable" width="100%" border="0" cellpadding="0" cellspacing="3" style="width:100.0%">
<tbody>
<tr>
<td width="99%" rowspan="1" colspan="1" style="width:99.04%;background:black;padding:3.75pt 3.75pt 3.75pt 3.75pt">
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="MsoNormalTable" width="86%" border="0" cellpadding="0" cellspacing="3" style="width:86.58%;background:white">
83
</table>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
<table class="MsoNormalTable" width="100%" border="0" cellpadding="0" cellspacing="3" style="width:100.0%">
<tbody>
<tr>
<td width="99%" rowspan="1" colspan="1" style="width:99.04%;background:black;padding:3.75pt 3.75pt 3.75pt 3.75pt">
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="MsoNormalTable" width="86%" border="0" cellpadding="0" cellspacing="3" style="width:86.58%;background:white">
48015 BILBAO
</table>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
<table class="MsoNormalTable" width="100%" border="0" cellpadding="0" cellspacing="3" style="width:100.0%">
<tbody>
<tr>
<td width="99%" rowspan="1" colspan="1" style="width:99.04%;background:black;padding:3.75pt 3.75pt 3.75pt 3.75pt">
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="MsoNormalTable" width="86%" border="0" cellpadding="0" cellspacing="3" style="width:86.58%;background:white">
<b>T.: +34 601 7126</b>
</table>
<table class="MsoNormalTable" width="100%" border="0" cellpadding="0" cellspacing="3" style="width:100.0%">
<tbody>
<tr>
<td width="99%" rowspan="1" colspan="1" style="width:99.04%;background:black;padding:3.75pt 3.75pt 3.75pt 3.75pt">
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="MsoNormalTable" width="86%" border="0" cellpadding="0" cellspacing="3" style="width:86.58%;background:white">
</table>
<table class="MsoNormalTable" width="100%" border="0" cellpadding="0" cellspacing="3" style="width:100.0%">
<tbody>
<tr>
<td width="99%" rowspan="1" colspan="1" style="width:99.04%;background:black;padding:3.75pt 3.75pt 3.75pt 3.75pt">
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="MsoNormalTable" width="86%" border="0" cellpadding="0" cellspacing="3" style="width:86.58%;background:white">
<b>F.: +34 601 3754</b>
</table>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
<table class="MsoNormalTable" width="100%" border="0" cellpadding="0" cellspacing="3" style="width:100.0%">
<tbody>
<tr>
<td width="99%" rowspan="1" colspan="1" style="width:99.04%;background:black;padding:3.75pt 3.75pt 3.75pt 3.75pt">
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="MsoNormalTable" width="86%" border="0" cellpadding="0" cellspacing="3" style="width:86.58%;background:white">
<b><a href="http://www.ehu.es/">www.ehu.es</a></b>
</table>
<table class="MsoNormalTable" width="100%" border="0" cellpadding="0" cellspacing="3" style="width:100.0%">
<tbody>
<tr>
<td width="99%" rowspan="1" colspan="1" style="width:99.04%;background:black;padding:3.75pt 3.75pt 3.75pt 3.75pt">
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="MsoNormalTable" width="86%" border="0" cellpadding="0" cellspacing="3" style="width:86.58%;background:white">
</table>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; background-color: white;">
 <br>
<br>
<br>
</div>
</body>
</html>