FindFormula[data]
data を近似する純関数を求める.
FindFormula[data,x]
data を近似する変数 x の記号関数を求める.
FindFormula[data,x,n]
data を近似する関数を n 個まで求める.
FindFormula[data,x,n,prop]
特性 prop に関連付けられた最適関数を n 個まで返す.
FindFormula[data,x,n,{prop1,prop2,…}]
特性 prop1,prop2等と関連付けられた最適関数を n 個まで返す.
FindFormula
FindFormula[data]
data を近似する純関数を求める.
FindFormula[data,x]
data を近似する変数 x の記号関数を求める.
FindFormula[data,x,n]
data を近似する関数を n 個まで求める.
FindFormula[data,x,n,prop]
特性 prop に関連付けられた最適関数を n 個まで返す.
FindFormula[data,x,n,{prop1,prop2,…}]
特性 prop1,prop2等と関連付けられた最適関数を n 個まで返す.
詳細とオプション
- データは{{x1,y1},{x2,y2},…}または{{1,y1},{2,y2},…}の形式の配列,あるいはTimeSeriesオブジェクトでなければならない.
- {y1,y2,…}形式のデータは{{1,y1},{2,y2},…}形式のデータに等しい.
- FindFormula[data,x,n,All]は可能なすべての特性を持つDatasetオブジェクトを作る.
- サポートされる特性
-
"Score" 内部スコア "Complexity" 関数の複雑さ "Error" 平均二乗誤差 All 上記の特性すべて - 使用可能なオプション
-
PerformanceGoal Automatic パフォーマンスのどの面について最適化するか RandomSeeding Automatic 内部的にどの擬似乱数生成器のシードを使うか SpecificityGoal 1 どのような複雑さの形式を求めるか TargetFunctions All 考慮する関数 TimeConstraint Automatic 結果を求めるまでの最大時間 - PerformanceGoalの可能な設定
-
"Speed" 結果を求めるまでの時間を最短にする "Quality" よりよい結果を求めようとする - SpecificityGoalの可能な設定
-
"Low" より簡単なフィット "High" より複雑な関数 s 0(最低)からInfinity(最高)までの特定性 - FindFormula[data,x,SpecificityGoal->Infinity]は誤差を最小にする解を求める.
- 1に等しいSpecificityGoalは,最高の予測パフォーマンスを与える.
- TargetFunctionsの可能な設定
-
All 以下にリストされたすべての関数 {
,
,…}関数 
- TargetFunctionsの可能な関数には,Plus,Times,Power,Sin,Cos,Tan,Cot,Log,Sqrt,Csc,Sec,Abs,Expがある.
- TimeConstraintの可能な設定
-
Automatic 自動 t 最大 t 秒 - RandomSeedingの可能な設定
-
Automatic 関数が呼ばれるたびに自動的にシードし直す Inherited 内部的にシードされた乱数を使う seed 明示的な整数または数列をシードとして使う
例題
すべて開く すべて閉じる例 (2)
関数 x Sin[x]の値の表を作る:
Table[{x, N[x Sin[x]]}, {x, 0, 4, .3}]FindFormulaはデータを生成する式を求める:
FindFormula[%, x]既知のメルセンヌ(Mersenne)素数の指数をプロットする:
plot = ListLogPlot[mersenneexponents = MersennePrimeExponent[Range[48]]]formula = FindFormula[Log[mersenneexponents], TargetFunctions -> {Power, Times}, SpecificityGoal -> "Low"]Show[plot, LogPlot[Exp[formula[n]], {n, 1, 48}]]スコープ (3)
data = Table[{x, Sin[2x] + Cos[x] + RandomVariate[NormalDistribution[0, 0.2]]}, {x, RandomReal[{-10, 10}, 1000]}];ListPlot[data]fits = FindFormula[data, x, 5]Show[ListPlot[data], Plot[fits, {x, -20, 60}, PlotRange -> All]]data = Table[{x, -x + 2Sin[x] + RandomVariate[NormalDistribution[0, 0.2]]}, {x, RandomReal[{-10, 10}, 100]}];ListPlot[data]データを近似する最初の5つの関数について,データ集合を可視化する:
fit = FindFormula[data, x, 5, All]data = Table[{x, Sin[2x] + x Exp[Cos[x]] + RandomVariate[NormalDistribution[0, 0.2]]}, {x, RandomReal[{-10, 10}, 500]}];ListPlot[data]最初の300のフィットを見,そのスコアをSpecificityGoalのさまざまな設定についての誤差と複雑さの関数としてプロットする:
fit = FindFormula[data, x, 300, {"Complexity", "Error", "Score"}, TimeConstraint -> 20, PerformanceGoal -> "Quality", SpecificityGoal -> 1];errorcomplexity = fit[[All, 2]];
errorcomplexity = Select[errorcomplexity, #[[2]] < 20&];
ListPlot3D[errorcomplexity, Filling -> Bottom]fit2 = FindFormula[data, x, 300, {"Complexity", "Error", "Score"}, TimeConstraint -> 20, PerformanceGoal -> "Quality", SpecificityGoal -> Infinity];errorcomplexity = fit2[[All, 2]];
errorcomplexity = Select[errorcomplexity, #[[2]] < 200&];
ListPlot3D[errorcomplexity, Filling -> Bottom]Show[ListPlot[data], Plot[fit[[1, 1]], {x, 0, 20}]]オプション (4)
PerformanceGoal (1)
data = Table[{x, x Cos[2 x] + Sin[2 x] + x + RandomVariate[NormalDistribution[0, 0.2]]}, {x, RandomReal[{-3, 20}, 1000]}];ListPlot[data]fit = FindFormula[data, x, 1, "Score" ]PerformanceGoalを使ってその内部スコアとともにデータを近似する最良関数を求める:
fit2 = FindFormula[data, x, 1, "Score", PerformanceGoal -> "Quality" ]Show[ListPlot[data], Plot[{First@fit, First@fit2}, {x, -20, 60}, PlotRange -> All]]RandomSeeding (1)
data = Table[{x, Sin[2 + x] + RandomVariate[NormalDistribution[0, 0.2]]}, {x, RandomReal[{-10, 10}, 500]}];FindFormulaのいろいろな評価を比較し,その違いを見る:
Table[FindFormula[data, x], 3]オプションRandomSeedingを使って異なる結果にならないようにする:
Table[FindFormula[data, x, RandomSeeding -> 1], 3]SpecificityGoal (1)
data = Table[{x, x + RandomVariate[NormalDistribution[0, 2]]}, {x, RandomReal[{-3, 20}, 15]}];ListPlot[data]SpecificityGoalのさまざまな値を使ってエラーのあるデータを近似する最良関数を求める:
fits = Table[FindFormula[data, x, 1, "Error", SpecificityGoal -> i], {i, {"Low", "High"}}]Table[Show[ListPlot[data], Plot[fits[[i, 1]], {x, -20, 60}, PlotRange -> All]], {i, 1, 2}]TargetFunctions (1)
data = Table[{x, x + Log[2 x] + RandomVariate[NormalDistribution[0, 0.2]]}, {x, RandomReal[{0.1, 20}, 1000]}];ListPlot[data]fit = FindFormula[data, x]TargetFunctionsを使ってデータを近似する最良関数を求める:
fit2 = FindFormula[data, x, TargetFunctions -> {Times, Log, Plus}]Show[ListPlot[data], Plot[{fit, fit2}, {x, -3, 20}]]アプリケーション (4)
人口増加 (1)
data = Entity["Country", "Poland"][EntityProperty["Country", "Population", {"Date" -> Interval[{DateObject[{1950}], DateObject[{2015}]}]}]]fit = FindFormula[data, x]Show[DateListPlot[data["Path"], ...], Plot[fit, {x, AbsoluteTime@data["FirstTime"], AbsoluteTime@data["LastTime"]}]]Model Prime Numbers (1)
primes = Table[Prime[n], {n, 100}];fit = FindFormula[primes, x]primesNext = Table[Prime[n], {n, 100, 300}];Show[ListPlot[primes], ListPlot[Transpose[{Range[100, 300], primesNext}], PlotStyle -> Red], Plot[fit, {x, 0, 300}, PlotStyle -> Gray], PlotRange -> All]微分方程式 (1)
sol = First[y /. NDSolve[{y'[x] == y[x]Cos[x], y[0] == 1}, y, {x, -5, 300}]];
times = N[Range[-5, 600] / 9];
data = Transpose[{times, sol[times] + RandomReal[.005, Length[times]]}];
lp = ListPlot[data, PlotRange -> All]fit = FindFormula[data, x, 1, TargetFunctions -> {Exp, Sin, Cos}, RandomSeeding -> 1234]Show[ListPlot[data], Plot[fit, {x, -20, 90}, PlotRange -> All]]軌道力学 (1)
data = EntityValue["Planet", {"SemimajorAxis", "OrbitPeriod"}];ListPlot[Thread[Callout[data, EntityList["Planet"]]]]formula = FindFormula[data, a, RandomSeeding -> 1234]formula /. a -> Quantity[1, "AstronomicalUnit"]ケプラー(Kepler)の第3法則によって与えられる厳密な式と比較する:
kepler = FormulaData[{"KeplersThirdLaw", "Sun"}]Sqrt@UnitConvert[kepler[[2]] / QuantityVariable["a", "Length"] ^ 3, ("Days"^2/"AstronomicalUnit"^3)]Sqrt@UnitConvert[(#2^2/#^3)&@@@data, ("Days"^2/"AstronomicalUnit"^3)]関連するガイド
-
▪
- 曲線のフィットと近似の関数 ▪
- 科学的データ解析 ▪
- 統計モデル解析 ▪
- 最適化 ▪
- 教師あり機械学習
テキスト
Wolfram Research (2015), FindFormula, Wolfram言語関数, https://reference.wolfram.com/language/ref/FindFormula.html (2017年に更新).
CMS
Wolfram Language. 2015. "FindFormula." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/FindFormula.html.
APA
Wolfram Language. (2015). FindFormula. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindFormula.html
BibTeX
@misc{reference.wolfram_2026_findformula, author="Wolfram Research", title="{FindFormula}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/FindFormula.html}", note=[Accessed: 05-July-2026]}
BibLaTeX
@online{reference.wolfram_2026_findformula, organization={Wolfram Research}, title={FindFormula}, year={2017}, url={https://reference.wolfram.com/language/ref/FindFormula.html}, note=[Accessed: 05-July-2026]}