[R-sig-Geo] Interpretation of gwr output ~ where is the fitted/predicted y?
Danlin Yu
yud at mail.montclair.edu
Wed Jun 18 18:37:20 CEST 2008
Debarchana:
As Roger has pointed out, since gwr.e is the gwr residuals, it is easy
to calculate the estimated Y from the observed Y since residual =
(observed Y) - (estimated Y).
To extract the gwr.e, just do this:
residuals.gwr<-test500.gwr$SDF$gwr.e
and the estimated Y would be:
est.gwr<-yimp00-residuals.gwr
And then you can compare all Ys.
Hope this helps.
Cheers,
Danlin
Debarchana Ghosh wrote:
>>> I want to clarify whether gwre ( previously it was gwr.e) is the estimated
>>> Y
>>> values?
>>>
>>>
>>>
>> No, gwr.e is (currently) the i'th element of the vector of residuals in
>> each GWR (that is for each fit point). On examination, neither it nor the R2
>> has any meaning when the fit points are not identical with the data points -
>> I will investigate and patch if need be. If data points are fit points, you
>> can, perhaps, use it to get fitted values with the y values - as in CV
>> bandwidth selection. What do you need them for?
>>
>
>
>
> In the following gwr run, the fit.points are same as the given data points,
> i.e. the gwr regression is fitted on the points "coords =
> cbind(base500vars$longx, base500vars$laty)" , which was passed as an
> argument in the main gwr function and the fit.points argument was not
> specified.
>
> # gwr function
> test500.gwr<-gwr(yimp00~ english + slope30 + mac95d + mdinc_t + musa00 +
> popden_t + dissewer + dismcd
> + diswater + ag04 + c1dishwy + c1dipark + tccost1 + soil1 + soil2,
> data=base500vars,
> coords = cbind(base500vars$longx, base500vars$laty), longlat=TRUE,
> bandwidth = test500.bw.aic,
> hatmatrix=TRUE, se.fit=TRUE, gweight=bisquare)
>
> I did not understand how I can get the estimated y values as in CV bandwidth
> selection.
>
> Since my data points are same as the fitted points, I want to compare the 1)
> observed Y, 2) estimated Y from the OLS regression (lm object) and 3)
> estimated Y from the GWR regression (from the gwr object)
>
> Thanks,
> Debs.
>
>
>
--
___________________________________________
Danlin Yu, Ph.D.
Assistant Professor
Department of Earth & Environmental Studies
Montclair State University
Montclair, NJ, 07043
Tel: 973-655-4313
Fax: 973-655-4072
email: yud at mail.montclair.edu
webpage: csam.montclair.edu/~yu
More information about the R-sig-Geo
mailing list