\begin{algorithm}
\caption{Multiplication of indicator matrix of vector $x$ with arbitrary vector $v$}
\label{alg:ind-mat-mult}
\begin{algorithmic}[1]
\Require $n,p\in\mathbb N, \omega \in [0,1], x\in\mathbb R^n, v \in\mathbb R^{n}$.
\State Find a sorting permutation $\sigma$ of vector $x$.
\State Apply the $\sigma$ to $x$ and $v$, in place.
\For{$\tilde \omega = 1,0$}
\If{$\tilde \omega = 0$}
    \Comment{Shift $v$ by one place because of 0s on diagonal of $\mathbf I$}.
    \For{$i = n,n-1,...,2$}
        \State $v_{i} \gets v_{i-1}$
    \EndFor
    \State $v_{1} \gets 0$
\EndIf
\State Identify the set of groups $G$ of elements of $v$ corresponding to equal entries in $x$.
\State $\tilde v \gets v$
\For{$g$ in $G$}
    \State Calculate sum $\mathbf s$ of $v$'s elements in group $g$.
    \State Set $0$ in all $\tilde v$'s elements in group $g$.
    \If{$\tilde \omega = 0$}
        \State Set the $\tilde v$'s first element in group $g$ to $\mathbf s$.
    \Else 
        \State Set the $\tilde v$'s last element in group $g$ to $\mathbf s$.
    \EndIf
\EndFor
\State $c_{\tilde \omega} \gets$ cumulative sum of $\tilde v$
\EndFor
\State $c \gets \omega c_1 + (1-\omega)c_0$ 
\Comment Multiplication and addition element-wise.
\State Find the inverse of $\sigma$.
\State Apply the $\sigma^{-1}$ to $c$.
\State \Return $c$
\end{algorithmic}
\end{algorithm}

\begin{algorithm}
\caption{Multiplication of indicator matrix of vector $x$ with arbitrary vector $v$}
\begin{algorithmic}
[1]
\Require $n,p\in\mathbb N, \omega \in [0,1], x\in\mathbb R^n, v \in\mathbb R^{n}$.
\State Find a sorting permutation $\sigma$ of vector $x$.
\State Apply the $\sigma$ to $x$ and $v$, in place.
\For{$\tilde \omega = 1,0$}
\If{$\tilde \omega = 0$}
\Comment{Shift $v$ by one place because of 0s on diagonal of $\mathbf I$}.
\For{$i = n,n-1,...,2$}
\State $v_{i} \gets v_{i-1}$
\EndFor
\State $v_{1} \gets 0$
\EndIf
\State Identify the set of groups $G$ of elements of $v$ corresponding to equal entries in $x$.
\State $\tilde v \gets v$
\For{$g$ in $G$}
\State Calculate sum $\mathbf s$ of $v$'s elements in group $g$.
\State Set $0$ in all $\tilde v$'s elements in group $g$.
\If{$\tilde \omega = 0$}
\State Set the $\tilde v$'s first element in group $g$ to $\mathbf s$.
\Else
\State Set the $\tilde v$'s last element in group $g$ to $\mathbf s$.
\EndIf
\EndFor
\State $c_{\tilde \omega} \gets$ cumulative sum of $\tilde v$
\EndFor
\State $c \gets \omega c_1 + (1-\omega)c_0$
\Comment Multiplication and addition element-wise.
\State Find the inverse of $\sigma$.
\State Apply the $\sigma^{-1}$ to $c$.
\State \Return $c$
\end{algorithmic}
\end{algorithm}
{
    "title": "csranks: an r package for estimation and inference involving ranks",
    "id": "2401.15205",
    "abstract": "this article introduces the r package csranks for estimation and inference involving ranks. first, we review methods for the construction of confidence sets for ranks, namely marginal and simultaneous confidence sets as well as confidence sets for the identities of the tau-best. second, we review methods for estimation and inference in regressions involving ranks. third, we describe the implementation of these methods in csranks and illustrate their usefulness in two examples: one about the quantification of uncertainty in the pisa ranking of countries and one about the measurement of intergenerational mobility using rank-rank regressions.",
    "categories": "econ.em",
    "doi": "",
    "created": "2024-01-26",
    "updated": "",
    "authors": [
        "denis chetverikov",
        "magne mogstad",
        "pawel morgen",
        "joseph romano",
        "azeem shaikh",
        "daniel wilhelm"
    ],
    "affiliation": [],
    "url": "https://arxiv.org/abs/2401.15205"
}
{
    "ToxicityFilter": {
        "text_to_toxicity_attributes": {
            "jss.bst": {
                "toxicity_score": 0.020960633,
                "severe_toxicity_score": 0.0016307831,
                "identity_attack_score": 0.004236255,
                "insult_score": 0.010818896,
                "profanity_score": 0.020168742,
                "threat_score": 0.0073789097,
                "sexually_explicit_score": 0.016513607,
                "flirtation_score": 0.3519259
            },
            "article.tex": {
                "toxicity_score": 0.013320025,
                "severe_toxicity_score": 0.0012588501,
                "identity_attack_score": 0.0039587705,
                "insult_score": 0.007797878,
                "profanity_score": 0.016479544,
                "threat_score": 0.0076637166,
                "sexually_explicit_score": 0.014036566,
                "flirtation_score": 0.19115013
            },
            "article.bbl": {
                "toxicity_score": 0.011686437,
                "severe_toxicity_score": 0.0011014938,
                "identity_attack_score": 0.0037367835,
                "insult_score": 0.007493876,
                "profanity_score": 0.014464149,
                "threat_score": 0.0074306927,
                "sexually_explicit_score": 0.01102873,
                "flirtation_score": 0.2327938
            },
            "jss.cls": {
                "toxicity_score": 0.013320025,
                "severe_toxicity_score": 0.0011920929,
                "identity_attack_score": 0.00362579,
                "insult_score": 0.00808288,
                "profanity_score": 0.015010698,
                "threat_score": 0.0071070488,
                "sexually_explicit_score": 0.011618502,
                "flirtation_score": 0.41704082
            },
            "Sweave.sty": {
                "toxicity_score": 0.006942749,
                "severe_toxicity_score": 0.0016117096,
                "identity_attack_score": 0.0010498142,
                "insult_score": 0.0062208683,
                "profanity_score": 0.018665737,
                "threat_score": 0.0057865805,
                "sexually_explicit_score": 0.026067909,
                "flirtation_score": 0.31151596
            }
        },
        "reason": null
    }
}
{
    "num_done": {
        "figure": 0,
        "algorithm": 2,
        "plot": 0
    }
}
{
    "NonTrivialRenderingFilter": {
        "white_pixels_ratio": 93.27648368185095,
        "hash": "070fbf3f87873f3f",
        "most_frequent_color_ratio": 93.27648368185095
    }
}