Skip to content

package for bidimemsional regression

3 messages · Marco Helbich, Ashton Shortridge, Hisaji ONO

#
Dear list,

Is there a package available, which computes the "bidimemsional regression"? 
For literature see e.g.

Tobler, W: Bidimensional Regression, Geographical Analysis, 26: 186-212.

Friedman, A; Kohler, B 2003: Bidimensional regression: A method for 
assessing the configural similarity of cognitive maps and other 
two-dimensional data. Psychological Methods, B, 468-491

I appreciate every hint!

Best regards
Marco Helbich
#
Hi Marco,

I'm no expert on this area, but a quick read indicates that this refers to a 
variety of approaches. One main point is that Tobler and others suggest that 
the regression is separable into two functions. That is, the goal is to 
determine the mapping of a set of (x,y) into a set of (u,v), and these can be 
separated:
u = f(x,y)
v = g(u,v)

This is a standard problem in rectification, and depending on what assumptions 
you are willing to make (e.g. are f and g independent? Is the relationship 
linear?) a wide array of methods present themselves. The Tobler paper(s) and 
others identify a number of these.

I thought the Friedman & Kohler paper (Psych Methods 8(4) 468-491) was very 
clear on some implementation issues; if you are somewhat comfortable with 
matrices and R scripting you can probably develop this pretty quickly 
yourself.

The Friedman & Kohler paper is here:
http://www.psych.ualberta.ca/%7Ealinda/PDFs/Friedman%20Kohler%20%5B03-Psych%20Methods%5D.pdf

Yours, 

Ashton Shortridge
Michigan State University
On Wednesday 16 July 2008, Marco Helbich wrote:
1 day later
#
Hello.

 I've tried to implement Euclid and Affine versions of
Bidimensional Analysis.


#
#algorithms an data from Nakaya, T. (1998): Statistical
analysis of spatial distortion: an application of
bidimensional regression procedure, The Ritsumeikan
Bungaku 553, 1333-1356. in Japanese
#
# You had better refer to, "Nakaya, T. (1997): Statistical
inferences in bidimensional regression models,
Geographical Analysis 29, 169-186." too.


# sample data
#kanazawa1.csv
#
0.105,0.515,0.041,0.536
0.88,-0.122,0.445,-0.047
1.057,1.109,0.773,0.83
1.262,0.463,0.747,0.309
2.316,-0.037,1.328,-0.687
3.293,-0.149,2.007,-1.452
-0.743,2.092,-0.316,1.457
-0.964,1.328,-0.497,1.12
-1.249,2.322,-0.629,1.632
-0.179,-0.689,-0.124,-0.25
0.832,-0.926,0.309,-0.611
2.217,-1.092,0.847,-0.959
-0.352,-1.571,-0.368,-0.503
1.434,-2.092,0.44,-1.543
-0.611,-2.908,-0.964,-1.707
0.497,-2.989,-0.379,-1.763
2.333,1.214,1.83,-0.134
3.13,1.307,2.184,-0.752
2.296,2.232,1.763,0.72

d<-read.csv("F://tobler/bidimension_regression/kanazawa1.csv",header=
FALSE)
u<-d[,1]
v<-d[,2]
x<-d[,3]
y<-d[,4]

#
# Euclid version of Bidimensional Regression
#using design matrix
#

d1<-cbind(c(d[,1],d[,2]),c(rep(1,nrow(d)),rep(0,nrow(d))),c(rep(0,nrow(d)),rep(1,nrow(d))),c(d[,3],d[,4]),c(d[,4]*-1,d[,3]))
lu<-lm(d1[,1] ~ d1[,2]+d1[,3]+d1[,4]+d1[,5] - 1)

a1<-lu$coefficients[3]
a2<-lu$coefficients[4]
b1<-lu$coefficients[1]
b2<-lu$coefficients[2]
cc<-sqrt(a1*a1+a2*a2)

theta<-acos(a1/cc)

#predict values
uv<-predict(lu)
uu<-uv[1:(length(uv)/2)]
vv<-uv[(length(uv)/2 +1):length]

#draw scattergram
plot(u,v)
points(uu,vv,col="red")


#
# Affine version of Bidimensional Regression
#
daf<-cbind(c(d[,1],d[,2]),c(rep(1,nrow(d)),rep(0,nrow(d))),c(rep(0,nrow(d)),rep(1,nrow(d))),c(d[,3],rep(0,nrow(d))),c(d[,4],rep(0,nrow(d))),c(rep(0,nrow(d)),d[,3]),c(rep(0,nrow(d)),d[,4]))
la<-lm(daf[,1] ~
daf[,2]+daf[,3]+daf[,4]+daf[,5]+daf[,6]+daf[,7] - 1)




 I hope this will help you.


 Regards.
--- Marco Helbich <marco.helbich at gmx.at> wrote: