Assuming I have two data sets that are two dimensional that should from similar 
functions, is Least Squares or a related approach the best way to compare these 
2-D data sets?   I guess I would like to know how related the two data sets are 
and if they are from the same function or close to being from the same 
function.   

Thanks for any tips on this topic, as when I look at least squares I only see 
how well a function fits a set of data and then when I look at chi squared it 
looks like it is only discussing 1-D type data.   Any insights are appreciated, 
as I believe I am overlooking something.   


num_vals<-1000
from_val<-0
to_val<-360

input_degree_one<-seq(from = from_val, to = to_val, length.out = num_vals)
input_degree_one<-runif(num_vals, 
                        min=from_val,
                        max=to_val)

input_degree_two<-runif(num_vals, 
                        min=from_val,
                        max=to_val)

input_radian_one<-sort(input_degree_one)*2*pi/180
input_radian_two<-sort(input_degree_two)*2*pi/180


omega_one<-0.0
output_one<-sin(input_radian_one+omega_one)

omega_two<-3.0*2*pi/180
output_two<-sin(input_radian_two+omega_two)

plot(0, 0,
     ylim=c(-1, 1),
     xlim=c(0, 360), 
     col=0.0, 
     xlab=c("Input"), 
     ylab=c("Output"))

points(input_degree, output_one, col="blue")

points(input_degree, output_two, col="red")

______________________________________________
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.

Reply via email to