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
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.18 seconds
Compute duration  = 7.18 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.0015    1.0360    0.0340    928.3943   715.9183    1.0030    ⋯
    x_raw[1]   -0.0156    1.0190    0.0311   1075.6259   743.4487    0.9996    ⋯
    x_raw[2]   -0.0481    1.0264    0.0329    970.5021   715.0619    0.9996    ⋯
    x_raw[3]    0.0370    0.9370    0.0329    816.5805   660.7247    1.0000    ⋯
    x_raw[4]    0.0214    0.9922    0.0293   1153.7583   727.1907    1.0028    ⋯
    x_raw[5]   -0.0085    1.0268    0.0306   1120.6799   710.4374    1.0037    ⋯
    x_raw[6]    0.0160    1.0004    0.0315   1016.3357   676.6102    1.0057    ⋯
    x_raw[7]    0.0563    0.9929    0.0308   1039.2163   697.5749    1.0016    ⋯
    x_raw[8]   -0.0385    0.9998    0.0251   1574.2957   775.1250    1.0001    ⋯
    x_raw[9]    0.0071    1.0576    0.0310   1180.3613   741.2214    1.0009    ⋯
           y    0.0045    3.1080    0.1020    928.3943   715.9183    1.0030    ⋯
        x[1]   -0.1858    7.4642    0.2700    913.6468   575.8689    1.0026    ⋯
        x[2]   -0.2771    6.0672    0.2078    829.1957   695.5584    1.0024    ⋯
        x[3]    0.3110    6.6733    0.2713    725.5614   578.1753    1.0017    ⋯
        x[4]   -0.1975    8.3169    0.2991    935.1529   569.3061    1.0046    ⋯
        x[5]   -0.1917    7.5386    0.2915   1095.3262   766.0505    1.0064    ⋯
        x[6]    0.1698    9.9794    0.3717    750.7037   528.5515    0.9991    ⋯
      ⋮           ⋮         ⋮         ⋮          ⋮          ⋮          ⋮       ⋱
                                                     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    -2.0866   -0.6664    0.0254    0.7137    2.0118
    x_raw[1]    -1.9280   -0.7237   -0.0161    0.6711    2.0307
    x_raw[2]    -2.0642   -0.7507   -0.0276    0.6440    1.8804
    x_raw[3]    -1.7874   -0.5942    0.0418    0.6360    1.8339
    x_raw[4]    -2.0328   -0.5899    0.0279    0.6807    1.8478
    x_raw[5]    -2.0427   -0.6967   -0.0090    0.6838    2.1442
    x_raw[6]    -1.8940   -0.6334    0.0147    0.6975    1.9508
    x_raw[7]    -1.7853   -0.6573    0.0459    0.7634    1.8851
    x_raw[8]    -2.1056   -0.6324   -0.0024    0.5825    2.0411
    x_raw[9]    -2.0487   -0.7674    0.0369    0.7854    1.9960
           y    -6.2597   -1.9992    0.0761    2.1412    6.0353
        x[1]   -11.5640   -0.6950   -0.0024    0.5964   10.0758
        x[2]   -11.4447   -0.6989   -0.0084    0.5657    7.3955
        x[3]    -8.8495   -0.4881    0.0056    0.5801   10.2164
        x[4]   -12.8801   -0.5128    0.0062    0.6495    8.8421
        x[5]   -10.1475   -0.5607   -0.0029    0.6214   10.4340
        x[6]    -9.8774   -0.5791    0.0042    0.6297    9.7205
      ⋮           ⋮          ⋮         ⋮         ⋮         ⋮
                                                   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.55 seconds
