This question is based on my doubt on the application of Lloyd's algorithm in minimizing quantization error when performing scalar quantization to this problem. I have a quantization function to partition /quantize a real valued data. The way I understand the working of Lloyd's algorithm is that it can be used to optimize the error between quantized and unquantized data.
Problem statement : Let a binary valued data $\mathbf{s} = \{1,0,1,1\}$ containing 4 elements is encoded using an encoding function $g()$. So, $s(1) = 1, s(2) =0, s(3) = 1, s(4)=1$.
The output of encoding produces a scalar real valued number, say $x = g_1(\mathbf{s})$.
$g_1(.)$ is the inverse function of $g(.)$. Now, the function $g()$ is an iterative function $x(t) = g(x({t-1}))$. Let $t = 1,2,3,4$ so, there will be 4 values in array $\mathbf{x}$.
In my application, I have a quantizer function $\mathcal{Q}(.)$ defined as
$s(t) = \mathcal{Q}(x(t))$. Now, it is desired that this output be close to the original array vector $\mathbf{s} = \{1,0,1,1\}$.
Objective : The encoding and quantization steps results in some error, and in many papers I have seen that Lloyd's algorithm is applied in Vector Quantization esp. in kmeans clustering.
Where can I apply Lloyd's algorithm in my case?
Please do suggest any other appropriate way that makes more sense. Shall really appreciate insights and corrections in any step of my approach of applying Lloyd's algorithm.