[R-sig-Geo] simulation loop and creating weights
Roger Bivand
Roger.Bivand at nhh.no
Fri Aug 31 08:19:13 CEST 2007
On Thu, 30 Aug 2007, Terry Griffin wrote:
> Greetings,
>
> In a simulation I'm running, I would like to create a series of listw
> weight matrices outside of the simulation loop. The appropriate inverse
> distance weights matrix I want to use is determined within the
> simulation loop using the sp.correlogram function. For instance there
> are 5 possible different weight matrices, mat1..mat5. Each of these
> matrices takes a little while to create, and with 1000 replications it
> takes up a lot of time.
>
> Using an ifelse statement I can isolate the appropriate distance from
> the sp.correlogram function, but when I try to paste or cat the number
> from the ifelse statement to the name "mat", it is not recognized as a
> listw. Is there a way to speed the along?
Without seeing your code, it is well-nigh impossible to say, but most
likely your use (or lack of use) of get() is not working - get() lets you
access an object, possibly in a different environment, by name given as a
string value. It may be that you are getting a character string from
paste("mat", i, sep=""), and need to wrap that string in a get(), to
access the object of that name.
Roger
>
> Thank you,
>
> Terry
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no
More information about the R-sig-Geo
mailing list