2 % @brief Recursive computation of the normalizing constant
for cache models
4 % @author LINE Development Team
8 % @brief Computes the normalizing constant
for cache models recursively
11 % This function recursively computes the normalizing constant E
for
12 % cache models with given item popularity probabilities and cache capacity.
16 % E = cache_erec(gamma, m)
21 % <tr><th>Name<th>Description
22 % <tr><td>gamma<td>Item popularity probabilities
23 % <tr><td>m<td>Cache capacity
28 % <tr><th>Name<th>Description
29 % <tr><td>E<td>Normalizing constant
32function E=cache_erec(gamma,m)
33E = sub_cache_erec(gamma,m,length(gamma));
36function E=sub_cache_erec(gamma,m,k)
42if sum(m)>k || min(m)<0
52E = sub_cache_erec(gamma,m,k-1);
55 E = E + gamma(k,j)*m(j)*sub_cache_erec(gamma,oner(m,j),k-1);