MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / setUsingData

Method setUsingData

JSAT/src/jsat/distributions/Cauchy.java:114–126  ·  view source on GitHub ↗
(Vec data)

Source from the content-addressed store, hash-verified

112 }
113
114 @Override
115 public void setUsingData(Vec data)
116 {
117 data = data.sortedCopy();
118
119 //approximate y by taking | 1st quant - 3rd quantile|
120 int n = data.length();
121 setScale(Math.abs(data.get(n/4) - data.get(3*n/4)));
122
123 //approximate x by taking the median value
124 //Note, technicaly, any value is equaly likely to be the true median of a chachy distribution, so we dont care about the exact median
125 setLocation(data.get(n/2));
126 }
127
128 /**
129 * The Cauchy distribution is unique in that it does not have a mean value (undefined).

Callers

nothing calls this directly

Calls 5

setScaleMethod · 0.95
setLocationMethod · 0.95
sortedCopyMethod · 0.45
lengthMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected