[R] Help needed with Krig and predict

2012-08-01 Thread phi771
Hello everybody!

I have a problem, which I'm trying to solve. I have two Krig-fits: kr_one
and kr_two; both use x and y and additional either A (kr_one) or B (kr_two):

kr_one <- with(1, Krig(cbind(x,y), A))
kr_two <- with(1, Krig(cbind(x,y), B))

I can view the 3d-plane using:

image(predict.surface(kr_one))

My question is how do I manage to ask R to give me that pair of x and y that
corresponds to a given pair of A and B.
There are many pairs of x and y in kr_one that correspond to A; and there
are also many pairs of x and y that correspond to B in kr_two. But there's
is only one pair of x and y that corresponds to both, A and B. I want to
find exactly this pair.
Some help on this would be very appreciated! Thank you!

 







--
View this message in context: 
http://r.789695.n4.nabble.com/Help-needed-with-Krig-and-predict-tp4638749.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to add 3d-points to bplot {rms} figure?

2012-04-12 Thread phi771
h! thank you a lot for your effort and help. 
i preferred a 3d view of the surface in order to see how well it fits the
real data (from the file). i will play around with the functions you have
mentioned and post my results or further problems. this will probably take a
few days :(

can anybody answer if i can "extract" the mesh in x,y,z coordinates from the
bplot?
thank you again.



--
View this message in context: 
http://r.789695.n4.nabble.com/how-to-add-3d-points-to-bplot-rms-figure-tp4544050p4553227.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] how to add 3d-points to bplot {rms} figure?

2012-04-09 Thread phi771
Hello!
I have created a bplot-figure using this code:

*file <- "2dcali_red.ttt"
ux<-as.matrix(read.table(file, dec = ","))

mode(ux)<-'numeric'

vel<-ux[,1]
ang<-ux[,2] 
x<-ux[,3]
y<-ux[,4]

dat<- data.frame(ang=ang, x=x,y=y) 

require(rms)

ddist2 <- datadist(dat)
options(datadist="ddist2")

fitn <- lrm(ang ~ rcs(x,4) + rcs(y,4), data=dat)
predi <- Predict(fitn, x, y)

bplot(predi,lfun=wireframe, screen = list(z = -40, x = -80), drape=TRUE)*

The file 2dcali_red.ttt  consists of 4 columns can be found here :
http://www.color-space.de/upload/dl/2dcali_red.ttt link 

The code gives me the bplot-figure, which looks like this:
http://r.789695.n4.nabble.com/file/n4544050/Screen_shot_2012-04-10_at_12.04.24_AM.png
 

Now I want to add some 3d data (x,y,z) to this plot (like scatterplot3d),
but i don't know how. I also don't know how to extract the x,y,z mesh as
coordinates from the bplot. Some help would be very appreciated. Thank you!

--
View this message in context: 
http://r.789695.n4.nabble.com/how-to-add-3d-points-to-bplot-rms-figure-tp4544050p4544050.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] fitting plane to 3dim set of data

2012-03-17 Thread phi771
Hello!

I have a problem creating a fitting plane through my 3d-data set. here is a
sample how my set looks like (x,y,z (with z increasing)):

> dataset
  [,1] [,2] [,3]
  [1,] -1.3712 -3.1551   10
  [2,] -1.2690 -3.0751   10
  [3,] -1.1216 -2.9768   10
  [4,] -0.9875 -2.8987   10
  [5,] -0.4021 -2.7542   10
  [6,]  0.0048 -2.6568   10
  [7,]  0.1642 -2.6071   10
  [8,]  0.0720 -2.5816   10
  [9,] -0.2961 -2.5552   10
 [10,] -0.7770 -2.5118   10
 [11,] -1.0970 -2.4508   10
 [12,] -1.2456 -2.3786   10
 [13,] -1.4179 -2.3276   10
 [14,] -1.7759 -2.2667   10
 [15,] -2.2801 -3.4330   11
 [16,] -2.0254 -3.3232   11
 [17,] -1.8960 -3.2282   11
 [18,] -1.7148 -3.1101   11
 [19,] -1.5559 -3.0150   11
 [20,] -0.8677 -2.8460   11
 [21,] -0.3568 -2.7250   11
 [22,] -0.1721 -2.6692   11
 [23,] -0.2951 -2.6373   11
 [24,] -0.7103 -2.5965   11
 [25,] -1.3342 -2.5458   11
 [26,] -1.6955 -2.4662   11
 [27,] -1.8697 -2.3821   11
 [28,] -2.0863 -2.3138   11
 [29,] -2.4981 -2.2376   11
 [30,] -3.0639 -3.6329   12
 [31,] -2.7939 -3.5062   12
 [32,] -2.5782 -3.3798   12
 [33,] -2.3708 -3.2439   12
 [34,] -2.1916 -3.1285   12
 [35,] -1.3914 -2.9368   12
 [36,] -0.7883 -2.7911   12
 [37,] -0.5625 -2.7263   12
 [38,] -0.6858 -2.6882   12
 [39,] -1.2123 -2.6343   12
 [40,] -1.9606 -2.5708   12
 [41,] -2.3586 -2.4765   12
 [42,] -2.5972 -2.3738   12
 [43,] -2.7832 -2.2905   12
 [44,] -3.3004 -2.1983   12
 [45,] -3.8862 -3.8286   13
 [46,] -3.5691 -3.6789   13
 [47,] -3. -3.5338   13
 [48,] -3.0851 -3.3760   13
 [49,] -2.8812 -3.2451   13
 [50,] -1.9070 -3.0168   13
 [51,] -1.2529 -2.8556   13
 [52,] -0.9685 -2.7769   13
 [53,] -1.1275 -2.7322   13
 [54,] -1.7272 -2.6625   13
 [55,] -2.5896 -2.5866   13
 [56,] -3.0374 -2.4728   13
 [57,] -3.3758 -2.3541   13
 [58,] -3.5959 -2.2514   13
 [59,] -4.1466 -2.1419   13
 [60,] -4.8565 -4.0770   14
 [61,] -4.5154 -3.9081   14
 [62,] -4.1926 -3.7312   14
 [63,] -3.8720 -3.5449   14
 [64,] -3.6627 -3.3992   14
 [65,] -2.5851 -3.1462   14
 [66,] -1.7868 -2.9548   14
 [67,] -1.4638 -2.8651   14
 [68,] -1.6493 -2.8082   14
 [69,] -2.3455 -2.7232   14
 [70,] -3.3572 -2.6257   14
 [71,] -3.8678 -2.4903   14
 [72,] -4.1988 -2.3545   14
 [73,] -4.5039 -2.2328   14
 [74,] -5.0707 -2.1091   14

i want to have an analytical expression of a plane, which is smooth and
connects all data points.
can anybody help?
thank you!!

--
View this message in context: 
http://r.789695.n4.nabble.com/fitting-plane-to-3dim-set-of-data-tp4480599p4480599.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.