LogModel
Details
- LogModel represents a polynomial in the given variables in a format suitable for symbolic or numerical evaluation and fitting.
- Logarithmic models describe phenomena with rapid initial changes followed by diminishing returns, perceptual scaling (e.g. sound or brightness) or processes whose response depends on relative rather than absolute changes.
- LogModel is parametrized as
. - Multivariate logarithms are parameterized as
. - The current model representation can be expanded using LogModel[…][…].
- When not specified, variables will automatically be enumerated using x[i].
- Valid variable specifications vars include:
-
n the number of variables symb a symbolic representation of a single variable {symb1,…} a list of symbolic variables - When not specified, parameters will automatically be enumerated using C[i].
- Valid parameter pars specifications in the form {par1,…} include:
-
val a fixed parameter value val par a symbolic parameter name par parval a symbolic name par set to a fixed value val {par,val0} a symbolic parameter named par with the initial value val0 - Model properties can be extracted using Information[PowerModel[…],prop].
- Valid basic properties include:
-
"BaseType" model base type "Name" model name "ShortName" short identifier to use as label "InputType" supported input types "OutputType" supported output types - Valid data-related properties include:
-
"ColumnNames" names of the input features "ColumnVariableMap" map between column names and model variables "InputSize" dimensionality of the input "OutputSize" dimensionality of the output "Trainable" whether the model is fully specified and can be trained "Trained" whether the model can be evaluated numerically "VariableColumnMap" map between model variables and column names "Variables" name of the model variables - Best model-related properties include:
-
"Expression" model expression "Function" model as a pure function "SymbolicExpression" model expression with symbolic parameters "TabularFunction" pure function suitable to work on a tabular row - Parameter-related properties include:
-
"ParameterAssociation" association of parameter names and values "ParameterCount" the number of parameters "ParameterInitialValues" initial values for the fit "ParameterNames" parameter names "ParameterRules" list of rules with parameter names and values "Parameters" parameter values if present; names otherwise "ParameterValues" parameter values "Constraints" parameter constraints
Variables
Parameters
Properties
Examples
open all close allBasic Examples (4)
Specify a generic logarithmic model:
LogModel[]Use an explicit input size and custom names for the symbolic parameters:
LogModel[{a, b}, 1]Plot over a variety of logarithms using constant parameters:
Plot[Evaluate@{LogModel[{1, 1}, 1][{x}], LogModel[{1, -1}, 1][{x}], LogModel[{-1, 1}, 1][{x}]}, {x, 0, 5}]Plot a multivariate LogModel:
Plot3D[Evaluate@LogModel[Association[], Association["ParameterNames" -> {C[1], C[2], C[3]},
"ParameterValues" -> {1, 1, 1}], Association["InputSize" -> 2]][{x, y}], {x, 0, 1}, {y, 0, 1}, ColorFunction -> "Rainbow"]Scope (23)
Variables (5)
LogModel[]The number of variables can be inferred from the input values:
LogModel[][{x}]LogModel[][{x, y, z}]ModelFit will assume the number of variables is one less than the dimensionality of data points:
ModelFit[(| | | |
| - | -- | --- |
| 1 | 9 | 55 |
| 1 | 1 | 7 |
| 1 | 4 | 25 |
| 8 | 9 | 118 |
| 8 | 10 | 124 |
| 8 | 5 | 94 |), LogModel[]]Specify the number of variables:
LogModel[2]Give the variables a custom symbolic representation:
LogModel[{var1, var2}]These names are overwritten when the model is evaluated on symbolic input:
LogModel[{var1, var2}][{a, b}]Parameters (4)
Parameter names are assigned automatically:
LogModel[1]Specify custom parameter names:
LogModel[{a, b}, 1]Set a parameter to a specific value:
LogModel[{42, b}, 1]Specify both parameter names and values:
LogModel[{a -> 1, b}, 1]Evaluation (5)
Symbolically evaluate a single-variable model:
LogModel[1][x]Symbolically evaluate a two-variable model:
LogModel[2][{x, y}]The number of variables is automatically inferred if not specified:
LogModel[][{x}]LogModel[][{x, y}]Evaluate the model on multiple symbolic variables:
LogModel[2][{{x, y}, {a, b}}]Evaluate the model on a list of points:
LogModel[2][{{1, 2}, {3, 4}, {5, 6}}]Information (5)
View general information about a model:
Information[LogModel[]]Some information is only available when variables or parameters are fully specified:
Information[LogModel[1]]Get specific properties from the model:
Information[LogModel[{a, b, c}, {x, y}], "Variables"]Information[LogModel[{a, b, c}, {x, y}], {"Variables", "Parameters"}]Get information about the default model values:
Information[LogModel[2], {"Variables", "Parameters"}]Model Fit (4)
ModelFit[{...}, LogModel[]]Fit a model keeping some parameter fixed:
ModelFit[{...}, LogModel[{a -> 2, b}, x]]Specify initial search value for a parameter:
ModelFit[{...}, LogModel[{a, {b, 4}}, x]]Numerical parameter values are considered fixed during fitting:
ModelFit[{...}, LogModel[{10, a}, 1]]Applications (4)
Basic Applications (2)
Perceived loudness increases logarithmically with sound intensity:
ModelFit[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Intensity" -> Association["ElementType" -> "Real64"],
"Loudness" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{8.080373213300213, 2.3268103901902437,
2.8643737904759066, 1.0239703869809458, 3.399421830819257, 4.051078245090355,
8.141214004567221, 2.84180977205088, 3.171442858100448, 6.02339707159737,
4.076679422869466, 7.621289289912993, 8.69671372686465, 7.449560687708361,
2.442536661283495, 3.2411212858561633, 1.910462926522739, 1.5013295807476013,
3.6993760337296515, 0.5542249750738902, 2.9365322895506094, 3.0998156577662073,
7.855332342118801, 4.8095516717357265, 7.9895986964656815, 6.214970467051509,
3.969097674283737, 2.3102572231062335, 8.124246753619477, 1.6708218017691028,
1.6628182138532166, 6.2603820321002885, 1.024891324669527, 6.783557758683011,
7.493620926242163, 6.4557959499692075, 4.890008348367592, 9.62896012482757,
0.8050452168808937, 8.800582205448128, 2.8330638505903134, 8.453807703904989,
7.724101528120712, 9.991740522185063, 5.932589896060873, 5.1414383779537,
8.147431667225629, 8.103943068881701, 5.457145138531821, 6.552094758953107,
1.1930315891830685, 6.125365452009308, 5.266134617428696, 6.629784678941277,
8.218803206695767, 2.9825501677798383, 8.770556552059668, 4.940237130865253,
1.4435900082032207, 2.4181204913840144, 2.6281949197432586, 4.459337839246069,
5.425251889066782, 0.5755763815405351, 8.083124177995078, 1.4701545807236325,
5.279205349836774, 5.667717505544238, 5.57709290226736, 8.433352850545457,
8.338141965776087, 2.6261002181140407, 2.5568298423346727, 4.7903796602353435,
0.7328637048807154, 5.537036772875261, 0.8168234208515605, 7.3216055140021385,
2.8890121770284773, 2.3363320929821083, 8.990153748182246, 6.616850081444329,
3.2765887540292398, 1.6190470075759174, 2.9266174311257798, 1.2392471420657136,
3.069512456914487, 3.326678188278251, 9.137510990021314, 4.167228394157722,
8.404536577431161, 3.5708540728579194, 9.048159568520276, 6.897709147127333,
3.7142970811254528, 5.645146436902325, 5.835429619343661, 3.2259109022216723,
3.5520960120959937, 2.444687812958157}, {}, None}, "ElementType" -> "Real64"]],
TabularColumn[Association["Data" -> {{51.62573646545756, 40.59854069159808,
39.843203422870786, 31.728350702066614, 43.53276645449761, 42.7486257960438,
52.24419309761529, 40.45298253776128, 41.245632084877215, 47.07328488275771,
42.73379210715889, 51.967684340763974, 50.397985332418585, 50.15479797509122,
38.09168405911341, 41.436339706105386, 34.071870282829416, 34.65273260135466,
42.75893488532243, 24.500788657562154, 40.14424170158476, 40.11269261991901,
51.360518066465204, 46.548938628741205, 50.66789053377392, 47.63186047674003,
42.991464088793954, 38.25599933547693, 51.02506677600776, 35.3830339726722,
34.585611191321796, 49.003170523884464, 29.009088739358656, 49.29984095691386,
49.95479585230135, 47.03638692628988, 47.19466511254918, 53.09054400730239,
28.693902688057076, 51.835774850467764, 41.64188091161464, 51.220457832837134,
49.35437218994715, 52.93982350232503, 45.9960525357894, 46.10291906506118,
52.364512741550804, 50.93950240074333, 48.58271281335898, 49.167502647891666,
30.883012547208665, 48.40003617546243, 46.194788484786315, 49.6897571228215,
51.0623887468061, 40.77443408923714, 51.680618012081595, 45.14064281992466,
33.79463926064697, 39.03448668544479, 38.208357174572896, 45.83626941285964,
45.48075251378063, 23.789979341524166, 51.444001035643495, 32.559779659868425,
47.61279601193648, 46.34057666295418, 47.376612939522104, 50.813701993341496,
50.37516374480313, 38.55838259754378, 39.9020777224404, 44.182185486419066,
25.678928549247146, 46.89968719796364, 28.837291067513025, 50.875091423022965,
40.26036848330542, 36.876630933959845, 52.60409996308439, 49.88847123090957,
42.003039735372326, 35.37024736256783, 42.20554005551732, 33.21296566372541,
41.780870031043605, 41.14691926251938, 50.890854233671604, 44.87212021892749,
50.78610820994989, 43.30249992975687, 51.72426515094944, 51.95898338402786,
41.994480815937145, 46.88524091911655, 49.3955891223841, 41.72633030998739,
43.245822291245354, 37.984642847119126}, {}, None}, "ElementType" -> "Real64"]]}}]]]] -> "Loudness", LogModel[]]Information gain often grows logarithmically with the number of samples:
ModelFit[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["N" -> Association["ElementType" -> "Integer64"],
"Information" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{17, 127, 829, 504, 429, 336, 190, 752, 101, 980, 888,
250, 46, 317, 578, 206, 827, 74, 924, 814, 246, 240, 424, 518, 389, 762, 457, 299,
651, 520, 307, 984, 979, 197, 184, 311, 220, 255, 762, 692, 577, 954, 516, 31, 403,
854, 753, 12, 16, 645, 332, 832, 833, 830, 465, 856, 700, 891, 520, 920, 172, 863,
837, 85, 25, 748, 720, 716, 121, 10, 537, 697, 389, 133, 546, 821, 610, 406, 782, 914,
294, 932, 11, 799, 28, 992, 97, 112, 852, 826, 763, 17, 566, 679, 323, 648, 977, 945,
781, 842}, {}, None}, "ElementType" -> "Integer64"]],
TabularColumn[Association["Data" -> {{10.518131300281027, 16.50212078777549,
22.15709875247888, 20.81345544638709, 20.29656082737364, 19.40105436514857,
17.835891309183747, 21.94784080171852, 15.866056630413595, 22.731303942333344,
22.364652221048846, 18.674493269782186, 13.411551993655072, 19.544738750521024,
20.985993188709262, 18.17709762714876, 22.406042915563084, 14.846667140587147,
22.551647670866295, 22.180885009350803, 18.482383668513727, 18.48576901340221,
20.243254908419395, 20.906897833616785, 19.952539175366656, 21.757842321097705,
20.424396717687372, 19.107073449327793, 21.36751435391515, 20.652784779918466,
19.17154616768312, 22.634472011448718, 22.66918067201441, 17.983305811562982,
17.655341731740968, 19.401666136498136, 18.2200469914962, 18.560176305938214,
21.92765606318693, 21.443992472840936, 20.97262782426649, 22.612655333934377,
20.688514386205508, 12.143379766971014, 19.895914328811983, 22.296910840825397,
22.054841528042218, 9.409791416576473, 10.317471260121291, 21.474302255303453,
19.575239514675694, 22.298635834866424, 22.04053430432022, 22.083782318900443,
20.417753022010707, 22.33869681606897, 21.626185271695014, 22.38829212730427,
20.927902061548465, 22.43951279444378, 17.368725366462602, 22.390850180676885,
21.943320218846505, 15.354078447820132, 11.784778078628094, 21.79158353585974,
21.804793071580008, 21.67551830414837, 16.208981734151823, 8.843973182120894,
20.935752303787574, 21.553998163864883, 19.694580254091647, 16.65643284262435,
20.81384487581712, 22.272632179026125, 21.18533521330724, 19.879963571836456,
21.94633805408085, 22.408743093939396, 18.88114880689666, 22.651045163790002,
9.15091130633754, 22.16957688741519, 11.93493022379055, 22.63297596670176,
15.778210342334248, 16.144169386352583, 22.130754254173613, 22.173328139940967,
21.801526377158673, 10.48235800969294, 21.029254903863023, 21.43171710603903,
19.46140513214984, 21.303676812773958, 22.579127410345308, 22.698474432928148,
22.07209727246727, 22.158478157144515}, {}, None}, "ElementType" -> "Real64"]]}}]]]] -> "Information", LogModel[]]Economic Indicators (1)
Retrieve data on GDP vs life expectancy:
countryData = {
CountryData[#, "GDPPerCapita"], CountryData[#, "LifeExpectancy"]}& /@ CountryData["Countries"];
Short[countryData]Fit a logarithmic model to the data:
model = ModelFit[countryData, LogModel[]]Show[ListPlot[countryData, PlotStyle -> StandardOrange],
Plot[ model[x], {x, Quantity[0, "USDollars"/("People"*"Years")], Quantity[90000, "USDollars"/("People"*"Years")]}], ...]Marketing Response (1)
Collect data on brand awareness versus advertising spending:
advertisingData = {...};dataPlot = ListPlot[advertisingData, ...]Fit a logarithmic and power model to the data:
model = ModelFit[advertisingData, {LogModel[], PowerModel[{a -> 0, b, c}, x]}]Compare the model to the data:
Show[
dataPlot,
Plot[ model[x], {x, 10 ^ 2, 10 ^ 6}, PlotRange -> All, PlotStyle -> Opacity[.8, StandardRed]]
]Properties & Relations (1)
Related Guides
History
Text
Wolfram Research (2026), LogModel, Wolfram Language function, https://reference.wolfram.com/language/ref/LogModel.html.
CMS
Wolfram Language. 2026. "LogModel." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LogModel.html.
APA
Wolfram Language. (2026). LogModel. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LogModel.html
BibTeX
@misc{reference.wolfram_2026_logmodel, author="Wolfram Research", title="{LogModel}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/LogModel.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_logmodel, organization={Wolfram Research}, title={LogModel}, year={2026}, url={https://reference.wolfram.com/language/ref/LogModel.html}, note=[Accessed: 12-June-2026]}