On Wed, 29 Aug 2007, Naxerova, Kamila wrote:

> Dear list,
>
> I have a series of data points which I want to approximate with exactly two
> linear functions. I would like to choose the intervals so that the total
> deviation from my fitted lines is minimal. How do I best do this?

>From the information you give it seems that you want to partition a model 
like
   lm(y ~ x)
along a certain ordering of the observations. Without any further 
restrictions you can do that with the function breakpoints() in package 
"strucchange". If there are continuity restrictions or something like 
that, you want to look at the "segmented" package.

hth,
Z

> Thanks!
> Kamila
>
>
> The information transmitted in this electronic communication...{{dropped}}
>
> ______________________________________________
> R-help@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.
>
>

______________________________________________
R-help@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.

Reply via email to