4
$\begingroup$

After I input the following:

data = Table[{3 + i + RandomReal[{-3, 7}], 
i + RandomReal[{-2, 5}]}, {i, 1, 20}];

model = LinearModelFit[data, x, x]

I got something weird:

(*   FittedModel[-1.65238+<<19>>x]     *)

Does anyone know what <<19>>x means?

$\endgroup$
4
  • $\begingroup$ Try model[x] ;-) $\endgroup$
    – chris
    Nov 25, 2012 at 17:44
  • $\begingroup$ I followed the tutorial precisely but the tutorial displayed the result that is understandable: FittedModel[-1.65238+0.694915x] How can I tweak the preference to get the same result? $\endgroup$
    – Lei Chen
    Nov 25, 2012 at 18:07
  • $\begingroup$ it does for me (i.stack.imgur.com/eLOqb.png); please try from a new session? $\endgroup$
    – chris
    Nov 25, 2012 at 18:13
  • $\begingroup$ @chris Perhaps something with a precision setting. data = SetPrecision[ Table[{3 + i + RandomReal[{-3, 7}], i + RandomReal[{-2, 5}]}, {i, 1, 20}], 200]; gets a similar result. $\endgroup$ Nov 25, 2012 at 18:59

2 Answers 2

14
$\begingroup$

<<19>> or Skeleton[19] means that some output (here 19 elements) is omitted. See the ShortAndShallowOutput tutorial in the Documentation Center for more information.

$\endgroup$
3
  • $\begingroup$ How can I tweak the input to get something understandable? $\endgroup$
    – Lei Chen
    Nov 25, 2012 at 17:58
  • 2
    $\begingroup$ @LeiChen It is important to realize that the output that you see is only a symbolical representation of the actual output. What you get returned is an object which knows several methods as Chris showed. How the object is depicted on your screen is totally irrelevant. It could have been a pink elephant, that doesn't matter, it's only decoration. If you're after the fit itself you can use model["BestFit"] $\endgroup$ Nov 25, 2012 at 19:17
  • $\begingroup$ @Sjoerd C. de Vries Thanks! $\endgroup$
    – Lei Chen
    Nov 25, 2012 at 19:43
6
$\begingroup$

LinearModelFit returns a full statistical information set.

For instance

   model[x] 

would return

   (* 0.778634 x+1.13751  *)

or

   model["ANOVATable"]

Mathematica graphics

More generally, try

   model /@ model["Properties"]

Mathematica graphics

$\endgroup$
4
  • 1
    $\begingroup$ I think the question really was: "Does anyone know what <<19>>x means" :) $\endgroup$
    – rm -rf
    Nov 25, 2012 at 17:56
  • 2
    $\begingroup$ @rm-rf probably, but if the OP is a real beginner he/she might be after understanding Mathematica's cryptic answer ;-) $\endgroup$
    – chris
    Nov 25, 2012 at 17:57
  • $\begingroup$ Oh, I certainly agree (and going by their comment under ssch's answer, they're clueless). I thought I'd just point out, just in case you hadn't seen it :) $\endgroup$
    – rm -rf
    Nov 25, 2012 at 18:56
  • 8
    $\begingroup$ << +1 >> $\phantom{}$ $\endgroup$ Nov 25, 2012 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.