cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

genfit, linfit, regress etc with units in Prime

ValeryOchkov
24-Ruby IV

genfit, linfit, regress etc with units in Prime

The genfit function works correct with units (sorry, Цена is the Price of an old car, Пробег - a MileAge, Возраст - a Age):

7-genfit.png

he line function works correct:

4-Price-Age.png

But regress and linfit not correct:

5-regress.png

6-linfit.png

11 REPLIES 11

That seems like an awful lot of money for a Москвич, Valery, even after 13 years! ...

Stuart

(My grandfather had a 427 (the estate version))

StuartBruff wrote:

That seems like an awful lot of money for a Москвич, Valery, even after 13 years! ...

Stuart

(My grandfather had a 427 (the estate version))

This one right-hand drive car:

Moskvitch.png

Valery Ochkov wrote:

StuartBruff wrote:

That seems like an awful lot of money for a Москвич, Valery, even after 13 years! ...

Stuart

(My grandfather had a 427 (the estate version))

This one right-hand drive car:

Moskvitch.png

That's the one; similar age, too.

Although, he didn't rally his!

OK!

But what about the origin question?

Valery Ochkov wrote:

OK!

But what about the origin question?

Have you done an error check against the line and regress outputs?  It looks, at first glance, as though regress has simply found what it thinks is a better fit to the data.  If I drop n back to 1, then regress and line give the same result.

Changing n to 3 gives a reduced error.

Stuart

Thanks, Stuart.

But the question is - why k from the regress function has no units but arguments of this function have units?

And we must do so x/sec.

In the line function - no problem!

I guess  it is a bug in regress function.

Or?

Valery Ochkov wrote:

Thanks, Stuart.

But the question is - why k from the regress function has no units but arguments of this function have units?

And we must do so x/sec.

In the line function - no problem!

I guess  it is a bug in regress function.

Or?

Мои извинения, Валерий  I misunderstood your point; I thought by "incorrect". you were referring to the graphs, not the output from the functions themselves.


I decided to simplify the data and stick to SI units, metres and seconds, (not that it should have made any difference); regress didn't return units, but I got what looks like the correct units and numeric values from linfit. 




I then tries £ in place of seconds, then metres, and also got correct values. 





Maybe Russian Prime doesn't like $$$$? 



I'll have a look at genfit later, if I get time, and have a closer look at your original data.


Stuart

But I have a bug! Why?

linfiterror.png

StuartBruff
23-Emerald III
(To:StuartBruff)

As I suspected, the problem with linfit that you are seeing is due to the magnitude of the time data.  You have it in years, which Mathcad in its wisdom converts to seconds.  linfit then has a hard time getting the numerics right.

Stuart

Time in Years

Time in days

Time in seconds

Sorry, but I think it is a bug: n=2 - all ok (with years), n>2 - not ok

Valery Ochkov wrote:

Sorry, but I think it is a bug: n=2 - all ok (with years), n>2 - not ok

If so, then it's a bug that affects M15 as well, Valery!  And if so, it is probably a long-standing one.

The 2nd order coefficient isn't actually zero, BTW:

which means that evaluating the polynomial for x = seconds (ie, in the order of 10^8) will lead to the polynomial 0 + -7.132 xs + 1.881 xs^2 , where xs = x/10^8; hence the parabola.   And I'm guessing that the numeric difficulties in trying to fit a higher order polynomial through large values lies behind the strange numbers .... although a quick and dirty minerr does seem to give better results ...

Stuart

Announcements

Top Tags