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.16 seconds
Compute duration  = 7.16 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.0069    1.0455    0.0320   1075.1910   738.9525    1.0004    ⋯
    x_raw[1]   -0.0566    1.0101    0.0306   1090.3985   684.8846    1.0071    ⋯
    x_raw[2]   -0.0038    1.0306    0.0326   1007.4996   587.7488    1.0032    ⋯
    x_raw[3]   -0.0267    0.9731    0.0331    864.2338   725.8769    1.0031    ⋯
    x_raw[4]   -0.0209    1.0162    0.0328    961.1251   758.7415    0.9997    ⋯
    x_raw[5]   -0.0266    1.0263    0.0289   1259.9735   585.5638    0.9994    ⋯
    x_raw[6]   -0.0050    1.0093    0.0278   1319.4673   721.4505    0.9995    ⋯
    x_raw[7]   -0.0032    0.9789    0.0277   1255.0615   660.9260    1.0010    ⋯
    x_raw[8]   -0.0171    0.9933    0.0285   1211.7526   743.4487    1.0004    ⋯
    x_raw[9]   -0.0285    1.0020    0.0263   1467.5170   867.2247    1.0029    ⋯
           y    0.0207    3.1366    0.0959   1075.1910   738.9525    1.0004    ⋯
        x[1]   -0.3660    7.4727    0.2691    929.9996   613.4144    1.0061    ⋯
        x[2]    0.5989    9.7037    0.3703    817.8248   543.2634    0.9993    ⋯
        x[3]    0.2211   11.6589    0.3787    815.4454   643.1786    1.0034    ⋯
        x[4]    0.3372    7.4876    0.3009    728.5687   754.9340    1.0002    ⋯
        x[5]   -0.3825    7.3866    0.2629    979.2986   676.4312    0.9999    ⋯
        x[6]   -0.0612    7.4248    0.2894    935.1156   710.5625    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.0520   -0.6932    0.0128    0.7289    2.0398
    x_raw[1]    -2.0003   -0.7477   -0.0611    0.5712    1.9656
    x_raw[2]    -1.9323   -0.7434   -0.0244    0.6724    2.0584
    x_raw[3]    -1.9080   -0.6912   -0.0502    0.6323    1.8275
    x_raw[4]    -1.9564   -0.6974   -0.0102    0.6767    1.8998
    x_raw[5]    -2.0604   -0.7383   -0.0219    0.6784    2.0326
    x_raw[6]    -1.9147   -0.6992    0.0127    0.6308    2.1392
    x_raw[7]    -1.9410   -0.6592    0.0215    0.6374    1.9583
    x_raw[8]    -1.9525   -0.6608   -0.0214    0.6462    1.9352
    x_raw[9]    -1.9897   -0.6665    0.0013    0.6372    1.9136
           y    -6.1560   -2.0796    0.0383    2.1868    6.1195
        x[1]   -11.6506   -0.7854   -0.0201    0.4536    9.0692
        x[2]    -9.8637   -0.5854   -0.0080    0.5366   16.3491
        x[3]    -9.5625   -0.5567   -0.0109    0.5960    7.7956
        x[4]    -9.7741   -0.4998   -0.0048    0.6407   14.5848
        x[5]   -12.1472   -0.6852   -0.0062    0.5297   10.1358
        x[6]   -12.6173   -0.5781    0.0044    0.5553    8.2965
      ⋮           ⋮          ⋮         ⋮         ⋮         ⋮
                                                   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
  ϵ = 3.2
Chains MCMC chain (1000×22×1 Array{Float64, 3}):

