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     = 6.9 seconds
Compute duration  = 6.9 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.0013    0.9993    0.0284   1237.3623   945.3040    1.0016    ⋯
    x_raw[1]    0.0035    1.0738    0.0280   1465.2563   855.0125    0.9990    ⋯
    x_raw[2]   -0.0174    0.9713    0.0288   1143.9887   819.5146    1.0010    ⋯
    x_raw[3]    0.0043    0.9560    0.0242   1535.3364   610.0000    1.0015    ⋯
    x_raw[4]    0.0317    0.9823    0.0277   1265.0943   682.9616    1.0009    ⋯
    x_raw[5]   -0.0293    0.9381    0.0268   1229.3756   724.6225    0.9990    ⋯
    x_raw[6]   -0.0309    1.0219    0.0267   1471.0977   815.6239    1.0003    ⋯
    x_raw[7]   -0.0120    0.9789    0.0247   1571.9030   790.6797    0.9991    ⋯
    x_raw[8]    0.0156    0.9926    0.0250   1579.9799   784.3440    1.0031    ⋯
    x_raw[9]   -0.0043    1.0129    0.0269   1392.4238   667.6761    1.0001    ⋯
           y    0.0040    2.9979    0.0853   1237.3623   945.3040    1.0016    ⋯
        x[1]   -0.0786    7.6862    0.2559    932.7040   902.8933    0.9998    ⋯
        x[2]    0.3420   11.9559    0.3911    951.0003   785.9897    1.0004    ⋯
        x[3]   -0.0033    6.0857    0.1919   1168.7116   816.0964    0.9993    ⋯
        x[4]    0.0496    7.3198    0.2240    836.6771   815.8681    1.0085    ⋯
        x[5]   -0.2568    6.8381    0.1958    881.2008   799.1664    0.9994    ⋯
        x[6]   -0.0261    7.4616    0.2433   1183.8903   546.8084    1.0011    ⋯
      ⋮           ⋮         ⋮         ⋮          ⋮          ⋮          ⋮       ⋱
                                                     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.8831   -0.7349    0.0238    0.7054    1.9112
    x_raw[1]   -2.0944   -0.6595    0.0183    0.7047    2.2870
    x_raw[2]   -1.9064   -0.6820   -0.0541    0.6136    2.0725
    x_raw[3]   -1.8152   -0.6516    0.0458    0.6923    1.8493
    x_raw[4]   -1.9749   -0.6133    0.0306    0.7003    1.9942
    x_raw[5]   -1.8301   -0.6712   -0.0384    0.6251    1.8471
    x_raw[6]   -1.9841   -0.7182   -0.0093    0.6644    1.9153
    x_raw[7]   -1.9933   -0.6534   -0.0043    0.5914    1.9541
    x_raw[8]   -1.9448   -0.6483    0.0219    0.6987    1.8731
    x_raw[9]   -1.9147   -0.7189   -0.0541    0.7290    1.9745
           y   -5.6494   -2.2048    0.0714    2.1162    5.7337
        x[1]   -8.9126   -0.5905    0.0051    0.5805   10.0282
        x[2]   -8.3993   -0.5913   -0.0121    0.5663    8.9168
        x[3]   -8.8308   -0.4936    0.0117    0.5573    9.3332
        x[4]   -9.0847   -0.4622    0.0140    0.7300    9.5151
        x[5]   -9.6280   -0.5972   -0.0128    0.4724    7.3637
        x[6]   -8.4196   -0.6669   -0.0041    0.5194    8.0270
      ⋮           ⋮         ⋮         ⋮         ⋮         ⋮
                                                  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.61 seconds
