[R] Optimization
Spencer Graves
spencer.graves at pdf.com
Mon Sep 4 21:30:44 CEST 2006
Have you considered talking logarithms of the expression you
mentioned:
log(Yield) = a1*log(A)+b1*log(B)+c2*log(C)+...
where a1 = a/(a+b+...), etc. This model has two constraints not present
in ordinary least squares: First, the intercept is assumed to be zero.
Second, the coefficients in this log formulation must sum to 1. If I
were you, I might use something like "lm" to test them both.
To explain how, I'll modify the notation, replacing A by X1, B by
X2, ..., up to Xkm1 (= X[k-1]) and Xk for k different environmental
variables. Then I might try something like the following:
fit0 <- lm(log(Yield) ~ log(X1) + ... + log(Xk)-1 )
fit1 <- lm(log(Yield) ~ log(X1) + ... + log(Xk) )
fit.1 <- lm(log(Yield/Xk) ~ log(X1/Xk) + ... + log(Xkm1/Xk) )
fit.0 <- lm(log(Yield/Xk) ~ log(X1/Xk) + ... + log(Xkm1/Xk)-1 )
anova(fit1, fit0) would test the no-constant model, and if I
haven't made a mistake in this, anova(fit0, fit.0) and anova(fit1,
fit.1) would test the constraint that all the coefficients should sum to
1.
If you would like further help from this listserve, please provide
commented, minimal, self-contained, reproducible code to help potential
respondents understand your question and concerns (as suggested in the
posting guide "www.R-project.org/posting-guide.html").
Hope this helps.
Spencer Graves
Simone Vincenzi wrote:
> Dear R-list,
> I'm trying to estimate the relative importance of 6 environmental variables
> in determining clam yield. To estimate clam yield a previous work used the
> function Yield = (A^a*B^b*C^c...)^1/(a+b+c+...) where A,B,C... are the
> values of the environmental variables and the weights a,b,c... have not been
> calibrated on data but taken from literature. Now I'd like to estimate the
> weights a,b,c... by using a dataset with 110 observations of yield and
> values of the environmental variables. I'm wondering if it is feasible or if
> the number of observation is too low, if some data transformation is needed
> and which R function is the most appropriate to try to estimate the weights.
> Any help would be greatly appreciated.
>
> Simone Vincenzi
>
> _________________________________________
> Simone Vincenzi, PhD Student
> Department of Environmental Sciences
> University of Parma
> Parco Area delle Scienze, 33/A, 43100 Parma, Italy
> Phone: +39 0521 905696
> Fax: +39 0521 906611
> e.mail: svincenz at nemo.unipr.it
>
>
>
> --
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>
More information about the R-help
mailing list