Iterations        = 501:1:1500
Number of chains  = 1
Samples per chain = 1000
Wall duration     = 1.53 seconds
Compute duration  = 1.53 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.0232    1.0147    0.0281   1226.3114   943.7586    1.0059    ⋯
    x_raw[1]   -0.0106    0.9740    0.0267   1331.7789   822.5266    1.0006    ⋯
    x_raw[2]   -0.0199    1.0163    0.0319   1015.2649   635.4538    1.0129    ⋯
    x_raw[3]   -0.0056    0.9791    0.0329    886.4007   705.0704    1.0061    ⋯
    x_raw[4]   -0.0159    0.9870    0.0268   1353.4370   765.9316    1.0000    ⋯
    x_raw[5]    0.0212    0.9633    0.0283   1145.2691   782.4686    0.9991    ⋯
    x_raw[6]    0.0109    0.9794    0.0266   1340.8651   820.4943    0.9992    ⋯
    x_raw[7]   -0.0435    0.9843    0.0276   1268.5638   737.2112    0.9992    ⋯
    x_raw[8]   -0.0024    0.9768    0.0311    979.3213   717.0221    1.0013    ⋯
    x_raw[9]    0.0458    1.0282    0.0324   1010.9786   745.4427    0.9999    ⋯
                                                                1 column omitted

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

       y_raw   -1.8659   -0.7165   -0.0360    0.6395    1.8877
    x_raw[1]   -1.9299   -0.6723   -0.0298    0.6148    1.9147
    x_raw[2]   -2.1223   -0.7181   -0.0053    0.6539    2.0254
    x_raw[3]   -1.9048   -0.6549   -0.0056    0.6681    1.8177
    x_raw[4]   -1.9790   -0.6767   -0.0223    0.6808    1.9224
    x_raw[5]   -1.8853   -0.6446    0.0397    0.6781    1.8215
    x_raw[6]   -1.9612   -0.5977    0.0341    0.6146    1.9036
    x_raw[7]   -1.9008   -0.7052   -0.0295    0.6065    1.9154
    x_raw[8]   -1.9201   -0.6293   -0.0039    0.6856    1.8769
    x_raw[9]   -1.9873   -0.6471    0.0269    0.7602    1.8820

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 = [-13.85582546278551, -7.2497222549518945, -17.28878353571329, -4.850257754353959, -4.8260721907895645, -0.8951993722765654, -4.846462830114392, 0.17051166672535475, 10.32231795525912], y = 3.814076364578924)
 (x = [-0.16688578065752738, 1.4944305175374057, -0.9461540034223422, -1.1104243553702593, -0.6724332733271094, -0.11872977193258938, 0.8907123167548846, 0.4816196750216962, 1.7727998226895632], y = 0.42646929957686797)
 (x = [-0.33588740571154685, -0.4024693054176065, 0.27135892746466117, 0.3944844828486252, 0.6122323289412296, -0.02585883164395163, -0.4041924313424052, -0.1749583530133777, -0.716929204833379], y = -1.392322936062465)
 (x = [-0.6964836135409943, 1.130526497566346, 0.7683904612787376, 0.8005870846495818, -1.0016202069556286, -1.4064719537253882, -0.6339778252863868, 1.186160964678949, -0.589947623462815], y = -0.07198348140060823)
 (x = [0.5128688405417383, -0.5449454282170314, -0.004509506502821905, -0.5378466143141591, 0.33036584232167443, 1.1665011698387344, 0.40461769800190506, -0.5605799540246768, 0.009740433485491938], y = -0.6810890885518743)
 (x = [-1.3632056383461366, -0.7902366979371824, -0.3547110117799249, -1.3339865960060031, 0.6150855705507213, 1.1032737844767975, -0.14081182556340457, 0.6504572895733002, 0.49030470225937445], y = -0.8835169292603087)
 (x = [-2.619663898354517, -0.10734502494563286, 1.0865042578985893, -3.4076091062334637, -4.226077096094355, 1.0318696258076836, -0.4278598265893095, 2.189236156724695, 1.657150895855797], y = 2.0690159376308266)
 (x = [-0.48012701178127837, -0.994225113332858, -0.07793177559918986, -0.7004817683290713, 1.4197088440595842, -0.549527195858791, 1.5197215642133919, 1.0837046046833645, 0.573609991639427], y = 0.40693809823279137)
 (x = [-1.0211935599974324, 1.2713368463591819, -0.19857192801930665, 0.704048409995593, -0.923529417405004, 0.14294196717536084, -1.264123988515792, -1.5043710479738526, 0.5811466203290493], y = 0.119814426591763)
 (x = [0.8607511973133299, -1.480431123259179, 0.7843422599326835, -0.45741784111926126, 0.7884453617388514, -0.7063805253426236, 0.969717609760314, 0.46620462117560246, -0.43723699462891324], y = 0.2613100222911194)
 ⋮
 (x = [-0.7000379870661941, 0.3277416320864291, -2.2571630238125375, 4.911458862572344, 3.4727235612496967, -1.5499711329029835, 2.713319136785962, 1.4419640301286936, 1.7857531137630571], y = 1.4665017073483615)
 (x = [0.8352958575532915, 1.7083252640340107, 0.344634435385582, -1.2277028667453436, 1.1164780648711161, 1.1504143727083027, -0.32041708276675646, 0.8852687525017984, -1.0984106968731335], y = -0.7816963182265168)
 (x = [-18.44732097655464, 6.169410807822822, -0.6368113247161429, 9.814071528701286, -5.0218451971606815, -0.7029606600215949, 5.896783910729456, 11.349059729770417, -5.88544081968534], y = 4.863939185601005)
 (x = [0.05762925900811692, 0.2570986617825854, -0.14462509717558325, 0.028991866452730285, 0.0004393003078018847, -0.14984226411538468, 0.11078535443549249, -0.038547750336907084, -0.2930437588390677], y = -4.088900385529538)
 (x = [0.19197704611220998, 0.3642697096235383, -0.3269250493533225, 0.35934955491288684, 0.8398893510105745, 0.01895904825141602, 0.5901406700010041, -0.8970406457015614, -1.1208969379606466], y = -0.5742016325377344)
 (x = [0.0976504334277211, -1.3409901862214115, -0.5937238241651557, 0.2534684902896499, 0.3178133073787585, 0.3181459567492967, 0.13220805364658655, -0.28088184972106206, 0.41049086296087184], y = -0.052484839008088646)
 (x = [-1.616959928560026, 17.24285816864046, -4.922851744209671, -3.7146285854457335, -16.80043931985984, 4.636658601539857, 2.436297159601067, -0.04267247843167852, 13.6470781735539], y = 4.840125885269546)
 (x = [-0.014572216713713337, -0.05181441697773626, -0.06635398631415698, 0.007472042779034843, 0.12716485451183301, -0.040540212682996755, -0.04938860493304351, -0.05970263042265764, 0.009174821137153047], y = -4.373418063426049)
 (x = [0.5694670118503209, 4.01485086062907, 3.969304906752177, -0.18440199381500838, -1.2460120173450944, 8.448584527564622, 1.6317248638537862, 2.1370167246313456, -5.028238598776417], y = 4.087831116512138)

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

