6
$\begingroup$

As discussed in 77056 finding properties of certain functions can be difficult. I've been using the wonderful StringProperties function provided by @halirutan in their answer to that question, but sometimes you can find some information by simply doing symbol["Properties"]

I noticed today that in version 14.1 the properties of FittedModel[...] generated by NonlinearModelFit are different from 13.0.1, the other version I have immediately available.

In 13.0.1 we have the following 50 properties.

SeedRandom[0];
data = Exp[Range[10]] + RandomReal[1, 10];
nlm = NonlinearModelFit[data, Exp[a + b x], {a, b}, x];
nlm["Properties"]
(*output*)
{"AdjustedRSquared", "AIC", "AICc", "ANOVATable", \
"ANOVATableDegreesOfFreedom", "ANOVATableEntries", \
"ANOVATableMeanSquares", "ANOVATableSumsOfSquares", "BestFit", \
"BestFitParameters", "BIC", "CorrelationMatrix", "CovarianceMatrix", \
"CurvatureConfidenceRegion", "Data", "EstimatedVariance", \
"FitCurvatureTable", "FitCurvatureTableEntries", "FitResiduals", \
"Function", "HatDiagonal", "MaxIntrinsicCurvature", \
"MaxParameterEffectsCurvature", "MeanPredictionBands", \
"MeanPredictionConfidenceIntervals", \
"MeanPredictionConfidenceIntervalTable", \
"MeanPredictionConfidenceIntervalTableEntries", \
"MeanPredictionErrors", "ParameterBias", \
"ParameterConfidenceIntervals", "ParameterConfidenceIntervalTable", \
"ParameterConfidenceIntervalTableEntries", \
"ParameterConfidenceRegion", "ParameterErrors", "ParameterPValues", \
"ParameterTable", "ParameterTableEntries", "ParameterTStatistics", \
"PredictedResponse", "Properties", "Response", "RSquared", \
"SingleDeletionVariances", "SinglePredictionBands", \
"SinglePredictionConfidenceIntervals", \
"SinglePredictionConfidenceIntervalTable", \
"SinglePredictionConfidenceIntervalTableEntries", \
"SinglePredictionErrors", "StandardizedResiduals", \
"StudentizedResiduals"}

While in 14.1 we get the following 33 properties

{"AdjustedRSquared", "AIC", "AICc", "ANOVA", "BestFit", \
"BestFitParameters", "BIC", "CorrelationMatrix", "CovarianceMatrix", \
"CurvatureConfidenceRegion", "Data", "Weights", "EstimatedVariance", \
"FitCurvature", "FitResiduals", "Function", "HatDiagonal", \
"MaxIntrinsicCurvature", "MaxParameterEffectsCurvature", \
"MeanPredictions", "MeanPredictionBands", "ParameterEstimates", \
"ParameterConfidenceRegion", "ParameterBias", "PredictedResponse", \
"Properties", "Response", "RSquared", "SingleDeletionVariances", \
"SinglePredictions", "SinglePredictionBands", \
"StandardizedResiduals", "StudentizedResiduals"}

What's puzzling is that some of the seemingly 'missing' properties are still valid, in particular I can still use nlm["ParameterTable"] even though it is not listed. The similar but not identical nlm["ParameterEstimates"] exists in 14.1 but not in 13.0.1.

So my questions are:

  1. When and why did this change?

  2. How can I see hidden FittedModel[...] properties?

  3. Are the hidden properties being deprecated in favor of new ones?

$\endgroup$
2
  • 2
    $\begingroup$ I am aware that given 77056 and 1742 that this question has significant overlap, but I am also enquiring more specifically about the properties of NonlinearModelFit and about the past and future fate of NonlinearModelFit, and so I didn't consider this a duplicate. $\endgroup$ Commented Oct 23 at 3:21
  • 1
    $\begingroup$ I had the same issue yesterday, and only realized now that fm["ParameterEstimates"] is actually a dataset, so you can access the values in the table. It is not just a 'grid' that shows data. $\endgroup$
    – SHuisman
    Commented Oct 25 at 7:31

3 Answers 3

7
$\begingroup$

Using the Spelunk function from @Simon Woods amazing answer in this question I found the undocumented symbol FittedModels`NonlinearFitDump`$allNonlinearProperties which contains the following:

