さまざまなフィット関数およびその他の関数のオプションで,データ要素に関連する重みを指定する.
Weights
さまざまなフィット関数およびその他の関数のオプションで,データ要素に関連する重みを指定する.
例題
すべて開く すべて閉じる例 (1)
LinearModelFit[Range[10] ^ 2, x, x]//NormalLinearModelFit[Range[10] ^ 2, x, x, Weights -> 1 / Range[10]]//NormalLinearModelFit[Range[10] ^ 2, x, x, Weights -> (Sqrt[#]&)]//NormalLinearModelFit[Range[10] ^ 2, x, x, Weights -> (Sqrt[#2]&)]//Normalスコープ (2)
data = {{0, 1}, {1, 0}, {3, 2}, {5, 4}};NonlinearModelFit[data, Log[a + b x ^ 2], {a, b}, x]//Normal(nlm = NonlinearModelFit[data, Log[a + b x ^ 2], {a, b}, x, Weights -> {1, (1/2), (1/3), (1/4)}])//Normaldata = {{0, 1}, {1, 0}, {3, 2}, {5, 10}};GeneralizedLinearModelFit[data, x, x, ExponentialFamily -> "Poisson"]//NormalGeneralizedLinearModelFit[data, x, x, ExponentialFamily -> "Poisson", Weights -> {1, 2, 3, 4}]//NormalLogitModelFit[{.01, .3, .5, .7, .9}, x, x]//NormalLogitModelFit[{.01, .3, .5, .7, .9}, x, x, Weights -> (1 / Sqrt[#]&)]//NormalProbitModelFit[{.01, .3, .5, .7, .9}, x, x]//NormalProbitModelFit[{.01, .3, .5, .7, .9}, x, x, Weights -> (1 / Sqrt[#]&)]//Normaldata = {{2.8, 1.8, 4.5}, {1.8, 2.2, 2.7}, {0.6, 4.6, 1.6}, {2.8, 4.1, 2.6}, {3., 0.1, 3.7}};LinearModelFit[data, {x, y}, {x, y}, Weights -> (Sqrt[#1 ^ 2 + #2 ^ 2]&)]//NormalLinearModelFit[data, {x, y}, {x, y}]//NormalLinearModelFit[data, {x, y}, {x, y}, Weights -> (Log[#3]&)]//Normalアプリケーション (1)
data = {{2.8, 1.8, 4.5}, {1.8, 2.2, 2.7}, {0.6, 4.6, 0.6}, {2.8, 4.1, 2.6}, {3., 0.1, 3.7}};Δys = {.1, .15, .12, .2, .08};nlm = NonlinearModelFit[data, a x Exp[b Sin[y]], {a, b}, {x, y}, Weights -> 1 / Δys ^ 2, VarianceEstimatorFunction -> (1&)]nlm["ParameterErrors"]nlm["ParameterErrors", VarianceEstimatorFunction -> Automatic]特性と関係 (2)
LinearModelFit[Range[10], x ^ 2, x, Weights -> Range[10]]//NormalLinearModelFit[Range[10], x ^ 2, x, Weights -> Range[10] / Total[Range[10]]]//Normaldata = RandomReal[10, {5, 2}];
wts = {1, 2, 3, 2, 1};LinearModelFit[data, {x, Sin[x]}, x, Weights -> wts]["BestFitParameters"]LeastSquaresは重みが組み込まれると同等の結果を与える:
dm = DesignMatrix[data, {x, Sin[x]}, x];
resp = data[[All, -1]];
LeastSquares[Sqrt[wts]dm, Sqrt[wts]resp]テキスト
Wolfram Research (2008), Weights, Wolfram言語関数, https://reference.wolfram.com/language/ref/Weights.html.
CMS
Wolfram Language. 2008. "Weights." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Weights.html.
APA
Wolfram Language. (2008). Weights. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Weights.html
BibTeX
@misc{reference.wolfram_2026_weights, author="Wolfram Research", title="{Weights}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/Weights.html}", note=[Accessed: 01-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_weights, organization={Wolfram Research}, title={Weights}, year={2008}, url={https://reference.wolfram.com/language/ref/Weights.html}, note=[Accessed: 01-November-2026]}