|
2170 | 2170 | "metadata": {}, |
2171 | 2171 | "source": [ |
2172 | 2172 | "`logit_solve` is a globally-convergent method, in that it computes a sequence of profiles which is guaranteed to have a subsequence that converges to a\n", |
2173 | | - "Nash equilibrium.\n", |
| 2173 | + "Nash equilibrium. \n", |
2174 | 2174 | "\n", |
2175 | | - "The default value of `maxregret` for this method is set at $10^{-8}$:" |
| 2175 | + "The default value of `maxregret` for this method is set at `1e-8`:" |
2176 | 2176 | ] |
2177 | 2177 | }, |
2178 | 2178 | { |
2179 | 2179 | "cell_type": "code", |
2180 | | - "execution_count": 54, |
| 2180 | + "execution_count": 53, |
2181 | 2181 | "id": "101598c6", |
2182 | 2182 | "metadata": {}, |
2183 | 2183 | "outputs": [ |
|
2187 | 2187 | "1" |
2188 | 2188 | ] |
2189 | 2189 | }, |
2190 | | - "execution_count": 54, |
| 2190 | + "execution_count": 53, |
2191 | 2191 | "metadata": {}, |
2192 | 2192 | "output_type": "execute_result" |
2193 | 2193 | } |
2194 | 2194 | ], |
2195 | 2195 | "source": [ |
2196 | | - "logit_solve_result = gbt.nash.logit_solve(g, use_strategic=True, maxregret=1e-8)\n", |
| 2196 | + "logit_solve_result = gbt.nash.logit_solve(g, maxregret=1e-8)\n", |
2197 | 2197 | "len(logit_solve_result.equilibria)" |
2198 | 2198 | ] |
2199 | 2199 | }, |
2200 | 2200 | { |
2201 | 2201 | "cell_type": "code", |
2202 | | - "execution_count": 59, |
| 2202 | + "execution_count": 54, |
2203 | 2203 | "id": "9b142728", |
2204 | 2204 | "metadata": {}, |
2205 | 2205 | "outputs": [ |
2206 | 2206 | { |
2207 | 2207 | "data": { |
2208 | 2208 | "text/plain": [ |
2209 | | - "7.997619122512845e-08" |
| 2209 | + "5.0647885885268806e-08" |
2210 | 2210 | ] |
2211 | 2211 | }, |
2212 | | - "execution_count": 59, |
| 2212 | + "execution_count": 54, |
2213 | 2213 | "metadata": {}, |
2214 | 2214 | "output_type": "execute_result" |
2215 | 2215 | } |
|
2230 | 2230 | }, |
2231 | 2231 | { |
2232 | 2232 | "cell_type": "code", |
2233 | | - "execution_count": 60, |
| 2233 | + "execution_count": 55, |
2234 | 2234 | "id": "ff405409", |
2235 | 2235 | "metadata": {}, |
2236 | 2236 | "outputs": [ |
2237 | 2237 | { |
2238 | 2238 | "data": { |
2239 | 2239 | "text/plain": [ |
2240 | | - "9.997023903141056e-09" |
| 2240 | + "6.330985735658601e-09" |
2241 | 2241 | ] |
2242 | 2242 | }, |
2243 | | - "execution_count": 60, |
| 2243 | + "execution_count": 55, |
2244 | 2244 | "metadata": {}, |
2245 | 2245 | "output_type": "execute_result" |
2246 | 2246 | } |
|
2261 | 2261 | }, |
2262 | 2262 | { |
2263 | 2263 | "cell_type": "code", |
2264 | | - "execution_count": 62, |
| 2264 | + "execution_count": 57, |
2265 | 2265 | "id": "31b0143c", |
2266 | 2266 | "metadata": {}, |
2267 | 2267 | "outputs": [ |
2268 | 2268 | { |
2269 | 2269 | "data": { |
2270 | 2270 | "text/plain": [ |
2271 | | - "9.434077820902331e-05" |
| 2271 | + "6.566536354296604e-05" |
2272 | 2272 | ] |
2273 | 2273 | }, |
2274 | | - "execution_count": 62, |
| 2274 | + "execution_count": 57, |
2275 | 2275 | "metadata": {}, |
2276 | 2276 | "output_type": "execute_result" |
2277 | 2277 | } |
2278 | 2278 | ], |
2279 | 2279 | "source": [ |
2280 | 2280 | "(\n", |
2281 | | - " gbt.nash.logit_solve(g, use_strategic=True, maxregret=1e-4).equilibria[0]\n", |
| 2281 | + " gbt.nash.logit_solve(g, maxregret=1e-4).equilibria[0]\n", |
2282 | 2282 | " .max_regret() / (g.max_payoff - g.min_payoff)\n", |
2283 | 2283 | ")" |
2284 | 2284 | ] |
|
2293 | 2293 | }, |
2294 | 2294 | { |
2295 | 2295 | "cell_type": "code", |
2296 | | - "execution_count": 63, |
| 2296 | + "execution_count": 58, |
2297 | 2297 | "id": "7cfba34a", |
2298 | 2298 | "metadata": {}, |
2299 | 2299 | "outputs": [ |
2300 | 2300 | { |
2301 | 2301 | "name": "stdout", |
2302 | 2302 | "output_type": "stream", |
2303 | 2303 | "text": [ |
2304 | | - "CPU times: user 180 ms, sys: 2.62 ms, total: 183 ms\n", |
2305 | | - "Wall time: 183 ms\n" |
| 2304 | + "CPU times: user 15.8 ms, sys: 429 μs, total: 16.3 ms\n", |
| 2305 | + "Wall time: 16.3 ms\n" |
2306 | 2306 | ] |
2307 | 2307 | }, |
2308 | 2308 | { |
2309 | 2309 | "data": { |
2310 | 2310 | "text/plain": [ |
2311 | | - "NashComputationResult(method='logit', rational=False, use_strategic=True, equilibria=[[[0.3340897594396454, 0.6659102406666876, 0.0, 0.0], [0.667415735361018, 0.3325842647395834]]], parameters={'first_step': 0.03, 'max_accel': 1.1})" |
| 2311 | + "NashComputationResult(method='logit', rational=False, use_strategic=False, equilibria=[[[[1.0, 0.0], [0.333859274697877, 0.6661407253531737]], [[0.6670586236711866, 0.3329413763565089]]]], parameters={'first_step': 0.03, 'max_accel': 1.1})" |
2312 | 2312 | ] |
2313 | 2313 | }, |
2314 | | - "execution_count": 63, |
| 2314 | + "execution_count": 58, |
2315 | 2315 | "metadata": {}, |
2316 | 2316 | "output_type": "execute_result" |
2317 | 2317 | } |
2318 | 2318 | ], |
2319 | 2319 | "source": [ |
2320 | 2320 | "%%time\n", |
2321 | | - "gbt.nash.logit_solve(g, use_strategic=True, maxregret=1e-4)" |
| 2321 | + "gbt.nash.logit_solve(g, maxregret=1e-4)" |
2322 | 2322 | ] |
2323 | 2323 | }, |
2324 | 2324 | { |
2325 | 2325 | "cell_type": "code", |
2326 | | - "execution_count": 64, |
| 2326 | + "execution_count": 59, |
2327 | 2327 | "id": "6f1809a7", |
2328 | 2328 | "metadata": {}, |
2329 | 2329 | "outputs": [ |
2330 | 2330 | { |
2331 | 2331 | "name": "stdout", |
2332 | 2332 | "output_type": "stream", |
2333 | 2333 | "text": [ |
2334 | | - "CPU times: user 306 ms, sys: 3.42 ms, total: 310 ms\n", |
2335 | | - "Wall time: 309 ms\n" |
| 2334 | + "CPU times: user 28.7 ms, sys: 883 μs, total: 29.6 ms\n", |
| 2335 | + "Wall time: 29.7 ms\n" |
2336 | 2336 | ] |
2337 | 2337 | }, |
2338 | 2338 | { |
2339 | 2339 | "data": { |
2340 | 2340 | "text/plain": [ |
2341 | | - "NashComputationResult(method='logit', rational=False, use_strategic=True, equilibria=[[[0.33333341330954375, 0.6666665866904562, 0.0, 0.0], [0.6666667466427941, 0.3333332533572059]]], parameters={'first_step': 0.03, 'max_accel': 1.1})" |
| 2341 | + "NashComputationResult(method='logit', rational=False, use_strategic=False, equilibria=[[[[1.0, 0.0], [0.3333333839812253, 0.6666666160187746]], [[0.6666667046525624, 0.33333329534743755]]]], parameters={'first_step': 0.03, 'max_accel': 1.1})" |
2342 | 2342 | ] |
2343 | 2343 | }, |
2344 | | - "execution_count": 64, |
| 2344 | + "execution_count": 59, |
2345 | 2345 | "metadata": {}, |
2346 | 2346 | "output_type": "execute_result" |
2347 | 2347 | } |
2348 | 2348 | ], |
2349 | 2349 | "source": [ |
2350 | 2350 | "%%time\n", |
2351 | | - "gbt.nash.logit_solve(g, use_strategic=True, maxregret=1e-8)" |
| 2351 | + "gbt.nash.logit_solve(g, maxregret=1e-8)" |
2352 | 2352 | ] |
2353 | 2353 | }, |
2354 | 2354 | { |
|
2363 | 2363 | }, |
2364 | 2364 | { |
2365 | 2365 | "cell_type": "code", |
2366 | | - "execution_count": 80, |
| 2366 | + "execution_count": 60, |
2367 | 2367 | "id": "5998d609-8037-4814-ac78-1f5a288f4bdd", |
2368 | 2368 | "metadata": {}, |
2369 | 2369 | "outputs": [ |
|
2373 | 2373 | "0.03211100728219732" |
2374 | 2374 | ] |
2375 | 2375 | }, |
2376 | | - "execution_count": 80, |
| 2376 | + "execution_count": 60, |
2377 | 2377 | "metadata": {}, |
2378 | 2378 | "output_type": "execute_result" |
2379 | 2379 | } |
|
2395 | 2395 | }, |
2396 | 2396 | { |
2397 | 2397 | "cell_type": "code", |
2398 | | - "execution_count": 83, |
| 2398 | + "execution_count": 61, |
2399 | 2399 | "id": "a892dc2b", |
2400 | 2400 | "metadata": {}, |
2401 | 2401 | "outputs": [ |
|
2405 | 2405 | "0.03211100728219732" |
2406 | 2406 | ] |
2407 | 2407 | }, |
2408 | | - "execution_count": 83, |
| 2408 | + "execution_count": 61, |
2409 | 2409 | "metadata": {}, |
2410 | 2410 | "output_type": "execute_result" |
2411 | 2411 | } |
|
0 commit comments