Compute duration  = 1.61 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.0317    1.0088    0.0278   1316.8848   605.8337    1.0003    ⋯
    x_raw[1]    0.0591    1.0254    0.0299   1183.4211   715.9766    0.9991    ⋯
    x_raw[2]   -0.0094    0.9970    0.0285   1236.6454   694.8675    0.9994    ⋯
    x_raw[3]    0.0213    0.9919    0.0282   1243.4043   765.9316    0.9999    ⋯
    x_raw[4]    0.0363    0.9813    0.0287   1173.7580   759.7529    1.0003    ⋯
    x_raw[5]   -0.0008    0.9970    0.0276   1309.8730   692.2078    1.0009    ⋯
    x_raw[6]    0.0137    0.9689    0.0271   1274.2928   647.9429    0.9992    ⋯
    x_raw[7]    0.0133    1.0172    0.0296   1178.7639   546.9931    1.0103    ⋯
    x_raw[8]    0.0579    1.0235    0.0281   1335.2239   754.7531    0.9998    ⋯
    x_raw[9]    0.0374    0.9835    0.0267   1353.6942   637.1263    1.0013    ⋯
                                                                1 column omitted

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

       y_raw   -2.0554   -0.6147    0.0365    0.6774    2.0286
    x_raw[1]   -1.9460   -0.6322    0.0392    0.7552    2.1179
    x_raw[2]   -1.9781   -0.6454    0.0252    0.6262    2.0951
    x_raw[3]   -1.9036   -0.6362    0.0059    0.6725    1.9970
    x_raw[4]   -1.9005   -0.6142    0.0436    0.7044    1.8556
    x_raw[5]   -2.0052   -0.6182    0.0249    0.6295    1.9831
    x_raw[6]   -1.9176   -0.6350    0.0045    0.6737    1.9285
    x_raw[7]   -1.8927   -0.6955    0.0237    0.7277    1.9993
    x_raw[8]   -1.8665   -0.6965    0.0571    0.7897    2.0376
    x_raw[9]   -1.8057   -0.5992    0.0118    0.6997    2.0551

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.02945509096240049, -0.013318733490689011, -0.005645293482129048, 0.011368375136133115, 0.011871924360181755, 0.0008362287514159716, 0.0071862544923492165, -0.0017743199722388221, -0.0015293079569128163], y = -8.165517463777194)
 (x = [-4.509401459113156, -3.3912118481130817, 6.709159073833132, 1.0076150542930575, 9.255618052994576, -1.1913637563975021, -2.4881963919538994, 4.585919524706326, 6.745649048135383], y = 4.359346278362595)
 (x = [12.624889373114012, -8.244806197815112, 16.96791758184838, 7.193339259009675, 15.072623094587282, -1.0396255173405171, -7.3726313310725855, 12.88451965652716, 15.556401676489614], y = 6.38300030183594)
 (x = [-0.028004773109049756, 0.013190894383374651, -0.027146655768476618, -0.000798710403958184, 0.000488367858312949, -0.02684750510170675, 0.018217797903300505, -0.02266482927364582, -0.03075874813664398], y = -6.218632642429518)
 (x = [-0.1742195106417978, -0.12303348036430053, 0.12853695793143974, -0.017359366663440318, -0.01676205576196681, -0.03400548832885398, 0.026264260496535543, -0.13757240732365997, 0.09630625205201994], y = -3.806954217036215)
 (x = [-0.42566030653897463, 0.28227089901400587, 0.44326251145937984, 0.004263700405158422, -0.15046828523393296, -2.0846714996622797, -0.668093486570633, -1.8688619984091588, 0.7128988242991765], y = -0.26596973669685187)
 (x = [0.7058116955610259, 0.3809313058703231, -1.20673168579559, 0.0020440299573452636, 0.6768547260188058, 1.659446721740911, 0.7996509532170296, 2.416393035349491, -0.0971640496121326], y = 0.26903489889064314)
 (x = [-0.37030182745542317, -0.05530231768610107, -0.28557360291587713, -0.07135244063484368, -0.6649363586023194, 0.5913127256638839, 0.35623440431685816, 0.8384448200607002, 0.2780651108414005], y = -1.5410589312263256)
 (x = [7.969695169484719, -0.5243363402460302, -0.5174210498995103, -1.572935747975725, 0.2625008796565458, -4.219242439834288, 0.07458280086803928, -4.479780985519049, -2.9306918547564944], y = 2.206870833960706)
 (x = [-0.6030825330943258, -0.7041023353377631, 0.09638171443709843, -0.30291603268831024, 0.23286512611196414, 0.09668694536152408, 0.07226375154733868, -0.41532227952298706, -0.3515694236649644], y = -2.4529747058117963)
 ⋮
 (x = [0.45871462912992006, -1.9908637281008532, -0.7663055055559794, 2.848731510758601, -0.13396197652871947, -2.895988647000904, -1.238743702460197, 0.8359964613768517, -2.1651186283612924], y = 1.092581830624252)
 (x = [3.148068402026382, 1.3165798006463219, 1.7389886106874786, 0.015099996141073484, 1.4087247156324492, -0.3724730637071885, -5.249149011000391, -0.5059093912212098, -1.6385250454426639], y = 1.477592346013776)
 (x = [1.1868330316141604, -5.196641139529596, -0.36690106464733496, 1.3130112588700813, 2.549143864133679, 3.2161775066731897, 1.5764599163375703, -3.15917625458521, 1.2047735004868063], y = 2.0612879946658005)
 (x = [3.1789191939513293, 0.31384377560842563, 3.862765181903486, 2.711398697759184, 1.5347060800148962, 5.295974111542363, -13.404437874069073, 7.998218162153245, -3.872157395643152], y = 3.776737247385138)
 (x = [-0.0036566282794347413, -0.003360726787870855, 0.07242300565788391, 0.006559515114650228, 0.012524405307683681, -0.020579539716786336, -0.06236388957652689, 0.016441458427257964, 0.022238551981079484], y = -6.652226405142729)
 (x = [-0.05652353741420655, 0.04175253217173796, -0.05777215956887775, -0.08636613698616646, -0.007888095763225815, -0.058969329802542256, -0.02621552890051491, 0.03620576703138513, 0.067367562831608], y = -5.637636126380305)
 (x = [83.19546533889623, 11.15817930969001, 211.15168607336466, 63.658414750193465, -226.20342012696972, 52.581791006673924, -24.478670076795833, -118.93552028431793, -155.27131728861065], y = 9.172569485774716)
 (x = [-0.34688827465522515, -0.41937846584242094, -0.2901358573359637, -0.058494239340016796, -0.19925140933762386, -0.071371935088309, 0.24574628970068454, 0.16048255227111854, 0.6296162681714986], y = -2.5609435118666006)
 (x = [5.063182433907916, 5.063355076494281, 1.7778663100373233, 0.5175105685912036, 4.010208697241577, 1.2545358921054153, -3.014588382770575, -0.017013595476294312, -7.091120912298981], y = 2.3137869772473865)

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

