In addition, this link function is usually used with 'binomial' instead of
'normal'  did you really mean to use normal?
Also (assuming you did intend binomial), please verify this matches what you
want, but I think it would be equivalent and simpler to use
glmfit(log10(x),y,'binomial','link','comploglog')
That is, use the complementary loglog link on the log10 of your data,
instead of building the log10 transform into your function.
 Tom
"Peter Perkins" <Peter.Remove.Perkins.This@mathworks.com> wrote in message
news:jhdsh9$8ve$1@newscl01ah.mathworks.com...
> Grace, this is the expression you have passed into glmfit:
>
> { @(y) 10^((log(1og(1y))a)/b), ...
> @(y) 10.^((log(1og(1y))a)/b)/(b*(1og(1y)*(1y))), ...
> @(y) 1exp(exp(a+b*log10(y))) }
>
>
> Since you haven't provided the errors you get, we can only guess as to
> what's happening. But there are a number of problems with this.
>
> * You've used the character "1" (the number one) when you want "l" (the
> letter ell)
> * You've used matrix operators such as *, ^, and / when you want
> elementwise operators such as .*, .^, and ./
> * Your link function is parameterized by a and b, which you have not
> defined.
>
> You probably also want to make use of the log1p function and replace all
> those log(1y)'s with log1p(y).
>
> Hope this helps.
>
>
> On 2/14/2012 4:55 AM, grace wrote:
>> Dear all,
>>
>> I am employing glmfit to solve Generalized Linear Models, and the link
>> function I choose is Weibull, which is also known as Gompertz,
>>
>> y=1exp(exp(a+b*log10(x))) ;
>>
>> The guiding information I find in help reads "cell array of the form
>> {FL FD FI}, containing three function handles, created using @, that
>> define the link (FL), the derivative of the link (FD), and the inverse
>> link (FI)." And I try to write some code:
>>
>>
>> [b,dev,stats]=glmfit(X,Y,'normal','link',{@(y)(10^((log(1og(1y))a)/
>> b)),@(y)(10.^((log(1og(1y))a)/b)/(b*(1og(1y)*(1y)))),@(y)(1exp(
>> exp(a+b*log10(y))))})
>>
>>
>> There are always errors. I am not familiar with function handles. And
>> I want to know if y should be a matrix, how to define the link
>> function in the right way?
>>
>> Thanks a lot.
>
