.. index:: single: glicko2_common
.. _glicko2_common/0:

.. rst-class:: right

**category**

``glicko2_common``
==================

Shared internal Glicko-2 numeric helpers for rating updates, volatility search, and scale conversions.

| **Availability:** 
|    ``logtalk_load(ranking_protocols(loader))``

| **Author:** Paulo Moura
| **Version:** 1:0:0
| **Date:** 2026-05-02

| **Compilation flags:**
|    ``static``


| **Uses:**
|    :ref:`avltree <avltree/0>`

| **Remarks:**
|    (none)

| **Inherited public predicates:**
|    (none)

.. contents::
   :local:
   :backlinks: top

Public predicates
-----------------

(no local declarations; see entity ancestors if any)

Protected predicates
--------------------

.. index:: update_item_parameters/10
.. _glicko2_common/0::update_item_parameters/10:

``update_item_parameters/10``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Computes the simultaneous Glicko-2 rating, deviation, and volatility update for one item over a rating period using the current dictionaries and aggregated game results.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``update_item_parameters(Item,ItemResults,Ratings,Deviations,Volatilities,Tau,VolatilityTolerance,UpdatedRating,UpdatedDeviation,UpdatedVolatility)``
| **Mode and number of proofs:**
|    ``update_item_parameters(+term,+list(compound),+compound,+compound,+compound,+number,+number,-number,-number,-number)`` - ``one``


------------

.. index:: to_mu/2
.. _glicko2_common/0::to_mu/2:

``to_mu/2``
^^^^^^^^^^^

Converts a rating on the external Glicko scale to the internal ``mu`` scale.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``to_mu(Rating,Mu)``
| **Mode and number of proofs:**
|    ``to_mu(+number,-number)`` - ``one``


------------

.. index:: to_phi/2
.. _glicko2_common/0::to_phi/2:

``to_phi/2``
^^^^^^^^^^^^

Converts a rating deviation on the external Glicko scale to the internal ``phi`` scale.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``to_phi(Deviation,Phi)``
| **Mode and number of proofs:**
|    ``to_phi(+number,-number)`` - ``one``


------------

.. index:: to_rating/2
.. _glicko2_common/0::to_rating/2:

``to_rating/2``
^^^^^^^^^^^^^^^

Converts a value on the internal ``mu`` scale back to the external Glicko rating scale.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``to_rating(Mu,Rating)``
| **Mode and number of proofs:**
|    ``to_rating(+number,-number)`` - ``one``


------------

.. index:: to_deviation/2
.. _glicko2_common/0::to_deviation/2:

``to_deviation/2``
^^^^^^^^^^^^^^^^^^

Converts a value on the internal ``phi`` scale back to the external Glicko rating-deviation scale.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``to_deviation(Phi,Deviation)``
| **Mode and number of proofs:**
|    ``to_deviation(+number,-number)`` - ``one``


------------

Private predicates
------------------

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

