Re: [Rd] User Error (was LOESS (PR#9064))

From: <ripley_at_stats.ox.ac.uk>
Date: Fri 07 Jul 2006 - 11:08:09 GMT


Please do as we ask (repeatedly) and study the help page before posting.

'family' is a separate argument, not part of loess.control, as the help page correctly documents. If you use

cars.lo2 <- loess(dist ~ speed, cars, family = "symmetric",   control = loess.control(surface = "direct", iterations = 20)) cars.lo2$pars$iterations

it prints *20*, as it is documented to do.

On Fri, 7 Jul 2006, lamp@few.eur.nl wrote:

> Dear Mr Ripley,

> Thank you for your help.
>
> Version of R: 2.3.1
> Platform: Windows XP
>
> Example:
>
> cars.lo2 <- loess(dist ~ speed, cars,
> control = loess.control(surface = "direct" , family = 'symmetric' ,
> iterations = 20))
> cars.lo2$pars$iterations
>
> Returns 1, where it should return 10.

Why 10? It should and does return 1, but you seem to think you asked for 20!

> If one makes the alterations this will not happen.

It would then be incorrect on the example on the help page.

>
> Best regards,
>
> Felix Lamp
>
>
>
>
>> On Fri, 7 Jul 2006, lamp@few.eur.nl wrote:
>>
>>> Hello,
>>>
>>> I found a little BUG in loess <stats>. It does not receive the
>>> iterations
>>> parameter.
>>
>> Please provide an example demonstrating this 'BUG', as we do ask you to
>> do, along with basic information like your name, the version of R, the
>> platform ....
>>
>>> It can be debugged in the following way:
>>
>> (Not in any sense of `debugged' that my dictionary mentions.)
>>
>>> THIS IS AN EXCERPT FROM THE CODE:
>>>
>>> ....
>>>
>>> fit <- simpleLoess(y, x, w, span, degree, parametric, drop.square,
>>> normalize, control$statistics, control$surface, control$cell,
>>> iterations, control$trace.hat)
>>>
>>> Replace argument iterations with control$iterations.
>>
>> Why? The code contains a few lines earlier
>>
>> iterations <- if(family=="gaussian") 1 else control$iterations
>>
>> which is the intention. ?loess.control does say
>>
>> iterations: the number of iterations used in robust fitting.
>> ^^^^^^
>>
>>> I found also remarkable differences when comparing loess with PROC LOESS
>>> (in SAS) using the same parameters and variables. It really confuses me.
>>> Where can I report this?
>>
>> R-bugs is not a place to ask questions, but bugs in SAS can be reported to
>> SAS inc.
>>
>> --
>> Brian D. Ripley, ripley@stats.ox.ac.uk
>> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
>> University of Oxford, Tel: +44 1865 272861 (self)
>> 1 South Parks Road, +44 1865 272866 (PA)
>> Oxford OX1 3TG, UK Fax: +44 1865 272595
>>
>
>
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Fri Jul 07 21:16:50 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 07 Jul 2006 - 12:27:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.