wmed | R Documentation |
wmed computes the weighted median for data vector y and weights w, i.e. it solves the optimization problem:
wmed(y, w, verbose = F, tol = 1e-07, iter_max = 2000)
y |
: (numeric) data given (real or complex) |
w |
: (nubmer) positive real-valued weights. Inputs need to be of same length |
verbose: |
(logical) true of false (default). Set as true if you wish to see convergence as iterations evolve |
tol: |
threshold for iteration in complex case |
iter_max: |
number of iterations in complex case |
beta = arg min_b SUM_i | y_i - b | * w_i
beta: (numeric) weighted median
converged: (logical) flag of convergence (in the complex-valued data case)
iter: (numeric) the number of iterations (complex-valued case)
wmed(1:5, c(1,0,1,2,3)) wmed(1:5 +1i, c(1,0,1,2,3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.