{"AdjustedRSquared", "AIC", "AICc", "ANOVA", "BestFit", \
"BestFitParameters", "BIC", "CorrelationMatrix", "CovarianceMatrix", \
"CurvatureConfidenceRegion", "Data", "Weights", "EstimatedVariance", \
"FitCurvature", "FitResiduals", "Function", "HatDiagonal", \
"MaxIntrinsicCurvature", "MaxParameterEffectsCurvature", \
"MeanPredictions", "MeanPredictionBands", "ParameterEstimates", \
"ParameterConfidenceRegion", "ParameterBias", "PredictedResponse", \
"Properties", "Response", "RSquared", "SingleDeletionVariances", \
"SinglePredictions", "SinglePredictionBands", \
"StandardizedResiduals", "StudentizedResiduals", "ANOVATable", \
"ANOVATableDegreesOfFreedom", "ANOVATableEntries", \
"ANOVATableMeanSquares", "ANOVATableSumsOfSquares", \
"FitCurvatureTable", "FitCurvatureTableEntries", \
"MeanPredictionConfidenceIntervals", \
"MeanPredictionConfidenceIntervalTable", \
"MeanPredictionConfidenceIntervalTableEntries", \
"ParameterConfidenceIntervals", "ParameterConfidenceIntervalTable", \
"ParameterConfidenceIntervalTableEntries", "ParameterErrors", \
"ParameterPValues", "ParameterTable", "ParameterTableEntries", \
"ParameterTStatistics", "SinglePredictionConfidenceIntervals", \
"SinglePredictionConfidenceIntervalTable", \
"SinglePredictionConfidenceIntervalTableEntries", \
"SinglePredictionErrors"}
$\endgroup$
5
  • 3
    $\begingroup$ This doesn't answer neither when nor the why part of your question ... $\endgroup$
    – Domen
    Commented Oct 23 at 7:26
  • 2
    $\begingroup$ @Domen Maybe "How can I see hidden NONlinearModelFit properties?" is not bold enough in OP? $\endgroup$ Commented Oct 23 at 7:55
  • $\begingroup$ you're correct @Domen, but why let the perfect be the enemy of the good? $\endgroup$ Commented Oct 23 at 19:35
  • 1
    $\begingroup$ The title of your question is literally "Why/when" :) (Not to mention you already roughly figured out when [between 13.0.1 and 14.1], and answering to "why" usually requires the Wolfram employees to provide an answer, so you could perfectly well ask about this the technical support instead). $\endgroup$
    – Domen
    Commented Oct 23 at 19:53
  • $\begingroup$ @Domen and azerbajdzan I edited the question a bit, hopefully it's less controversial now. $\endgroup$
    – xzczd
    Commented Oct 25 at 5:31
7
$\begingroup$

To answer your question directly: yes, we undocumented a bunch of the old properties because they don't fit with the design of the language as a whole anymore. Especially the "Table" and "TableEntries" properties were in need of updating badly because of how clunky they were and how out of place they looked in the language as a whole now that we have datasets etc. The old properties are (and will remain) still available for backwards compatibility, but we no longer document them. They also added a lot of unnecessary clutter to the reference pages of the fitting functions.

The old properties like "ANOVATableDegreesOfFreedom" didn't do anything special; they would just extract a particular entry from the table. Now you just use fit["ANOVA"][All, "DegreesOfFreedom"] to query the ANOVA property you need from the dataset. All of the deprecated properties are still available through one of the datasets that you can query.

As others have already pointed out, there are some symbols that still list the deprecated properties. You can find them with:

?FittedModels`*`$deprecated*Properties

or

Names["FittedModels`*`$deprecated*Properties"]

(*{"FittedModels`GLMDump`$deprecatedGLMProperties", "FittedModels`LinearFitDump`$deprecatedLinearProperties", "FittedModels`NonlinearFitDump`$deprecatedNonlinearProperties"}*)
$\endgroup$
2
  • $\begingroup$ Someone just found MeanPredictionErrors is missing: mathematica.stackexchange.com/q/308176/1871 Interestingly this seems to be the only missing property in 14.1, any special reason? $\endgroup$
    – xzczd
    Commented Oct 29 at 14:49
  • 2
    $\begingroup$ As Jim already replied, you can still get them. But you're right, it seems "MeanPredictionErrors" fell through the cracks and disappeared. I'll report this. $\endgroup$ Commented Oct 30 at 8:17
4
$\begingroup$

Odd that the OP did not find

FittedModels`NonlinearFitDump`$deprecatedNonlinearProperties

which is something that is explicitly asked about. (Odd, too, that this hint was included as a private system variable.)

Sort@nlm["Properties"] == 
 Complement[FittedModels`NonlinearFitDump`$allNonlinearProperties, 
  FittedModels`NonlinearFitDump`$deprecatedNonlinearProperties]

(*  True  *)
$\endgroup$
2
  • 1
    $\begingroup$ I did find it. but since all those are in FittedModels`NonlinearFitDump`$allNonlinearProperties I gave simply the total list $\endgroup$ Commented Oct 25 at 1:29
  • 1
    $\begingroup$ @Tapiocaweasel I meant that you asked whether the missing ones were deprecated. All the missing ones are in the deprecated list. It seems relevant to your question, no? $\endgroup$
    – Michael E2
    Commented Oct 25 at 1:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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