Dear all, Thank you all a lot for the help. The commands given by prof. Bates were the most direct way to the solution of the problem.
Once again thank you all, Gorazd Brumen V čet, 10.07.2003 ob 16:42, je Douglas Bates poslal(a): > Martin Maechler <[EMAIL PROTECTED]> writes: > > > >>>>> "KKWa" == Ko-Kang Kevin Wang <[EMAIL PROTECTED]> > > >>>>> on Thu, 10 Jul 2003 23:00:00 +1200 (NZST) writes: > > > > KKWa> Try: ?lm > > > > no. see below > > > > KKWa> On 10 Jul 2003, Gorazd Brumen wrote: > > > > >> Date: 10 Jul 2003 12:54:46 +0200 From: Gorazd Brumen > > >> <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] > > >> Subject: [R] Simple linear regression > > >> > > >> Dear all, > > >> > > >> My friend wants to fit a model of the type > > >> > > >> z = a x^n y^m + b, > > >> > > >> where x, y, z are data and a, b, n, m are unknown > > >> parameters. > > >> > > >> How can he transform this to fit in the linear regression > > >> framework? Any help would be appreciated. > > > > He can't. When all 4 a, b, n, m are parameters, this is a > > non-linear regression problem. --> Function nls() > > > > Now, effectively 2 of the 4 are linear, 2 are non linear; > > such a problem is denoted as `` partially linear least-squares '' > > In such a case it's quite important (for efficiency and > > inference reasons) to make use of this fact. > > > > ---> use nls(...., method = "plinear" , ....) > > I think it should be 'algorithm = "plinear"' > > The full call would be something like > > nls(z ~ cbind(x^n*y^m, 1), data = mydata, start=c(n = 1.0, m = 2.0), > algorithm = "plinear") > > Must the exponents n and m be positive? If so, I recommend using the > logarithm of the exponents as the parameters in the optimization > > nls(z ~ cbind(x^exp(logn)*y^exp(logm), 1), data = mydata, > start=c(logn = 0., logm = log(2.0)), algorithm = "plinear") > -- Mail 1: [EMAIL PROTECTED] Mail 2: [EMAIL PROTECTED] Tel.: +41 (0)1 63 34906 Homepage: valjhun.fmf.uni-lj.si/~brumen ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help