Dear Dr. Ben Bolker and 'JLucke',

Thanks for your comments, but I'm still facing some problems.
For example, using the gls() function, I receive an error message and I'm
not sure I'm writing the arguments in the right way.
Instead, I thought about my original models and realized that I was
modelling variance as a linear function of the predictor variable, which
could drop off to zero values. Changing

sd = c0 + c1*x

to

sd = c0*x^c1

avoids the zero values and all problematic models have converged. Paying
attention on the estimates, they also make sense.

The new problem now (and probably due to my weak Mathematical skills) is
that one set o candidate models includes models that consider the effect of
not only one, but two predictor variables on the response (y).

How could be the right way to model that?

sd = c0 * (x ^ c1) * (w ^ c2)

or

sd = (c0 * x ^ c1) + (c0 * w ^ c2) ?

In which c0, c1, and c2 are constant parameters, and x and w are different
predictor variables.

Thanks again

Billy

On Mon, Aug 29, 2011 at 3:50 PM, Ben Bolker <bbolker@gmail.com> wrote:

> Billy.Requena <billy.requena <at> gmail.com> writes:
>
> >
> > Hi everybody,
> >
> > I'm interested in evaluating the effect of a continuous variable on the
> mean
> > and/or the variance of my response variable. I have built functions
> > expliciting these and used the 'mle2' function to estimate the
> coefficients,
> > as follows:
> >
> > func.1 <- function(m=62.9, c0=8.84, c1=-1.6)
> >       {
> >       s <- c0+c1*(x)
> >       -sum(dnorm(y, mean=m, sd=s,log=T))
> >       }
> >
> > m1 <- mle2(func.1, method="SANN")
> >
> > However, the estimation of the effect of x on the variance of y usually
> has
> > dealt some troubles, resulting in no convergencies or sd of estimates
> > extremely huge. I tried using different optimizers, but I still faced the
> > some problems.
> >
> > When I had similar troubles in 'GLMM' statistical universe, I used
> bayesian
> > functions to solve this problem, enjoyning the flexibility of different
> > start points to reach the maximum likelihood estimates. However, I have
> no
> > idea which package or which function to use to solve the specific problem
> > I'm facing now.
> > Does anyone have a clue?
> > Thanks in advance
>
>  Unless I'm missing something, you can fit this model
> (more easily) in gls() from the nlme package, which allows models
> for heteroscedasticity.  See ?nlme::varConstPower
>
>  gls(y~1,weights=varPower(power=1,form=~x),data)
>
>  This gives you a standard deviation proportional to (t1+|v|);
> that is, if the baseline residual standard deviation is S, then
> the standard deviation is S*(t1+|v|), so S would correspond to
> your c1 and S*t1 would correspond to your c0.
>
>   Ben Bolker
>
> ______________________________________________
> 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.
>



-- 
Gustavo Requena
PhD student - Laboratory of Arthropod Behavior and Evolution
Universidade de São Paulo
Correspondence adress:
a/c Glauco Machado
Departamento de Ecologia - IBUSP
Rua do Matão - Travessa 14 no 321 Cidade Universitária, São Paulo - SP,
Brasil
CEP 05508-900
Phone number: 55 11 3091-7488

http://ecologia.ib.usp.br/opilio/gustavo.html

	[[alternative HTML version deleted]]

