BiweightLocation[list]
给出 list 中元素的双权位置估计量的值.
BiweightLocation[list,c]
给出缩放参数为 c 的双权位置估计量的值.
BiweightLocation
BiweightLocation[list]
给出 list 中元素的双权位置估计量的值.
BiweightLocation[list,c]
给出缩放参数为 c 的双权位置估计量的值.
更多信息和选项
- BiweightLocation 是稳健的位置估计量.
- BiweightLocation 由元素的加权均值给出. 离中心较远的元素的权重也较低.
- 加权函数的宽度由参数 c 控制. 较大的 c 表明在计算统计量时有更多的数据被包含进来,反之亦然.
- 对于列表 {x1,x2,…,xn} ,双权位置估计量的值由
给出,其中
,
为 Median[{x1-x*,x2-x*,…,xn-x*}]. 以迭代式计算估计量的值 x* ,缺省情况下自动选择初值. - BiweightLocation[list] 等价于 BiweightLocation[list,6].
- BiweightLocation[{{x1,y1,…},{x2,y2,…},…}] 给出 {BiweightLocation[{x1,x2,…}],BiweightLocation[{y1,y2,…}],…}.
- BiweightLocation 允许 c 为任意正实数.
- 可以给出下列选项:
-
AccuracyGoal Automatic 寻求的准确度 MaxIterations Automatic 使用的最大迭代次数 Method Automatic 使用的方法 PrecisionGoal Automatic 寻求的精度 WorkingPrecision MachinePrecision 内部计算中使用的精度 - 设置 Method{"InitialPoint"x0} 允许自定义初值
.
范例
打开所有单元 关闭所有单元基本范例 (4)
列表的 BiweightLocation:
BiweightLocation[{6.5, 3.8, 6.6, 5.7, 6.0, 6.4, 5.3}]矩阵的列的 BiweightLocation:
BiweightLocation[{{1., 2.}, {4., 8.}, {5., 3.}, {2., 15.}}]缩放参数为 7 时列表的 BiweightLocation :
BiweightLocation[{1., 2., 3., 2., 1.}, 7]日期列表的 BiweightLocation:
RandomDate[4]BiweightLocation[%]范围 (8)
BiweightLocation[N[{1, 2, 3, 4, 9, 10}]]BiweightLocation[N[{1, 2, 3, 4, 9, 10}, 20]]BiweightLocation[{1.2, 3.8, 4.2, -0.5, -5.2}, 10]BiweightLocation[{1.2, 3.8, 4.2, -0.5, -5.2}, 100]BiweightLocation[RandomReal[1, {50, 3}]]BiweightLocation[RandomReal[1, 10 ^ 6]]BiweightLocation[RandomReal[1, {10 ^ 6, 3}]]求 TimeSeries 的双权位置:
ts = TemporalData[TimeSeries, {{{3, 8, 4, 11, 9, 2}}, {{{1, 3, 5, 7, 8, 10}}}, 1, {"Continuous", 1},
{"Discrete", 1}, 1, {ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, False,
10.1];BiweightLocation[ts]BiweightLocation[ts["Values"]]data = Quantity[RandomReal[1, 6], "Meters"]BiweightLocation[data]dates = WolframLanguageData[All, "DateIntroduced"];DateHistogram[dates]BiweightLocation[dates]RandomTime[3]BiweightLocation[%]{TimeObject[{12}, TimeZone -> 0], TimeObject[{12}, TimeZone -> 2], TimeObject[{12}, TimeZone -> "Asia/Tokyo"]}BiweightLocation[%]选项 (2)
MaxIterations (1)
BiweightLocation 的值是迭代式算出的. 限制计算时迭代的次数:
BiweightLocation[{1.2, -3., 4.1, 2.9, 6., -2.}, MaxIterations -> 5]BiweightLocation[{1.2, -3., 4.1, 2.9, 6., -2.}, MaxIterations -> 10]Method (1)
调整 BiweightLocation 计算中的初值:
BiweightLocation[{1.2, -3., 4.1, 2.9, 6., -2.}, Method -> {"InitialPoint" -> 1.5}]BiweightLocation[{1.2, -3., 4.1, 2.9, 6., -2.}, Method -> {"InitialPoint" -> 1.56702}, MaxIterations -> 5]BiweightLocation[{1.2, -3., 4.1, 2.9, 6., -2.}, MaxIterations -> 5]应用 (3)
BiweightLocation[{1, 5, 2, 6, 10, 10 ^ 5, 5, 4, -200, 5}, .1]//N极值对 Mean 的影响较大:
Mean[{1, 5, 2, 6, 10, 10 ^ 5, 5, 4, -200, 5}]//Ndist = MixtureDistribution[{0.98, 0.02}, {BinormalDistribution[0], BinormalDistribution[{0, 0}, {1000, 1000}, 0.5]}];
BlockRandom[SeedRandom[1];
data = RandomVariate[dist, 10 ^ 3];]Histogram3D[data, PlotTheme -> "Detailed"]用 Mean 估计中心:
Mean[data]对于非高斯分布数据,样本均值估计量有较大的展布 (spread). 估计量的标准偏差为:
StandardDeviation[dist] / Sqrt[Length[data]]用 BiweightLocation 来估计中心:
BiweightLocation[data]StandardDeviation[res = Table[BiweightLocation[RandomChoice[data, 10 ^ 3]], {10 ^ 3}]]n[] := RandomVariate[CauchyDistribution[0, 1.2]]
f[] := {u Cos[u] + n[], u Sin[u] + n[]};
data = Table[f[], {u, 0, 6π, 1 / 100}];{ParametricPlot[{u Cos[u], u Sin[u]}, {u, 0, 6π}], pd = ListPlot[data, AspectRatio -> 1]}用移动 BiweightLocation 平滑轨迹:
td = TimeSeries[data, {0., 6π}, ValueDimensions -> 2];smooth[r_] := MovingMap[BiweightLocation, td, {Quantity[r, "Events"], Center}]Quiet@Table[ParametricPlot[Evaluate[smooth[r]["PathFunction"][t]], {t, 0, 6π}], {r, {25, 50, 100}}]属性和关系 (3)
data = {-1000, 3, 10, 20, 1, -3, 5, 0, 6, 1000};x0 = BiweightLocation[data]区间
之外的值对统计量没有影响. 这里
是双权位置的值,
是关于
的绝对中位差.
是缩放参数,默认值为 6:
δ = Median[Abs[data - x0]]Plot[Max[1 - ((x - x0) / (6 δ)) ^ 2, 0] ^ 2, {x, -60, 70}]data[[{1, -1}]] *= 2;nx0 = BiweightLocation[data]x0 == nx0对于正态分布的样本,BiweightLocation 和 Mean 几乎相等:
data1 = RandomVariate[NormalDistribution[1, 2], 10 ^ 5];Mean[data1]BiweightLocation[data1]对于非正态分布的样本,如来自 CauchyDistribution 的数据,BiweightLocation 给出的中心位置的估计比 Mean 给出的要更好:
data2 = RandomVariate[CauchyDistribution[1, 2], 10 ^ 5];Mean[data2]BiweightLocation[data2]当 c 取较大值时,BiweightLocation 接近 Mean:
data = RandomReal[StudentTDistribution[1], 1000];mean = Mean[data]Plot[{BiweightLocation[data, c], mean}, {c, 5, 5 10 ^ 3}, AxesLabel -> {c}, PlotRange -> All, PlotLegends -> {"biweight location", "mean"}]巧妙范例 (2)
data = RandomVariate[SkewNormalDistribution[1, .2, 2], 30];
cvals = {1 / 10, 1 / 2, 1, 3, 4, 5, 6, 8};
m = Mean[data];
loc = Table[{BiweightLocation[data, c]}, {c, cvals}];legend = PointLegend[Join[{"data"}, Row[{"c = ", #}]& /@ cvals], LegendLayout -> {"ReversedRow", 5}];NumberLinePlot[Join[{data}, loc], Epilog -> Line[{{m, 0}, {m, 9.5}}], Ticks -> {{{m, "Mean"}}, None}, PlotLegends -> legend]Manipulate[
SeedRandom[12];data = Join[RandomPoint[Disk[{0, 0}, 1], 40], {{-2, .1}, {-1.6, -.1}, {-1.5, -.3}}];Legended[Graphics[{GrayLevel[.5], PointSize[.015], Point[data], Green, PointSize[.025], Point[Mean[data]], Red, PointSize[.025], Point[BiweightLocation[data, c]]}, ImageSize -> 300], PointLegend[{Green, Red}, {"Mean", "Biweight Location"}]], {{c, 1}, .01, 20}, SaveDefinitions -> True]文本
Wolfram Research (2017),BiweightLocation,Wolfram 语言函数,https://reference.wolfram.com/language/ref/BiweightLocation.html (更新于 2024 年).
CMS
Wolfram 语言. 2017. "BiweightLocation." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2024. https://reference.wolfram.com/language/ref/BiweightLocation.html.
APA
Wolfram 语言. (2017). BiweightLocation. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/BiweightLocation.html 年
BibTeX
@misc{reference.wolfram_2026_biweightlocation, author="Wolfram Research", title="{BiweightLocation}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/BiweightLocation.html}", note=[Accessed: 18-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_biweightlocation, organization={Wolfram Research}, title={BiweightLocation}, year={2024}, url={https://reference.wolfram.com/language/ref/BiweightLocation.html}, note=[Accessed: 18-August-2026]}