Tracking Extra Quantities

Often, there are quantities in models that we might be interested in viewing the values of, but which are not random variables in the model that are explicitly drawn from a distribution.

As a motivating example, the most natural parameterization for a model might not be the most computationally feasible. Consider the following (efficiently reparametrized) implementation of Neal’s funnel (Neal, 2003):

using Turing
setprogress!(false)

@model function Neal()
    # Raw draws
    y_raw ~ Normal(0, 1)
    x_raw ~ arraydist([Normal(0, 1) for i in 1:9])

    # Transform:
    y = 3 * y_raw
    x = exp.(y ./ 2) .* x_raw
    return nothing
end
[ Info: [Turing]: progress logging is disabled globally
[ Info: [AdvancedVI]: global PROGRESS is set as false
Neal (generic function with 2 methods)

In this case, the random variables exposed in the chain (x_raw, y_raw) are not in a helpful form — what we’re after are the deterministically transformed variables x and y.

There are two ways to track these extra quantities in Turing.jl.

Using := (during inference)

The first way is to use the := operator, which behaves exactly like = except that the values of the variables on its left-hand side are automatically added to the chain returned by the sampler. For example:

@model function Neal_coloneq()
    # Raw draws
    y_raw ~ Normal(0, 1)
    x_raw ~ arraydist([Normal(0, 1) for i in 1:9])

    # Transform:
    y := 3 * y_raw
    x := exp.(y ./ 2) .* x_raw
end

sample(Neal_coloneq(), NUTS(), 1000)
Info: Found initial step size
  ϵ = 1.6
Chains MCMC chain (1000×32×1 Array{Float64, 3}):

Iterations        = 501:1:1500
Number of chains  = 1
Samples per chain = 1000
Wall duration     = 7.39 seconds
Compute duration  = 7.39 seconds
parameters        = y_raw, x_raw[1], x_raw[2], x_raw[3], x_raw[4], x_raw[5], x_raw[6], x_raw[7], x_raw[8], x_raw[9], y, x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9]
internals         = lp, n_steps, is_accept, acceptance_rate, log_density, hamiltonian_energy, hamiltonian_energy_error, max_hamiltonian_energy_error, tree_depth, numerical_error, step_size, nom_step_size

Summary Statistics
  parameters      mean       std      mcse    ess_bulk   ess_tail      rhat       Symbol   Float64   Float64   Float64     Float64    Float64   Float64    ⋯

       y_raw   -0.0011    1.0085    0.0312   1059.1688   675.1286    0.9994    ⋯
    x_raw[1]    0.0277    1.0493    0.0315   1083.0753   646.8862    0.9997    ⋯
    x_raw[2]   -0.0197    0.9998    0.0305   1069.9571   651.3170    1.0015    ⋯
    x_raw[3]   -0.0030    0.9593    0.0296   1070.0943   697.8228    0.9992    ⋯
    x_raw[4]    0.0083    0.9734    0.0278   1239.1111   718.9306    0.9996    ⋯
    x_raw[5]   -0.0298    1.0027    0.0320    997.4436   704.2473    0.9991    ⋯
    x_raw[6]   -0.0324    1.0174    0.0301   1139.9258   727.6337    1.0013    ⋯
    x_raw[7]   -0.0489    0.9673    0.0265   1322.9328   816.4729    0.9996    ⋯
    x_raw[8]   -0.0208    0.9974    0.0297   1131.0573   823.1442    1.0056    ⋯
    x_raw[9]   -0.0391    0.9713    0.0287   1158.9050   771.1059    1.0039    ⋯
           y   -0.0034    3.0255    0.0936   1059.1688   675.1286    0.9994    ⋯
        x[1]    0.1426    9.6239    0.3730   1136.0619   846.7010    0.9997    ⋯
        x[2]    0.6712   12.8849    0.4151    862.5275   788.3718    0.9999    ⋯
        x[3]    0.0495    9.2242    0.3095    873.1345   629.6251    1.0012    ⋯
        x[4]    0.2133    8.8324    0.3047    853.9080   798.3740    0.9993    ⋯
        x[5]   -0.3265    7.2077    0.2839    809.7508   727.6967    1.0010    ⋯
        x[6]    0.1241   10.8396    0.3893    987.9909   692.6692    1.0000    ⋯
      ⋮           ⋮         ⋮         ⋮          ⋮          ⋮          ⋮       ⋱
                                                     1 column and 3 rows omitted

Quantiles
  parameters       2.5%     25.0%     50.0%     75.0%     97.5%
      Symbol    Float64   Float64   Float64   Float64   Float64

       y_raw    -1.9164   -0.7068   -0.0097    0.6975    1.9480
    x_raw[1]    -2.0039   -0.6778    0.0186    0.7358    2.0339
    x_raw[2]    -2.1334   -0.6753    0.0145    0.6082    2.0139
    x_raw[3]    -1.9039   -0.6862    0.0385    0.6783    1.7722
    x_raw[4]    -1.9078   -0.6540   -0.0239    0.6279    2.0536
    x_raw[5]    -1.9582   -0.7042   -0.0180    0.6961    1.9026
    x_raw[6]    -2.0852   -0.7601   -0.0347    0.6225    1.9333
    x_raw[7]    -1.8742   -0.7471   -0.0590    0.6240    1.9230
    x_raw[8]    -1.9101   -0.7378   -0.0256    0.6649    1.8551
    x_raw[9]    -1.9298   -0.7109    0.0030    0.5669    1.8405
           y    -5.7493   -2.1205   -0.0290    2.0924    5.8439
        x[1]   -11.6663   -0.5555    0.0094    0.5438    8.3297
        x[2]    -8.0046   -0.5267    0.0059    0.5292   10.9418
        x[3]    -9.0784   -0.5642    0.0101    0.5909    9.3368
        x[4]    -9.3135   -0.5186   -0.0067    0.5637    9.6274
        x[5]   -11.8928   -0.5995   -0.0079    0.5155    7.4641
        x[6]    -9.3979   -0.7486   -0.0200    0.4549   11.8298
      ⋮           ⋮          ⋮         ⋮         ⋮         ⋮
                                                   3 rows omitted

Using returned (post-inference)

Alternatively, one can specify the extra quantities as part of the model function’s return statement:

@model function Neal_return()
    # Raw draws
    y_raw ~ Normal(0, 1)
    x_raw ~ arraydist([Normal(0, 1) for i in 1:9])

    # Transform and return as a NamedTuple
    y = 3 * y_raw
    x = exp.(y ./ 2) .* x_raw
    return (x=x, y=y)
end

chain = sample(Neal_return(), NUTS(), 1000)
Info: Found initial step size
  ϵ = 1.6
Chains MCMC chain (1000×22×1 Array{Float64, 3}):

Iterations        = 501:1:1500
Number of chains  = 1
Samples per chain = 1000
Wall duration     = 1.47 seconds
Compute duration  = 1.47 seconds
parameters        = y_raw, x_raw[1], x_raw[2], x_raw[3], x_raw[4], x_raw[5], x_raw[6], x_raw[7], x_raw[8], x_raw[9]
internals         = lp, n_steps, is_accept, acceptance_rate, log_density, hamiltonian_energy, hamiltonian_energy_error, max_hamiltonian_energy_error, tree_depth, numerical_error, step_size, nom_step_size

Summary Statistics
  parameters      mean       std      mcse    ess_bulk   ess_tail      rhat       Symbol   Float64   Float64   Float64     Float64    Float64   Float64    ⋯

       y_raw   -0.0314    1.0214    0.0260   1554.7115   765.2233    0.9992    ⋯
    x_raw[1]    0.0310    1.0494    0.0259   1606.1449   849.6924    0.9999    ⋯
    x_raw[2]   -0.0532    1.0136    0.0334    914.5937   578.0779    0.9996    ⋯
    x_raw[3]    0.0112    1.0238    0.0277   1361.8798   827.9727    1.0001    ⋯
    x_raw[4]   -0.0008    1.0353    0.0212   2381.5431   610.4288    0.9998    ⋯
    x_raw[5]   -0.0024    0.9710    0.0231   1756.7101   739.5004    0.9990    ⋯
    x_raw[6]    0.0178    1.0249    0.0249   1715.4361   704.8149    0.9996    ⋯
    x_raw[7]    0.0247    0.9810    0.0243   1638.2614   837.0866    1.0023    ⋯
    x_raw[8]    0.0108    1.0284    0.0265   1530.2551   827.8027    0.9990    ⋯
    x_raw[9]    0.0167    0.9535    0.0238   1595.2733   757.7916    1.0058    ⋯
                                                                1 column omitted

Quantiles
  parameters      2.5%     25.0%     50.0%     75.0%     97.5%
      Symbol   Float64   Float64   Float64   Float64   Float64

       y_raw   -1.9943   -0.7187   -0.0379    0.6503    1.9946
    x_raw[1]   -2.0352   -0.6550    0.0752    0.7328    2.0448
    x_raw[2]   -1.9761   -0.7552   -0.0051    0.6763    1.8877
    x_raw[3]   -2.0254   -0.6751   -0.0056    0.7379    1.9928
    x_raw[4]   -2.0315   -0.6898   -0.0005    0.6863    2.0875
    x_raw[5]   -1.8929   -0.6503   -0.0144    0.6795    1.7765
    x_raw[6]   -1.9859   -0.6697    0.0289    0.6756    1.9666
    x_raw[7]   -1.9669   -0.6273    0.0225    0.6868    1.9062
    x_raw[8]   -1.9944   -0.6376   -0.0218    0.6283    2.0868
    x_raw[9]   -1.8277   -0.6045    0.0060    0.6584    1.8816

The sampled chain does not contain x and y, but we can extract the values using the returned function. Calling this function outputs an array:

nts = returned(Neal_return(), chain)
1000×1 Matrix{@NamedTuple{x::Vector{Float64}, y::Float64}}:
 (x = [0.04744692771436845, -0.45851443320274327, 0.14382789404644714, 0.050796353639982916, -0.01604189221535916, -0.03601735607034193, 0.2836925495331082, -0.05115240856085148, -0.3758664440772203], y = -2.902948114197296)
 (x = [0.4529762099335622, -0.10792639092295046, -0.28666631708917323, 0.11509215888780426, 0.18286060207778929, -0.11941230759689506, 0.5888191855352739, -0.026293908546938888, 0.527487353288145], y = -2.3041499030311217)
 (x = [-0.0671771177621849, 0.2824349961170003, 1.9128785976890863, -0.8836078568184104, 0.535440543135213, 0.26395499928677846, -0.4859697548377684, -0.19664336726531917, -0.34709956999891434], y = -0.7963363080854231)
 (x = [35.754787528185304, 38.74695819141065, 163.9559830122083, 19.288764578348342, 106.26377671224763, -59.058384081815404, -10.455358524010968, -23.770595971276492, -30.61307027855364], y = 7.967358044061264)
 (x = [-0.00949467310256863, 0.004302921376317853, -0.04264737211937775, 0.0034147221822429827, -0.03050083775774441, 0.018220371835359166, -0.001419062399086167, 0.007462076695598586, 0.007115211155173399], y = -8.299270951458189)
 (x = [2.366083934931861, 3.5494752856321528, 129.4003143267283, -28.496989074025972, 74.07036636924258, -47.921642459575516, -1.6221537643054718, -20.0725573185751, -19.921891895038115], y = 7.484996833836472)
 (x = [-0.03432297673194885, 0.05501730405262863, -0.048404420355155894, -0.01367056429147994, 0.04843591691015495, 0.0032056002636622546, 0.16091387044361477, 0.10200388356211577, 0.12793853616597692], y = -4.7951602001504785)
 (x = [-0.019361138777790828, 0.0023264831019050155, 0.07056344734188938, -0.14792884512353638, 0.05227541554009483, 0.1873933042904888, 0.31543597520618033, 0.11492281571690338, 0.03120850054963122], y = -3.8437205880512417)
 (x = [-0.18386942211501267, -0.029526377139441257, -0.03205113353426216, -0.602633761063316, -0.5685806462533745, 0.10027930589488547, 0.4490762930140567, -0.011227297315620895, -0.7191176794096175], y = -1.6209553835560144)
 (x = [0.25237802668698966, 0.15997882400328722, -0.41907408265171564, 3.409061068671384, 3.3293254207060468, -0.6396290662833259, -3.2954542164383875, 0.5455606925365826, 4.134255523097966], y = 1.926472043789116)
 ⋮
 (x = [-3.5361051990903474, -2.5240965813907024, 3.643297772563322, 0.8308569948289378, 4.500403845949386, -0.8515506359384223, -1.1346257323756865, 0.7443861681095426, 5.6175705178202975], y = 2.5608771547734914)
 (x = [-0.1521807980548547, -0.05494978793090587, -0.03313664435451999, 0.08256780392960178, 0.024137838631404448, -0.2739772717996532, -0.01084775531494914, 0.15150997905303784, -0.10769689158477337], y = -4.4260652129870275)
 (x = [13.151908270343935, 14.118213299903237, 7.631298105972046, -1.3689193708654166, 2.168870661655818, 23.296497320792117, 3.393614692529119, -12.405798961925202, 10.629282742811442], y = 4.444088216766657)
 (x = [15.675171072173873, 42.313752336602974, -25.853487325026986, -2.172925712647632, -26.7284394209895, 5.526230723912579, 22.243531168366523, 33.3153374464151, 1.9010171317907887], y = 6.686534168021596)
 (x = [0.13207101164825424, 1.714430644541867, -0.3550952190910604, 1.0677982920883358, -1.4125463291492046, -3.0535102037655912, -1.2708943677274154, 1.1861861839455536, -1.8933160572714804], y = 1.585971121561448)
 (x = [0.2917649338538276, -0.19189704248338552, 0.10675684768327257, 0.30195557801627565, -0.06667590073959516, 0.17556688478353819, -0.16513316973201142, 0.07809269505681585, 0.2224169882112763], y = -2.9319999170692865)
 (x = [-0.1566233436355352, 0.36817354202533936, -1.1659181422438805, -0.6608749422690363, 0.6443327710062392, 1.5979906499270051, 0.45158866661281544, -0.9196682647031839, -0.20161237566244522], y = -0.9993468420521153)
 (x = [0.5469653747323585, 1.723966678849892, 3.127333998563677, 2.407484600188315, -2.510459782277598, -5.752065609807258, -0.1067130584818473, 3.321828135047968, 0.6173794563591505], y = 1.528544993232845)
 (x = [0.045498425040227795, 0.30145456663455894, 0.45306019843083467, -0.1532395832951468, 0.1267388070066968, 0.341897698004906, -0.020818966137137518, 0.05341750514678639, 0.05158655606837676], y = -3.751658594767647)

where each element of which is a NamedTuple, as specified in the return statement of the model.

nts[1]
(x = [0.04744692771436845, -0.45851443320274327, 0.14382789404644714, 0.050796353639982916, -0.01604189221535916, -0.03601735607034193, 0.2836925495331082, -0.05115240856085148, -0.3758664440772203], y = -2.902948114197296)

Which to use?

There are some pros and cons of using returned, as opposed to :=.

Firstly, returned is more flexible, as it allows you to track any type of object; := only works with variables that can be inserted into an MCMCChains.Chains object. (Notice that x is a vector, and in the first case where we used :=, reconstructing the vector value of x can also be rather annoying as the chain stores each individual element of x separately.)

A drawback is that naively using returned can lead to unnecessary computation during inference. This is because during the sampling process, the return values are also calculated (since they are part of the model function), but then thrown away. So, if the extra quantities are expensive to compute, this can be a problem.

To avoid this, you will essentially have to create two different models, one for inference and one for post-inference. The simplest way of doing this is to add a parameter to the model argument:

@model function Neal_coloneq_optional(track::Bool)
    # Raw draws
    y_raw ~ Normal(0, 1)
    x_raw ~ arraydist([Normal(0, 1) for i in 1:9])

    if track
        y = 3 * y_raw
        x = exp.(y ./ 2) .* x_raw
        return (x=x, y=y)
    else
        return nothing
    end
end

chain = sample(Neal_coloneq_optional(false), NUTS(), 1000)
Info: Found initial step size
  ϵ = 1.6125
Chains MCMC chain (1000×22×1 Array{Float64, 3}):

Iterations        = 501:1:1500
Number of chains  = 1
Samples per chain = 1000
Wall duration     = 1.45 seconds
Compute duration  = 1.45 seconds
parameters        = y_raw, x_raw[1], x_raw[2], x_raw[3], x_raw[4], x_raw[5], x_raw[6], x_raw[7], x_raw[8], x_raw[9]
internals         = lp, n_steps, is_accept, acceptance_rate, log_density, hamiltonian_energy, hamiltonian_energy_error, max_hamiltonian_energy_error, tree_depth, numerical_error, step_size, nom_step_size

Summary Statistics
  parameters      mean       std      mcse    ess_bulk   ess_tail      rhat       Symbol   Float64   Float64   Float64     Float64    Float64   Float64    ⋯

       y_raw   -0.0359    1.0002    0.0242   1699.0249   725.7792    1.0005    ⋯
    x_raw[1]   -0.0102    0.9556    0.0287   1112.7246   737.5222    0.9995    ⋯
    x_raw[2]    0.0105    0.9760    0.0273   1267.5447   899.3448    1.0009    ⋯
    x_raw[3]   -0.0470    0.9615    0.0259   1378.5441   698.6595    0.9991    ⋯
    x_raw[4]   -0.0079    1.0787    0.0301   1287.0117   641.3347    0.9991    ⋯
    x_raw[5]    0.0196    1.0119    0.0272   1382.8371   594.4281    1.0255    ⋯
    x_raw[6]    0.0086    0.9450    0.0244   1481.4667   896.5830    0.9994    ⋯
    x_raw[7]    0.0026    0.9286    0.0311    893.5225   660.9640    1.0017    ⋯
    x_raw[8]    0.0246    1.0161    0.0297   1174.2880   819.4055    0.9991    ⋯
    x_raw[9]   -0.0144    0.9467    0.0268   1256.0493   720.1504    1.0004    ⋯
                                                                1 column omitted

Quantiles
  parameters      2.5%     25.0%     50.0%     75.0%     97.5%
      Symbol   Float64   Float64   Float64   Float64   Float64

       y_raw   -1.9673   -0.7273   -0.0586    0.6214    1.9637
    x_raw[1]   -1.8620   -0.6144   -0.0076    0.5919    1.7814
    x_raw[2]   -1.8484   -0.6543    0.0085    0.6806    1.9193
    x_raw[3]   -1.8680   -0.6979   -0.0500    0.5758    1.8387
    x_raw[4]   -2.0728   -0.7233    0.0052    0.7067    2.0670
    x_raw[5]   -1.9176   -0.6430   -0.0170    0.7200    1.8995
    x_raw[6]   -1.7759   -0.6304   -0.0013    0.6351    1.8631
    x_raw[7]   -1.7693   -0.6467   -0.0239    0.6306    1.8111
    x_raw[8]   -1.9932   -0.6575    0.0495    0.6698    1.9238
    x_raw[9]   -1.7732   -0.6162   -0.0644    0.6218    1.8690

The above ensures that x and y are not calculated during inference, but allows us to still use returned to extract them:

returned(Neal_coloneq_optional(true), chain)
1000×1 Matrix{@NamedTuple{x::Vector{Float64}, y::Float64}}:
 (x = [0.0157164545285189, 0.39831004639101086, 0.46639038579657466, 0.2510641947951643, 0.06618348124073188, -0.32636174900685333, -0.012782703252365439, -0.17611117767788328, -0.2275470425107444], y = -2.4922979920106725)
 (x = [-0.9361710946100162, -0.3774617828710484, 1.792691082126407, -0.7180785684675738, 3.7243293224254472, -8.144734272527666, 6.052379858854316, 6.171793001684965, 3.1252882120250702], y = 2.679982612994152)
 (x = [3.3223758092389186, -1.2273533647094508, -1.939828900047278, -1.1775500950956692, -4.259269520291236, -0.29713710135572485, -1.9067890950155146, 0.036300171025146946, 2.1268614114028406], y = 1.3303857958429928)
 (x = [-1.3861862080315235, 0.6017722718662473, 1.6202889394897146, 0.475470091922656, 1.1984978773466433, -0.2339569031032838, 1.284740621602036, 0.5468622365348635, 0.132736113775791], y = -0.2126993337279317)
 (x = [11.457101258325864, -25.0305552226531, 1.5712737272086692, -23.0457502590294, -22.856272607921685, 12.3812671089863, -4.998465995665847, 7.758949562590999, -0.4698442945165273], y = 6.06771137514559)
 (x = [-0.057769279409300975, 0.14281093698663286, -0.09383882012971814, -0.005280796057086271, 0.0629415150203574, -0.08159906151929185, 0.08259446684675312, -0.13856399385891657, -0.0053975007918521285], y = -4.495641226266375)
 (x = [0.10506749564079298, 0.10841488893121151, 0.02917337241616456, 0.022037795702865345, 0.08557165523138055, 0.2336318115421718, -0.16877579155343986, 0.1787737955001506, -0.055257336149400205], y = -4.713992038502026)
 (x = [18.878225772854663, 9.468630012836515, 3.2231861387906697, 16.466120198589444, 6.362088105816586, 8.68291001433275, -6.516174136366947, 0.7155758347539134, -7.039375245235644], y = 4.8555668733572075)
 (x = [1.5662068431872362, 2.0563375281861327, -1.8526009535854941, 1.2935205463646149, 0.6977921013432645, -0.6452673107288692, 1.1187426465682964, 0.22256153309276266, 0.30348837784315785], y = 0.8139695888461078)
 (x = [-3.543689563442229, -5.376251089692011, 1.265310426814283, -1.9975975752750204, -1.3620780974050395, -1.868405053101633, -2.3438349766882722, -1.823893677340092, 1.9594033034305942], y = 2.4964588915152723)
 ⋮
 (x = [1.7577070589138861, 2.301931422573925, 1.006479851403743, 2.195413235145916, 2.1689284110828515, 0.7771670873730794, 1.1529484513245776, -0.6155862264057553, -1.8992176910140348], y = 0.73056980463386)
 (x = [0.9455186977365122, 0.3399775976857134, 8.686327272949331, 4.406449239104679, 4.473961634503682, 1.192710451787653, 4.086557105509042, 4.20403784892351, 1.0000428699402715], y = 3.264861867411105)
 (x = [-1.0260777636165916, 3.8035953581291992, 0.7107187199982089, -0.8020804019223712, -0.6515091850896647, 0.14714381530506002, 1.044202655172663, -0.8242944183303402, -2.24075865231319], y = 1.1257507935673061)
 (x = [0.1331289775597031, -0.17353009888954854, -0.00229373642390629, 0.032656399988837514, 0.108024061915087, 0.05013496378226615, -0.024288603882630856, 0.12906915744321218, 0.13939018791677094], y = -3.9819910834426278)
 (x = [-0.5042901564773221, 0.7152839766578253, -0.15137142393897476, 0.5247257906924653, 0.08301050811085123, -0.41304898270670165, -0.7413691337766887, -0.4942131013820066, -0.596428630125347], y = -1.1763740736316575)
 (x = [-0.0225111544463566, 0.07865938178659516, 0.22255195780826065, -0.06362427455187324, -0.19970741290447636, -0.7522468704058053, -0.013856140436439934, -0.29380526017958236, 0.28952768967233133], y = -1.8807673341453854)
 (x = [-0.07497711212324157, 0.19115045239977257, -1.012539090917707, 0.1747920741749144, 1.1494998208845084, 3.4477871514389404, 0.9458941795943159, 0.19663465974817107, -0.9980934076069546], y = 1.1788991223952852)
 (x = [0.20037646299035292, -0.03388640888605102, 0.4957195830777443, -0.13546032147587503, -0.9930177263790022, -1.6770876068143772, -0.1983522403967863, 0.16942350878350262, 0.26462556686367394], y = -0.19164555484771162)
 (x = [-0.7985287729807986, -0.12210820050253822, -0.7373703747727904, 0.7245785230045552, 1.0171463667885203, 2.7956004321248895, 0.9827137649040175, -0.045927927228346, -0.6002943329064198], y = 0.6645230070620106)

Another equivalent option is to use a submodel:

@model function Neal()
    y_raw ~ Normal(0, 1)
    x_raw ~ arraydist([Normal(0, 1) for i in 1:9])
    return (x_raw=x_raw, y_raw=y_raw)
end

chain = sample(Neal(), NUTS(), 1000)

@model function Neal_with_extras()
    neal ~ to_submodel(Neal(), false)
    y = 3 * neal.y_raw
    x = exp.(y ./ 2) .* neal.x_raw
    return (x=x, y=y)
end

returned(Neal_with_extras(), chain)
Info: Found initial step size
  ϵ = 1.6
1000×1 Matrix{@NamedTuple{x::Vector{Float64}, y::Float64}}:
 (x = [-0.20737749177222806, -0.009012669440146004, 0.003558675119926121, -0.12003911687998689, -0.4222128319520382, 0.3341132294325166, -0.7681773287942062, -0.2622734736268753, 0.5977301210669926], y = -2.299362667155445)
 (x = [0.06203519965866407, 0.21924239182739524, -0.11276174644076124, -0.1567795797999979, 0.06228366674629425, -0.270152385916453, 0.16495757277971804, -0.2633148150309606, -0.2388193539529575], y = -2.579906387173144)
 (x = [-0.12145817076200138, -0.8380322536440648, 0.21044017794850323, -0.17064048585287891, -0.11781123592280343, 0.3756107272062751, -0.394702794174771, 0.8265765920270373, 0.4657030714999712], y = -1.244234134893813)
 (x = [10.344540531617934, 7.493571297744813, -10.941384852124846, -4.216913486320697, 2.4653579026359824, -2.5625260311908447, 7.357872164233494, 4.762891469543171, -20.216621919915003], y = 4.6931796532580226)
 (x = [1.3560838473910972, -1.477812762206661, 0.4064816064630806, 0.39447894052974913, 0.29671766560687496, -0.25803351116966594, 0.24095541516283733, -1.01216763640057, -0.7715886473365264], y = -0.5929233055963021)
 (x = [0.01609322199313431, -0.007590714470005034, -0.011479523731502256, -0.0650894808149909, -0.05087942172708936, 0.028730916007735353, -0.12815687950078306, 0.02468065852035853, 0.3025125215234101], y = -3.7191232963824645)
 (x = [-0.34888653293873706, -0.5547120697802762, 0.04609237040560419, -0.24506830100415816, -0.32929656728967577, 0.042253576036660065, -0.3837251527966317, 0.23379087147728025, 0.25100646001509475], y = -1.2931980792500188)
 (x = [1.3251440188815158, 1.227594378256953, -0.005219257650774062, -0.3653348911044485, 1.229191672458857, -1.094202878862184, 1.0296764749889646, -0.37495764053050423, -0.9915996057106287], y = 1.453415789073392)
 (x = [-0.1467763169171036, -0.18429637255360615, -0.015196254998101552, 0.028041878402619614, -0.13498653711312428, 0.09654070769595265, -0.07792112718311518, 0.07490954611203826, 0.10968420781491552], y = -2.954806728657555)
 (x = [1.204817778964196, 2.2958152702029424, 0.20220191046470648, -0.42908490959237094, 1.0679994129514434, -1.3202873512276083, 0.9125536768219898, -0.6037125582798998, -0.8599042325049945], y = 1.1703059903672477)
 ⋮
 (x = [0.21840744995437705, 0.1133211731494831, -0.037856810748752266, 0.10368207798475264, -0.3768172325288869, -0.09663294756007863, 0.14489601223399254, 0.1848523170012825, -0.42949045932738683], y = -2.2800562056161775)
 (x = [0.14837056805652044, 0.08766820118358594, 0.6174929339101586, 0.013053651283424157, 0.24493423193063338, -0.3355955101809869, 0.1744820776919422, -0.6279434459031821, 0.5081204373352598], y = -2.1375987900655042)
 (x = [-0.011703506039802913, 1.0463350851850832, 0.031034540499735745, 0.06333160643609032, 0.05335754008697385, -0.914725226336834, -1.625090836492419, -0.331239068112642, 1.742124106355163], y = 0.8773337164296735)
 (x = [0.7633581634466698, -1.1933780764509216, -0.06858119631929747, 0.21782665083276304, 1.2600994213569057, 0.6012710894336595, -0.5298394314514638, -0.2096320272874348, 0.21070085776088632], y = -0.40638958927319935)
 (x = [-0.6323831812183557, 0.9399607582342052, 0.11798630718130133, -0.34928020413357164, -1.0829885495907416, -0.21924038045508354, 0.35458358343195157, -0.05199002262142428, -0.18242682559351497], y = -0.7100248872207716)
 (x = [3.100237159062643, -6.219161711356086, -0.6565427618651108, 1.741065745949994, 5.656856121942988, -1.5238543339141921, -1.6387544057796928, -1.5443692938965092, 0.9488739763442693], y = 2.605151143335234)
 (x = [0.8559098189887173, -0.08530589619697322, 0.4230149284341709, 0.040957100824779144, -0.8027086924810829, 0.9145706222124762, -0.5751944601900014, 0.15390271204523173, -2.0346423699901757], y = -0.40625403340287125)
 (x = [-0.0023943903361818043, -0.014494338149014534, -0.02212947847246423, 0.00546382700028695, -0.015967039566207205, 0.004434925377857971, 0.0025408760070273744, -0.008520180878554827, 0.03603068935075573], y = -8.326242577232005)
 (x = [0.41642797509873053, 0.8006637212211511, 3.147336525137259, -0.5009139107378985, -0.7898041260403968, -1.3126993445344624, 0.7785695593830714, 0.22472816496775314, -0.9805927043409369], y = -0.02506901178439369)

Note that for the returned call to work, the Neal_with_extras() model must have the same variable names as stored in chain. This means the submodel Neal() must not be prefixed, i.e. to_submodel() must be passed a second parameter false.

Back to top