Compute duration  = 1.55 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.0560    0.9279    0.0274   1143.5249   906.1256    1.0021    ⋯
    x_raw[1]    0.0410    0.9856    0.0316    983.2954   635.5582    1.0006    ⋯
    x_raw[2]    0.0169    1.0216    0.0315   1043.7839   689.3694    1.0008    ⋯
    x_raw[3]    0.0164    1.0296    0.0279   1369.1057   567.3177    0.9993    ⋯
    x_raw[4]   -0.0069    1.0881    0.0296   1354.0150   623.1724    1.0009    ⋯
    x_raw[5]   -0.0223    1.0000    0.0278   1293.7466   844.5530    1.0029    ⋯
    x_raw[6]    0.0048    1.0042    0.0320   1012.6393   755.7782    1.0021    ⋯
    x_raw[7]    0.0107    1.0870    0.0317   1165.2536   697.8230    1.0016    ⋯
    x_raw[8]    0.0233    1.0357    0.0289   1289.3253   638.1200    1.0014    ⋯
    x_raw[9]   -0.0129    1.0272    0.0265   1503.1898   732.6722    0.9995    ⋯
                                                                1 column omitted

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

       y_raw   -1.8485   -0.7195   -0.0531    0.5902    1.7264
    x_raw[1]   -1.8810   -0.6028    0.0170    0.6804    2.0591
    x_raw[2]   -2.0286   -0.6874   -0.0137    0.7272    2.0145
    x_raw[3]   -1.8003   -0.7610    0.0042    0.7231    2.0435
    x_raw[4]   -2.1780   -0.7619    0.0011    0.7266    2.1967
    x_raw[5]   -1.8806   -0.7514   -0.0139    0.6453    1.9183
    x_raw[6]   -2.1214   -0.6284    0.0185    0.6355    2.0453
    x_raw[7]   -2.1425   -0.7087    0.0112    0.6928    2.2219
    x_raw[8]   -2.0761   -0.6458    0.0244    0.6933    1.9988
    x_raw[9]   -1.9738   -0.6820   -0.0186    0.6375    2.1345

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.2946952197055097, -3.3779197337428664, -2.397789183390378, 1.862102314958096, 1.3228676233190724, -0.04716089971986038, -1.1516982809272363, 1.334979594841792, 1.5927915626926847], y = 1.341459419744947)
 (x = [0.41845127671964394, -0.9795980936783758, 0.6761004141912453, -0.4599004185093764, -0.49977687934053155, -0.107263334979617, 0.6718461433752096, 0.5705384270562057, -0.3646538110271361], y = -1.186856028043621)
 (x = [-0.14555998950207236, -0.49538222597816556, -0.8279465326089688, -2.1149790014028405, 1.4195368137703461, 0.1335316783147538, 1.171679023771097, 0.3591628558207735, 1.1091651976919186], y = -0.08296879749399105)
 (x = [0.17901286749216638, 0.06948061779011015, -0.10625783210299485, -1.0245927708488214, -0.9876651893706759, -1.300821773603692, 1.0848217343363877, 0.36216672720239435, 0.07456543839370351], y = -0.41663897185918836)
 (x = [-0.421312597440741, -0.015796105225457394, -0.4142645592188558, -0.05974529906454538, -0.41047800076966295, -1.0710290947630279, 0.7040361927867278, -0.07126738485756731, -0.10970020165218616], y = -1.9187283211399158)
 (x = [-0.5504297875565539, 0.14919138997910908, 0.49161199940874545, -0.16650645941163872, 0.18033993992358335, -0.21611459111650708, 0.09843788210371585, 0.40278197780455655, 0.19308885703305528], y = -2.5205236164314435)
 (x = [-0.13684212477903684, -0.8348832579175843, -0.8009792767148322, 0.34888263049006446, -0.19183808864160856, 0.12953191138613848, -0.01862386638413258, -0.20728850168842633, -0.9421943818093389], y = -1.759630362402734)
 (x = [0.04070588841094274, 1.0909597675431062, 0.4823168234041814, -0.8379704294471203, 0.054289638491983226, -0.2219176322522517, 0.4111866462576893, 0.1347609236651112, 1.4151164328879087], y = -0.68406125389142)
 (x = [-4.006481109476685, 0.8119543480487391, -4.21778744916855, 2.123356645763006, 0.17226634960461484, 1.4013495566480938, -2.0839411206304796, 0.9935996110930781, -4.4346720115358425], y = 2.449412671843743)
 (x = [-2.1841264404627743, 1.461718413448393, 0.35612997839539406, -1.1009781873600615, -2.4913676553470743, 0.2831822988534233, 6.129965980440526, -1.5849216837894606, -3.7918892470085552], y = 1.8457746205304406)
 ⋮
 (x = [-0.36018689099119233, 0.04036138666814013, 0.03053546137027719, 0.3911261094173362, 0.0753208763640533, -0.024226528909405, 0.27281253590985965, 0.3541727933229626, 0.09035377745297374], y = -3.6279577774241814)
 (x = [1.428722878532661, -0.5716906806331445, -0.7865570669373239, 1.420730061835595, 1.2243662462833897, -0.4633206496531935, 0.28775200801842016, -2.002240416465498, 2.845159714461669], y = 1.4018967493876704)
 (x = [4.762224758973992, -7.187670615677686, 9.836898479544944, 7.2311230532894575, -6.176377425525967, 0.5801746749511261, -13.99101973823183, -4.831085289875491, -3.426582211907917], y = 3.8148190982109194)
 (x = [0.32353206910891597, 0.07086132086496344, -0.5610576910215446, -0.3175267510346207, -0.5637550517837089, 0.7753838233990162, 0.7823415084435241, 0.6372638504689029, 0.35138216020734], y = -1.272811308403595)
 (x = [-0.2470682831003659, -0.2616377211213912, 0.0008466045550072888, 0.24961463817184482, -0.4974961698231027, -0.48921084624928696, -0.607018443320856, -0.29868463327709394, -0.4110815688689498], y = -2.15223058863713)
 (x = [0.012120757386625264, 0.14370540899560083, 0.2824530349084572, -0.1126357301655223, 0.06299125131099553, 0.05046814191608647, -0.035114577140873224, -0.04935175753761738, -0.05582771793118817], y = -4.623929973359647)
 (x = [0.026025302942441632, 0.4272648561100183, 0.19331525698255717, -0.02731253749801223, 0.43615253890632133, -0.3982302925179508, 0.2432014260198594, 0.07197593722181042, 0.4972342984780117], y = -2.8970985057160807)
 (x = [0.2975042192082431, -0.5531590756586556, 0.5883362044815018, 0.4341317509927398, 0.7206377654998695, -0.2411166228530388, 0.009176491330082399, -0.03901354214052327, 0.878935729243194], y = -1.9143877822913584)
 (x = [0.02305847845787559, -0.025351979956314614, -0.01309986591530705, 0.045474305669729445, -0.17161754230656603, -0.35668034826829337, 0.1667038140682279, -0.19795484218142614, 0.11044377719788065], y = -3.5021939573548595)

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