nts[1]
(x = [0.02945509096240049, -0.013318733490689011, -0.005645293482129048, 0.011368375136133115, 0.011871924360181755, 0.0008362287514159716, 0.0071862544923492165, -0.0017743199722388221, -0.0015293079569128163], y = -8.165517463777194)

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.54 seconds
Compute duration  = 1.54 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.0077    0.9788    0.0231   1800.7077   533.5936    1.0046    ⋯
    x_raw[1]    0.0343    1.0144    0.0300   1148.8410   843.2654    1.0018    ⋯
    x_raw[2]    0.0133    0.9845    0.0305   1039.9368   791.8282    0.9992    ⋯
    x_raw[3]   -0.0201    1.0054    0.0316   1020.7300   782.4686    0.9993    ⋯
    x_raw[4]    0.0061    0.9802    0.0309   1004.7384   447.7784    1.0032    ⋯
    x_raw[5]    0.0302    1.0167    0.0288   1213.4446   759.8049    1.0002    ⋯
    x_raw[6]   -0.0580    1.0159    0.0299   1154.1392   763.1685    0.9991    ⋯
    x_raw[7]    0.0328    1.0005    0.0301   1119.8902   742.2275    1.0016    ⋯
    x_raw[8]    0.0012    1.0314    0.0333    941.3707   774.4190    1.0101    ⋯
    x_raw[9]   -0.0217    1.0150    0.0288   1254.4214   720.8847    0.9990    ⋯
                                                                1 column omitted

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

       y_raw   -1.8642   -0.6941   -0.0094    0.6782    1.8370
    x_raw[1]   -1.9349   -0.6266   -0.0009    0.7077    2.1442
    x_raw[2]   -1.8862   -0.7006    0.0195    0.7041    2.0608
    x_raw[3]   -2.0567   -0.6804   -0.0333    0.6375    2.0048
    x_raw[4]   -1.9295   -0.6527    0.0121    0.6865    1.9012
    x_raw[5]   -1.9170   -0.6694   -0.0122    0.7129    1.9627
    x_raw[6]   -2.0423   -0.6954   -0.0958    0.6038    1.9875
    x_raw[7]   -1.8844   -0.6275    0.0262    0.7523    2.0054
    x_raw[8]   -2.0947   -0.6310   -0.0303    0.6971    1.9503
    x_raw[9]   -2.0361   -0.6969   -0.0579    0.6055    2.0261

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.2739389729913275, -0.725873959619524, 1.3246071624826723, 0.27823437436183773, -0.07412836049239444, -2.803241860646499, -0.5538717032314986, 0.6403122464945608, 1.1500582988407], y = 0.5720252596904926)
 (x = [-0.5912787620341975, -1.384892237493483, 0.7476554343435899, 0.19187809173039994, -0.7922172103954951, -0.3886243726463442, 0.3811173498906787, 0.7345572956056999, 1.1966618616318854], y = 0.598074396143893)
 (x = [1.683272111802992, -2.286757009866528, 0.8489458957364298, 4.313594300904396, 1.8341435320605524, -0.6382274584838724, -2.1262157047248147, -0.781784952677246, -1.2231008526563896], y = 0.6115053669452888)
 (x = [1.0911914610722933, -0.04639648722324017, -0.30813334118573404, 1.9723570516803592, -1.7350130411336457, -0.2213000824160655, 0.2234464297892053, -1.2934986656572232, -2.07595988044577], y = 1.1020159986264724)
 (x = [1.0911914610722933, -0.04639648722324017, -0.30813334118573404, 1.9723570516803592, -1.7350130411336457, -0.2213000824160655, 0.2234464297892053, -1.2934986656572232, -2.07595988044577], y = 1.1020159986264724)
 (x = [-0.6050730384252592, -0.32312211330917395, 0.0529374280049215, -0.2544133608432028, 0.4466155148792354, 0.05925482980379456, 0.016404342795930636, 0.6662096037239373, 0.7283626490305565], y = -1.1201000752479202)
 (x = [1.6463793513911584, 1.2050993224026947, -1.780756148724561, 0.36539747563437824, -0.7121855254433191, -0.17990188207832156, 1.0013005051359012, -2.122472689107372, -2.776106608450676], y = 1.0646587618582593)
 (x = [8.422558422485848, 1.3002132739574637, -1.200916129748084, -7.236700215631633, 7.05010953151145, -4.073490023804853, 4.291904430373115, -1.2724683664408887, -1.621114795485088], y = 3.6415637123795994)
 (x = [0.7131206970466417, -1.495822449459253, 1.2363838661534343, -2.2188287080342954, 1.5081199529555884, 0.8660318991063022, -1.1470224811562686, -3.236440796033603, 1.070273209603246], y = 1.5022122878862096)
 (x = [-0.039084956053347754, 0.05758445184270248, -0.33593678332550536, 0.8545984009826475, -0.26258796151279445, -0.05893245544196751, -0.11879235969165781, 0.4735487970681159, -0.004068905473433084], y = -1.5134786676958154)
 ⋮
 (x = [-0.4330124762461867, 1.2547665264831334, -1.967894460378585, -1.910383886965461, -0.20712263206452242, -0.17346697864263955, -2.826118180441302, -2.156275880697491, -0.7462894952453267], y = 1.0370710267864527)
 (x = [-0.41403424299637565, -0.3745748079021734, 0.2685455097361553, 0.6413380342378342, 0.02977138947346701, 0.1267900098014902, 0.7036108077161258, 0.7725752955765213, -0.6739323575985318], y = -1.1216644471456716)
 (x = [3.50242980140718, 0.8254564654591453, 0.28136986456797425, 0.5751607172519823, -0.5095097978878278, -5.563941889157676, 4.366304039417505, -2.195280831168769, 5.077398209764581], y = 2.2625552597583916)
 (x = [6.0590688468721225, 0.5695626675805044, -2.2242339353237557, -0.37676355272552803, -3.294247783248208, -5.423904810943471, 0.8224885069042461, 1.3631900242065838, 3.6020887364119254], y = 2.4141551523777154)
 (x = [-0.6073644615064709, -0.02374856175066855, -0.08921345776810204, 0.12017270005648881, 0.32427437527199543, 0.5227253933001719, 0.10611264989493582, 0.12997284120242572, -0.3959422999255936], y = -2.4405050579543937)
 (x = [-0.9404703932762618, -0.23772897791559172, -0.062401247237217634, 0.34266026963476237, -0.27102619908935416, 0.643624013959592, 0.4807365599551783, -0.19631506521958955, -0.2761156567064632], y = -1.7376246799365584)
 (x = [5.273060496216637, 0.7460396611908884, -4.066150236633196, -0.6946780413096488, -1.4884067691885352, -4.263492225558563, -1.9720053027930569, 1.0453828686149929, 0.8296273966095183], y = 1.7296669451908127)
 (x = [-0.05552363185789681, -0.13132057766631738, 0.07300726718818516, -0.049034565068930155, 0.1085365092927902, 0.07172217278255785, -0.08258555048927171, -0.057871945508599566, -0.014390241742654039], y = -4.919566649133173)
 (x = [-0.13048765647447727, 0.7811236344866568, 0.2166605222970843, -0.029748513357694382, 0.15577953271372544, -0.9485269852567908, 0.549443348899804, -0.2563425138449793, -0.532511381232755], y = -0.6946014710596562)

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 = [1.0708208823486622, -1.1738853063504264, 1.3501156989046679, -0.5096779086576493, 2.7628003487683723, -2.7253295107902984, -2.266158555925577, 0.24775274546844314, -1.6973372417996055], y = 1.5570546704121115)
 (x = [0.04394398012178355, -0.03754331194006512, 0.026551390735722876, -0.04426826017096053, 0.2821782212720606, -0.08722213728045308, 0.11770618713401051, 0.2754719092797734, 0.1729720985441475], y = -2.7628527441505377)
 (x = [0.004798411740736517, -0.02024208149502857, -3.6939103091918635e-5, -0.0018089372881486888, 0.015263658118160514, -0.01032864451624901, 0.019362172748544987, -0.004081061494722481, -0.005411691671980954], y = -8.170750773492886)
 (x = [-2.9587829200326854, 62.50419628724613, -2.5448726627320055, -4.006902213305698, -38.80967670094835, 4.458823139448315, -51.39200992160584, 12.061356770116285, 12.495980615216128], y = 7.6687963085522615)
 (x = [0.32622978515978635, 0.25493641931, -0.22535695601688893, -0.01594915467771684, 0.49907937131361063, -0.13783429311341283, -0.014046648716101458, 0.12118046039396613, 0.07066962469304816], y = -2.050340968362336)
 (x = [1.1531313024162892, 2.009749441052729, -1.2752260988865474, -0.04686761109548352, 0.8804330659284997, -2.8421782315619772, 4.394781294639914, 1.349713139674858, 1.6455639547532128], y = 1.379635762651532)
 (x = [-0.5027467168425059, -0.873767933090306, 1.2148561709655585, -0.9210915650612619, 0.08754282737352098, -2.360334053336069, 0.6023667558638882, -0.1910473657190526, -1.0443232529543116], y = 0.2202821161002143)
 (x = [-0.41877896791120894, -4.004286101176667, -5.2884401253867805, -0.5429548769893485, -4.381153575004142, 5.2313170487562415, 5.550198332514692, 2.0559046913486028, 10.879483527836621], y = 3.455784129464666)
 (x = [2.811417474856184, -0.38578150768091457, -0.4706535034393252, -1.3995176959957747, 2.5710248769451804, -2.0546325152827074, 0.9146602544874033, -0.5883830250825697, 0.049563286665074556], y = 0.5020429956027281)
 (x = [-1.4009042351647885, -0.057241713554226616, -0.5833379515289174, -0.2914921254242911, 1.6211252624731478, 0.1920904361181341, -0.9565386238905234, -0.8566834470730175, 0.8010341673739956], y = -0.6799984406472728)
 ⋮
 (x = [0.02458081774909506, -0.0994813176337048, 0.26673043724458695, -0.13237535842976586, -0.3858669682407341, -0.11185362834731315, 0.3587810794003899, -0.008236330368119778, 0.32735401659434304], y = -2.419385876639488)
 (x = [-0.0131238612625259, -0.03389818873919908, -0.02119239420793351, -0.10594800250882694, 0.10418863449278891, 0.07645356366066758, -0.026524765836196333, 0.017884435837182147, 0.0271404032235148], y = -5.1629273427084)
 (x = [-0.5415781238545598, -0.12946469938532965, 1.6586414365994975, 0.9109494753672666, -0.6553806282026386, -0.5718571455668563, -1.2309177706060268, -0.9244676302236112, -0.541411546835743], y = -0.11292225986081883)
 (x = [0.5429122597834017, -0.40105538188283996, 0.6254966203230743, 0.0193846894832659, -0.20008410485981123, 0.006922332569304338, -0.10242585378997655, -0.36068514247884365, -0.311714557898495], y = -2.056645940737101)
 (x = [0.5429122597834017, -0.40105538188283996, 0.6254966203230743, 0.0193846894832659, -0.20008410485981123, 0.006922332569304338, -0.10242585378997655, -0.36068514247884365, -0.311714557898495], y = -2.056645940737101)
 (x = [4.153506823156062, -7.631604684921027, -19.114549366526482, 15.222172047382685, 6.532543908711162, 5.810659566257371, 16.37199392291501, 4.430473367482582, 9.223517846836275], y = 4.786430270294298)
 (x = [0.662848439291599, 0.3322749379545228, 1.1470918226208504, 0.18626367314865463, -0.27656266859324197, -1.1868430138482973, -0.23063789139577764, -1.2577168065773967, -0.7790564725397635], y = 0.9008872268570467)
 (x = [-0.32686250575019565, -0.26163652604120546, -0.6313157296939036, 0.12975723580590565, 0.39412030859424074, 0.25414064702021627, 0.2058029363766976, 0.5549870624601652, 0.341753787711657], y = -0.7178934969511706)
 (x = [-0.906412799284477, -0.07223841281951913, -0.3658644043575329, 0.2195298880771092, 0.25714481891810576, 0.4439080376161376, 0.15367360626550394, 0.008528181034320025, 0.3982346600982275], y = -1.3278366012704264)

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