Samuel FRIOT
2005-May-19 15:14 UTC
[R] Fitting Data with errors to non-polynomial Linear Model
Dear R-help, After two days of search on the archive of your web-site, I found partial answers to the problem that I want to solve, but this is not concluent to me and I am thinking that perhaps someone could answer exactly my problem: I have a theoretical Model (for the prediction of some physical quantity) which can be seen as a linear Model with 2 parameters. On the other side the measured data concerning the physical quantity in question, and that I have to my disposition, is a set of 20 points with both errors in x and y, the x error being the same for each point. I would like to fit my model to the data and find the corresponding values of the parameters in order to make predictions for some other physical quantities that depend on the parameters. My theoretical Model which has 2 free parameters a,b and one independant variable X, is of the type: f(X;a,b;M,N,P)=a*f1(X;M)+b*f2(X;M,N)+f3(X;M,N,P) where f1 and f2 are partial fractions and f3 is a complicated non-linear function of X and M, which is bipartite in the range of X on which I want to make my fit. M, N et P are constants with errors (physical quantities that enter into the equation of the model). I do not know R very well and my questions are: 1.Is there a R-package where it is possible to define arbitrary basis functions for a linear Model? 2.The error in y can be taken into acount with the weight option, but what about the error in X? (and in M, N and P) 3.Is it possible, with R, to handle with my bipartite fonction f3 simply? (with the help of the unitstep function or something like that..?) I know that the error in X can be implemented by what is called "effective variances technique", but is it available in some package? Many thanks for your help by advance. Samuel [[alternative HTML version deleted]]