nts[1]
(x = [-13.85582546278551, -7.2497222549518945, -17.28878353571329, -4.850257754353959, -4.8260721907895645, -0.8951993722765654, -4.846462830114392, 0.17051166672535475, 10.32231795525912], y = 3.814076364578924)

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.42 seconds
Compute duration  = 1.42 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.0237    0.9772    0.0315    980.5855   626.1828    1.0004    ⋯
    x_raw[1]    0.0039    1.0395    0.0255   1680.4733   606.5702    1.0030    ⋯
    x_raw[2]    0.0004    0.9713    0.0251   1513.5473   901.2260    0.9991    ⋯
    x_raw[3]   -0.0092    1.0278    0.0273   1429.0736   837.4171    1.0004    ⋯
    x_raw[4]    0.0175    0.9891    0.0312   1002.2489   611.8035    1.0011    ⋯
    x_raw[5]    0.0496    0.9928    0.0241   1636.0667   736.4783    1.0071    ⋯
    x_raw[6]   -0.0508    0.9578    0.0241   1613.4901   744.2469    1.0012    ⋯
    x_raw[7]   -0.0248    0.9789    0.0260   1413.8558   907.7013    1.0002    ⋯
    x_raw[8]    0.0436    0.9888    0.0279   1259.6908   611.7520    1.0059    ⋯
    x_raw[9]   -0.0188    0.9823    0.0273   1309.6083   791.8758    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.9631   -0.6452   -0.0042    0.6188    1.8428
    x_raw[1]   -2.0489   -0.6810   -0.0090    0.6751    2.0253
    x_raw[2]   -1.8470   -0.6664   -0.0288    0.6811    1.9367
    x_raw[3]   -2.0671   -0.6998   -0.0026    0.6583    2.0283
    x_raw[4]   -1.9651   -0.6078    0.0234    0.6822    1.9699
    x_raw[5]   -1.8342   -0.5928    0.0472    0.6868    2.1409
    x_raw[6]   -1.8757   -0.7080   -0.0336    0.6239    1.8084
    x_raw[7]   -1.8461   -0.7475   -0.0353    0.6493    1.7742
    x_raw[8]   -2.0275   -0.5687    0.0712    0.6646    1.9550
    x_raw[9]   -1.8790   -0.6919   -0.0231    0.6598    1.8273

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.5709580997680564, -0.6435120026161596, -1.6416581116706497, 2.7536998815509213, -4.837599588573253, 4.124546330168471, -4.420985655393805, -8.65031144175949, -3.1934275095109528], y = 3.0114756341285815)
 (x = [0.03429175588437922, 0.02109893111661642, 0.11344220732139154, -0.03840828663597155, 0.3222498054224211, -0.25968508934893475, 0.0550560818615953, 0.73919878588174, 0.19119543667298913], y = -2.324138749717262)
 (x = [-0.058396584193088054, -0.25785865742765307, 0.32509192671648757, -0.04341869075179542, 0.16727622297012393, 0.0717709366674102, -0.031530350050380296, 0.37334796340903603, 0.036947420081315095], y = -3.897103860609145)
 (x = [0.15449867085233146, -0.03811924939429674, 0.3417228879451528, 0.10790098699035347, -0.1346868540655037, -0.0013173032381678038, 0.30048297667096013, 0.040387383034471626, 0.11712739615922034], y = -3.4344809252586623)
 (x = [1.1067122418983064, -0.3367180224731867, -1.5497254231403097, -0.5351190732579825, 0.18508326577043888, -0.182126332907573, 0.25766498216876677, 0.4385373798794769, -3.007047342924274], y = 0.49265675424099353)
 (x = [-0.04046619931414778, 0.06340424743340482, 0.07527870525995915, -0.020212190544861272, 0.034402794718700995, -0.017311124959865018, -0.040906587151040355, 0.05904941901858295, 0.052262043265300255], y = -5.8433013528945565)
 (x = [-0.0008572619733730648, 0.10127342477678747, 0.017528147357595496, -0.0646342933971802, -0.04292274708608886, -0.02077440210242732, -0.08078746796409984, 0.0718740804579094, -0.03590098366611817], y = -4.9287775821749324)
 (x = [7.436354221672606e-5, 0.08608254544831943, 0.0019159729985560525, -0.12414202447423948, -0.06557370825011234, -0.021322187187029863, 0.001984065068895349, 0.04657880626903631, -0.019406463741052052], y = -4.973172244079966)
 (x = [0.006491500414306739, -4.934135423244009, -0.06890314950607888, 7.621586302100315, 3.4385668830825864, 1.7636417873763521, -1.1357669328720919, -3.9090774254939737, 1.7209691041646629], y = 3.7194091601312005)
 (x = [-0.2623482385899745, 2.9270997578190094, 0.8286259396146956, -0.1603778100291373, 2.0221004197582246, 2.1117336335941497, 3.5161903229924625, -2.0031649485299243, 0.23996802793751204], y = 2.2310125348973777)
 ⋮
 (x = [-0.3505032846882638, 11.263274453390103, 46.70571827653365, -16.273753834760186, 9.760009854615271, -4.475044324267879, -13.106284207065235, -55.99296966611375, -7.5991560478856925], y = 6.593432247786341)
 (x = [-0.6750092139997618, -0.6414533636473482, -3.0732030404482447, 0.8006921142840584, -1.2709703518510298, -2.4601501461545183, 2.665983066786032, 0.6506830619466564, -0.5407777138451033], y = 1.2910997127517312)
 (x = [0.4689248620468888, 0.49183859221526516, 2.126072153172168, 0.2595124706475515, 1.1420256921913443, 1.7749159043830443, -1.8066785484591994, -0.21173041195198233, 0.6930232042687288], y = 0.6217680027637995)
 (x = [2.2509816579833086, -3.5457168506322816, -3.08806938963408, 3.9205273419611535, -4.873889436948153, -7.69288954012833, 0.013604331980549653, -0.2759998509241789, -1.0659640165393924], y = 2.044293008865737)
 (x = [0.4432324646845977, -0.4804594332726825, 0.4339805560071219, 1.0307712301931424, -0.492946236932638, -0.21879898726860228, -0.45827912850558555, -0.6900615259958414, -0.1833991968145426], y = -1.388371218810364)
 (x = [-0.24850370035172736, -0.5113826316852138, -0.3273768530829253, 0.3036660623693051, 0.8434564940506541, 0.5111605943902184, -0.7722549517156849, -0.3240423216598922, 0.2414617089750008], y = -0.9096335987643974)
 (x = [0.56510370280625, 1.0934640929571207, 0.5388411299241714, -0.5668758046782556, -1.8817949498381528, -1.1975070449295138, 2.055213290623259, 0.5530489982828231, -0.178024021073314], y = 0.7072292014503447)
 (x = [-0.5286153070731529, -0.18924167581274476, -0.7697967812865949, 0.3281269718745512, 0.41834377822096086, 0.2704532404653091, 0.15773981640234574, -0.008706943207057241, -0.6382326622732567], y = -1.921654789663116)
 (x = [-6.249871574670652, -7.5986765497254725, 4.110776630994572, 0.1385262774488085, 2.7656496846237397, -6.249185243920917, -8.19625346825678, 6.564039749043031, 2.3176207252565995], y = 3.7036788880900735)

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.625
1000×1 Matrix{@NamedTuple{x::Vector{Float64}, y::Float64}}:
 (x = [0.4358386927800387, 0.2316592198853463, -0.3288997850831286, -0.16959490229379917, -0.12332765391180414, -0.4602171319617139, -0.25701012662410305, 0.5831565320597634, -0.0985540072800922], y = -2.3407127695291563)
 (x = [0.4966896361481135, -4.240916271282399, 3.9993975288504355, 0.475252786863772, 1.5431986512524707, -2.477882133172504, 5.666399543363596, 3.4624825347323753, 10.04152372782034], y = 3.160578924940328)
 (x = [0.09279364368745434, -0.022724991290079967, 0.21902356011796548, 0.04324771968603036, -0.20523170636378613, -0.11440821546287278, 0.38778269376698865, 0.04222713656727179, 0.17623220841476242], y = -3.624031383702895)
 (x = [-0.17623317892775817, -0.6969975293803572, -0.899765906554953, -1.4209019351753456, -0.6111657303277136, 0.324930386746159, -1.5091265859452705, 0.34614285988053, 0.7596382410325967], y = -0.6893016511825547)
 (x = [-1.294376329077409, 1.895288632570201, -0.652481612505875, 0.43896122533717585, 1.09753326182372, -1.498529192865846, 2.4956426327659065, -0.12836784344470195, -1.2487202696051365], y = 0.6519007886529322)
 (x = [-1.409292563576897, 0.19899438368793557, -0.6069259804864234, -0.764726810958085, -2.250634947891866, 1.0740548965372385, -2.3708910968943813, -2.5084653189599986, 1.0976947165246502], y = 0.6895617297787278)
 (x = [0.6260011779970125, -0.1254369200111394, 0.22063421231064975, 0.05618273852908635, 0.6548662860895871, -0.17460927787881544, 0.6257344320438022, 0.6793367473386638, -0.3607008021535569], y = -1.7660459727985351)
 (x = [-4.345992356889138, 0.014258591030060112, -0.43673776088757593, -0.09656501182166423, -2.9428021224691747, 1.9463644688160318, -2.654277340472443, -3.567393346812586, 1.1999512527394915], y = 1.3054499131374757)
 (x = [0.19986962555623328, 1.3994691603230591, 3.690813136694956, -3.4720148873731347, -5.524997948832013, 1.2028474250822336, -2.68913009393277, 4.948176577269584, 7.582890517367835], y = 3.272863954062384)
 (x = [-0.04333208372041979, 0.010023999000059326, -0.1302262729397498, 0.17956924191673468, 0.2042139268208479, -0.08550388973656084, -0.011516751225960782, -0.12288986855106186, -0.24786474379290763], y = -3.299636306839887)
 ⋮
 (x = [-5.184344002872977, -4.623437902853741, 6.31387297530663, 1.309290280538134, 1.6249693299500543, 3.4141792932625883, 4.977496335468861, 5.585947914983024, -3.474017211316008], y = 2.7154406766989827)
 (x = [-3.123741105387857, 0.07250846826160204, -0.8036252137673442, -1.383411179105234, -1.8000210521540916, 1.1513957096787377, 1.3888925023621679, 0.09431579875606091, -0.2262430994803769], y = 1.5727208172634004)
 (x = [1.3292282392102368, -0.24305812331576715, 0.08062891522699224, -0.6832626594224646, 0.7818153783211167, -0.6143442071269103, -0.18452931427879501, 0.3020814928551451, 0.022103934120095158], y = -0.11659772461012397)
 (x = [-0.06937591502932941, -0.25115870724354006, 0.1887939148541055, 0.09643322630441044, -0.34426940663824857, 0.2104414660362182, 0.21724116627578277, 0.011443824183880734, -0.3587737060263233], y = -3.1669774092448426)
 (x = [-1.4878724611192249, 6.643582052702625, -3.4462886654981166, -3.106436961978286, -2.6206120304142484, -4.7107279550371635, -4.291179620765057, 1.0543342359956138, 1.132839389937742], y = 2.5905980499016503)
 (x = [0.31531721165100607, -0.6500846695353328, 0.27323359484771415, 0.04121684903430525, 0.20620761655140252, 0.29526721618318447, 0.2816629798727543, -0.01084220032510025, -0.02590272185176011], y = -2.52283405651314)
 (x = [6.338088207625831, -3.751048218682775, 40.25735926343609, 0.9641973702243314, -2.1747035638797896, 31.097922610882474, 10.534277665789377, 39.93026531350429, 17.83327310683915], y = 6.426931267010963)
 (x = [5.533793903612152, -10.115009541596313, 16.707560331537017, -6.266716266809141, -8.453796148260567, 36.56758495551583, 8.185251883517116, 22.06737452293375, 18.26823776914282], y = 6.2063805082895)
 (x = [-0.14436942068852326, 1.0249353962489514, -0.5840686057461418, -1.790699100878032, 1.926503883273467, 1.8823105496136465, -2.4862765181335096, -0.17327709886921022, 0.3936806538504832], y = 0.6889647871317768)

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