nts[1]
(x = [0.2946952197055097, -3.3779197337428664, -2.397789183390378, 1.862102314958096, 1.3228676233190724, -0.04716089971986038, -1.1516982809272363, 1.334979594841792, 1.5927915626926847], y = 1.341459419744947)

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.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.52 seconds
Compute duration  = 1.52 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.0276    1.0167    0.0264   1442.1859   745.5473    1.0007    ⋯
    x_raw[1]   -0.0250    1.0426    0.0305   1145.5165   686.4026    1.0010    ⋯
    x_raw[2]    0.0348    1.0035    0.0269   1413.1083   762.1596    1.0006    ⋯
    x_raw[3]    0.0400    0.9620    0.0308    980.1283   837.6591    0.9995    ⋯
    x_raw[4]    0.0087    0.9976    0.0277   1311.5916   837.9178    1.0007    ⋯
    x_raw[5]    0.0074    0.9762    0.0302   1065.9949   762.6804    1.0004    ⋯
    x_raw[6]    0.0159    1.0436    0.0317   1081.1215   622.0888    0.9994    ⋯
    x_raw[7]    0.0322    1.0315    0.0265   1533.6330   617.1981    1.0098    ⋯
    x_raw[8]   -0.0034    1.0135    0.0274   1372.1707   781.3492    1.0000    ⋯
    x_raw[9]    0.0091    0.9923    0.0264   1406.3595   873.7012    1.0048    ⋯
                                                                1 column omitted

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

       y_raw   -1.8793   -0.6655    0.0194    0.7173    2.1407
    x_raw[1]   -2.0674   -0.7634   -0.0404    0.6775    1.9456
    x_raw[2]   -1.8911   -0.6174    0.0590    0.6693    2.0666
    x_raw[3]   -1.8234   -0.6070    0.0109    0.6879    1.8708
    x_raw[4]   -1.8368   -0.6827   -0.0068    0.7337    1.8848
    x_raw[5]   -1.8569   -0.6706   -0.0277    0.6957    1.8344
    x_raw[6]   -2.0030   -0.6886   -0.0042    0.6987    2.1082
    x_raw[7]   -1.9219   -0.6641    0.0249    0.6928    2.1276
    x_raw[8]   -2.0481   -0.7289    0.0192    0.7018    1.9856
    x_raw[9]   -1.9654   -0.6534   -0.0145    0.6822    1.9683

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.12055458342397818, -0.8273908381308952, -0.4412232424842429, 0.3471186170663362, -0.21182525554392304, 0.6789494210960619, -0.010561899267357264, -0.1305563846499207, -0.09531294241909048], y = -1.6144555243738492)
 (x = [0.1670540550191727, -0.18588066573568546, -0.1494019926924945, -0.12973405036672944, 0.03761136554175425, -0.02089537000467576, -0.15322219697354109, 0.0781841643374811, -0.08358230115836492], y = -3.1946969001553582)
 (x = [-4.013352712392849, 3.6412179317808695, 3.1333531907654986, 1.6997494736515353, -0.2986656532387041, 2.7578105301596025, 3.311415669061478, 0.24244346553754695, 0.2819317050434106], y = 2.7794415863936694)
 (x = [-4.013352712392849, 3.6412179317808695, 3.1333531907654986, 1.6997494736515353, -0.2986656532387041, 2.7578105301596025, 3.311415669061478, 0.24244346553754695, 0.2819317050434106], y = 2.7794415863936694)
 (x = [-1.0159201672918634, 1.3536069129479367, 1.5661504342770414, 0.6705539307956552, -1.7205777076787625, 0.7632986344376717, -2.183937983453903, 0.9482312647054811, 2.6530193474070796], y = 0.5711012288094789)
 (x = [0.9749118230634183, -0.621669637789982, 1.2147975501379553, 1.278899746951716, 0.9399704231129493, 1.7642112999354163, -2.8140636499336154, -0.1374671048110818, 0.11585619420086109], y = 1.8581625408460898)
 (x = [-0.12926553554434445, 0.09261910000340169, -0.008153938249957632, 0.022835736468623764, 0.11732279524960312, -0.014432933112948326, -0.041837135492987204, -0.016603284158168582, -0.054487095853974606], y = -5.104408967810441)
 (x = [-0.401742754194821, 0.4867058477781569, 0.20924234493685492, 0.11069021877374052, -0.11808365620552759, 0.03355048089075148, -0.48655058798848944, 0.26055195539711934, -0.07406485174321513], y = -3.008297242354453)
 (x = [8.979116202935893, -12.605880303377232, -3.74436636206474, -2.040342827155682, 2.4226808489361504, 0.9104625298478797, 12.704600004617113, -6.7643664501478975, 4.546683475927552], y = 3.5024484103994515)
 (x = [3.3793487739237906, -2.8234596856818355, 1.3346663129921432, -1.5586211739477716, 1.529880613222247, 4.018383389297572, 6.545861165258177, 2.4876673119650827, 2.002198973414043], y = 2.2484475783790745)
 ⋮
 (x = [0.3117115023537381, -1.6059058335469085, -0.08347671196626098, 4.518160627067599, 0.20830248451193978, -3.1869094831542255, 2.730799004290262, -0.1060794798659072, -1.2407444899891655], y = 2.151487963028049)
 (x = [-0.020927995983022644, 0.06826826412029223, -0.006498047701056998, -0.15937377090843002, -0.014863400728334837, 0.1338699858905065, -0.1353059006466713, 0.010269633882856566, 0.10925061316463036], y = -3.9887014127503924)
 (x = [0.01996866399435082, 0.1124421249214707, -0.02932854877524224, -0.21707658556646223, -0.019105516642690563, 0.47074691389039547, 0.5737983186590404, 0.31753431414221805, 0.3483809773576064], y = -3.3872330394689936)
 (x = [0.7946414827307762, -2.0000035534394764, 0.495356058230238, 0.5065059870068519, -0.12552909760433215, -0.48105083236466345, -2.812895188183114, 0.05790658277897669, -0.38585725040068714], y = 0.05331893818684119)
 (x = [2.7974749775792263, 5.0737285121760864, -0.8289926669184617, -3.4949389645900104, 6.942570492910666, -12.126207482027116, 25.220411187126818, -14.75011120239873, -7.007826862134079], y = 4.165787614842571)
 (x = [-0.18916364893997267, -0.058628254204473776, -0.05431550407303276, -0.06276324689719931, 0.09331663979804941, -0.8214658555955673, -0.7447983731865991, -0.804403343331859, -0.10564747990425247], y = -1.1460923274999244)
 (x = [0.3341118838283093, -0.5021228692614559, 0.016169580232580895, 0.4039054615025295, -0.30568329269472877, -0.2313021623694539, -0.48473045475462373, 0.046956797869703214, -0.16896542578643128], y = -2.444972021014926)
 (x = [-22.238165643252604, -7.754612074413142, 8.519017883174557, -9.1800064441169, 10.147191884718064, -5.589729175211915, -0.04237267662407828, -5.102722562383353, 0.04018342124206098], y = 3.9194503488631582)
 (x = [-25.232743979766106, -0.4900903514136757, -4.656602834500699, -10.854448260971031, 4.19288584027096, -10.520749586298258, -11.724729894275018, -20.218449042296278, 2.3222934407152986], y = 4.60123540034232)

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 = [-2.0389818923352143, 11.142511764736977, -4.2659715783086725, -25.17506498819316, -77.41457407752891, -2.942737585813258, 12.001416587136172, 19.769092230832534, 28.386484776835907], y = 7.432873621833988)
 (x = [-0.010581985171463257, -0.002779472169501231, -0.002872585998568362, -0.0012310531798709742, 0.003432339679346382, -0.00161150110739179, 0.01659860367829649, 0.00986840414173701, 0.002509959281562429], y = -9.917286097819886)
 (x = [-0.04103417814042384, -0.008521395933406766, -0.012376479492772008, -0.011708440547837044, -0.027967127747900028, -0.03381987518459939, 0.060715701005457916, -0.03395230668296324, 0.0006747761606019538], y = -6.84685174270859)
 (x = [17.680299244683383, 5.420281075552434, -15.030280941851071, -37.04915440204777, 13.706106140595674, 26.62177913444818, 1.107674895873096, 36.375208008254496, 14.68186106120582], y = 6.0550510231410986)
 (x = [0.1903496857644774, 1.5509763613287033, -1.5622008902438904, 0.6550073706225297, 2.0756843513203824, -1.1044430075194944, -1.3459525562510233, -3.873143969522985, 1.6841127350091558], y = 0.9045889000611489)
 (x = [-0.14022345375406528, -0.0616563065368915, 0.3489022000191813, 0.0174692916538256, -0.3659164317130711, 0.05389825307437369, 0.3162608176566525, 0.8661290438026531, -0.28993193957069247], y = -2.276821317616049)
 (x = [0.5609470757536069, 1.9492394989828437, -2.7202104740196935, -0.39351653756338845, 2.2224457125632275, -0.6640100036637425, -2.480000225437117, -5.551117421497981, 2.010212745332333], y = 1.64456984135833)
 (x = [-9.605338239646812, -10.818889013406974, 4.504071535638875, -3.2922725803913693, -8.196278623540362, -0.5390815276941516, 8.152446614378691, -0.14869528869536594, -9.413328183895867], y = 3.5941819301659166)
 (x = [-0.84832298337916, 3.431815622529586, -0.14170283091058056, 0.08466072165855347, 4.630068799743886, 0.5180446818371506, 4.249775106850963, -8.916717890227071, 0.0892870254476643], y = 2.4429857701099653)
 (x = [-0.5339974989023091, -3.8539113309816178, 0.014447704940290462, -7.061548169319733, -3.4754469328140667, 2.500237533930479, -2.5931842227038504, 0.6435191504266933, 1.6038991732327763], y = 1.532188278591342)
 ⋮
 (x = [-2.7029137949687105, 3.5244673965790048, -1.8115560909332555, -0.0221277653636853, -2.245136599894235, 0.34021615622694457, -1.193852274538008, -0.9495240153411935, 5.120305145107224], y = 1.5087741511822181)
 (x = [0.07250894393970844, 0.06463302716790904, 0.04293744984735572, 0.10157809431559132, -0.03045891231311136, 0.07237678348133156, -0.01838253101877944, 0.010183996428083963, -0.157063228278953], y = -5.092064510730996)
 (x = [-12.961495975967539, -11.638942388449008, -5.052460653012415, -14.717859679868148, 4.363690803269706, -8.966119624554691, 6.34098482458555, -3.3143279724307444, 19.460617722555973], y = 5.00840684038487)
 (x = [-7.90629144202438, -9.50555079709413, -2.346188264921684, -12.243932735083247, -3.534391146362339, -0.5575047661831682, 9.657215733758969, -3.094403003984971, 7.469057195754477], y = 4.0581105716275685)
 (x = [-0.6584433390525957, 0.8371674452046041, 1.877401354840598, 1.400203347035961, -0.015195751852603941, 0.9237879036856387, 1.5505520714871204, 0.09220796072207423, 0.05718140004541178], y = 0.1546476369523877)
 (x = [3.609428830580289, 3.6695431692849487, -2.0572620888055466, -2.648202951825431, -0.7223851894703812, 3.9257615894162123, -1.8090569201948556, 0.08297957589422666, -0.7679363012769933], y = 1.774524309789322)
 (x = [0.11634384426027768, 0.1879510112725725, 0.07963542376527802, -0.044866136804134225, -0.11160455512192605, 0.11859918233332391, 0.04394159887710599, -0.05096865723604381, -0.001050226255468583], y = -4.893736907868678)
 (x = [-0.03406402009574163, -0.019232538074533505, 0.03624866377167384, 0.014698185951644877, -0.20638308897349167, 0.09116902150946214, 0.08156102071655591, 0.013859649666906636, 0.04302884942486474], y = -4.621836890874831)
 (x = [-3.3965500843115652, -9.801341585025213, -6.777267906225978, 3.9498173399109953, 8.200538567899939, -18.007580024954127, 2.1388548855765914, -1.8010862057341264, 8.458724995880848], y = 5.125265764544424)

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