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.95 seconds
Compute duration  = 6.95 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.0280    1.0332    0.0310   1115.3539   478.5017    0.9995    ⋯
    x_raw[1]    0.0278    1.0133    0.0313   1055.0772   906.1256    1.0017    ⋯
    x_raw[2]   -0.0073    0.9638    0.0258   1379.2833   743.8181    1.0025    ⋯
    x_raw[3]   -0.0057    0.9930    0.0278   1272.9785   812.8689    1.0002    ⋯
    x_raw[4]   -0.0411    0.9683    0.0288   1130.9735   656.0593    1.0018    ⋯
    x_raw[5]   -0.0226    0.9776    0.0236   1708.0482   842.0778    1.0021    ⋯
    x_raw[6]    0.0065    0.9981    0.0308   1050.1970   716.9414    1.0033    ⋯
    x_raw[7]    0.0419    1.0231    0.0311   1072.3563   736.5023    1.0005    ⋯
    x_raw[8]    0.0289    1.0401    0.0349    870.6978   590.8828    1.0028    ⋯
    x_raw[9]    0.0184    0.9841    0.0327    912.3626   738.7919    0.9991    ⋯
           y   -0.0839    3.0997    0.0929   1115.3539   478.5017    0.9995    ⋯
        x[1]    0.1829    5.8338    0.2191    788.7159   760.3348    1.0022    ⋯
        x[2]   -0.2511    8.4746    0.2944    752.1863   561.6456    1.0011    ⋯
        x[3]    0.1381    7.2048    0.2416    950.3264   720.1504    0.9991    ⋯
        x[4]   -0.0718    6.5701    0.2388    871.9171   623.6581    0.9993    ⋯
        x[5]   -0.0495   10.5750    0.3489   1190.0438   693.3067    0.9999    ⋯
        x[6]   -0.5694    9.0103    0.3111    972.6166   666.4042    1.0005    ⋯
      ⋮           ⋮         ⋮         ⋮          ⋮          ⋮          ⋮       ⋱
                                                     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.0387   -0.7385   -0.0564    0.6731    1.9536
    x_raw[1]    -1.9709   -0.6364    0.0396    0.7215    1.9669
    x_raw[2]    -1.9945   -0.6216    0.0152    0.5997    1.9788
    x_raw[3]    -2.0245   -0.6369    0.0006    0.6601    1.8906
    x_raw[4]    -1.8591   -0.7277   -0.0332    0.6170    1.8884
    x_raw[5]    -1.8779   -0.6728   -0.0305    0.6297    1.9171
    x_raw[6]    -1.8026   -0.7260   -0.0569    0.6515    2.0167
    x_raw[7]    -1.8939   -0.6457    0.0190    0.6851    2.1240
    x_raw[8]    -2.0285   -0.6444    0.0576    0.7736    2.0714
    x_raw[9]    -1.9433   -0.6685    0.0468    0.6938    1.8989
           y    -6.1162   -2.2155   -0.1691    2.0192    5.8608
        x[1]    -8.8810   -0.5415    0.0165    0.5511   11.0281
        x[2]   -13.3215   -0.5144    0.0062    0.4903    7.6723
        x[3]    -9.7782   -0.5400    0.0010    0.5688    9.4830
        x[4]   -10.1822   -0.6929   -0.0125    0.5017   10.3593
        x[5]    -9.8676   -0.5213   -0.0122    0.4340    9.8838
        x[6]   -13.2187   -0.5989   -0.0184    0.5360    8.9888
      ⋮           ⋮          ⋮         ⋮         ⋮         ⋮
                                                   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.65 seconds
Compute duration  = 1.65 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.0249    1.0097    0.0364    768.7877   691.7446    1.0032    ⋯
    x_raw[1]   -0.0242    0.9405    0.0327    838.1449   681.4022    0.9994    ⋯
    x_raw[2]   -0.0354    0.9813    0.0323    942.0484   552.2051    1.0031    ⋯
    x_raw[3]    0.0540    0.9872    0.0308   1036.3159   693.3000    1.0018    ⋯
    x_raw[4]   -0.0106    1.0365    0.0334    956.2533   747.2086    1.0003    ⋯
    x_raw[5]   -0.0216    0.9923    0.0290   1160.7243   717.4876    1.0011    ⋯
    x_raw[6]    0.0057    0.9470    0.0285   1105.6406   723.7740    1.0000    ⋯
    x_raw[7]   -0.0099    1.0051    0.0324    957.9894   571.7201    0.9998    ⋯
    x_raw[8]    0.0051    1.0077    0.0322    987.1017   843.2654    1.0000    ⋯
    x_raw[9]   -0.0056    0.9879    0.0299   1116.9494   674.0602    1.0000    ⋯
                                                                1 column omitted

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

       y_raw   -1.9245   -0.6536    0.0381    0.6910    2.0886
    x_raw[1]   -1.8891   -0.6531   -0.0118    0.6360    1.8914
    x_raw[2]   -1.8507   -0.6852   -0.0801    0.6253    1.9556
    x_raw[3]   -1.8110   -0.6065    0.0527    0.7269    1.9879
    x_raw[4]   -2.0400   -0.6927    0.0034    0.6480    2.0759
    x_raw[5]   -2.0228   -0.6343   -0.0263    0.6031    1.9915
    x_raw[6]   -1.7691   -0.6288   -0.0090    0.6252    1.9608
    x_raw[7]   -1.9407   -0.7082    0.0471    0.6862    1.8638
    x_raw[8]   -2.0003   -0.7390    0.0041    0.6898    1.9671
    x_raw[9]   -1.9422   -0.6688    0.0293    0.6604    1.8960

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 = [-1.3040992368892084, -0.030107723047677684, 0.5257262400660958, 0.8197729022276181, -0.6578114078405684, 0.3783528613689078, -0.617952594741113, 1.0810972569659907, -0.4723812570666979], y = -0.9136407361264414)
 (x = [0.6692296862328093, 5.836976768279324, -1.8629690756026323, 11.258075216488542, -7.227008940637864, -1.8694148782230846, -3.471524498659492, 4.650101201946985, 1.0616219291939084], y = 3.2907916280389635)
 (x = [0.9285397576795481, 8.11775654862149, -9.407821806900122, 15.068795584998258, -3.872201550349837, -6.628414801981836, -10.549594870203206, 5.327408466781954, 3.299967017781871], y = 3.708942973898508)
 (x = [0.43087155339382677, -0.607577709938373, 0.9133124994719708, -0.0228257889359761, 0.2777837104264167, -0.7379599045884755, 1.0309910167415839, -0.034134399372569825, 0.2912339891578191], y = -0.9524188291280787)
 (x = [-0.0857383554181979, -0.1541603958118925, 0.07279304351531732, -0.08395634765992499, 0.09134411695528641, -0.2960497104664563, 0.21745638335327733, 0.02433649218602378, -0.0036355974496335088], y = -4.296337397128599)
 (x = [-0.09658687165123307, -0.09093546768883497, 0.17326086717979008, -0.18246166023905908, -0.029393843117469502, -0.14129242434647787, 0.22617870278367622, 0.06779409896400204, 0.11033442911875352], y = -3.9007566491624557)
 (x = [-0.011073626289142942, -0.04540614855276434, 0.08536318902682367, -0.09542131929486986, -0.0009426115543712041, -0.07941927032444336, 0.13011592988833742, 0.005699155230287493, -0.011576535334741256], y = -5.260502985666133)
 (x = [-0.3774964710389135, -12.049170728750395, -10.25759259158697, 4.418599602805212, -3.0491044390875666, 10.70182305924613, -2.038060644049914, -3.551543535292948, -2.7414988936759634], y = 5.058278732874918)
 (x = [4.824636059238682, -5.503959679910009, -9.857678599332369, -0.9798058349804109, -0.031217137187543226, 6.339919440574029, -3.1158303882720615, -1.5178218100767202, -7.458121404700109], y = 4.279063931875465)
 (x = [0.08770706644166286, -0.5065376410424817, -0.16327020209621862, -0.5057110837934335, -0.13362524436824702, -0.10417851996456043, 1.1533577085432412, -0.0033375809235481296, 0.34356705431914586], y = -1.561638513159815)
 ⋮
 (x = [0.06563763855225621, -0.19984450459558076, -0.01895512242691087, 0.11978914525067827, -0.10744261482262762, 0.05142863649154959, 0.16332772393670553, -0.26900399834854766, -0.11420125351615303], y = -4.3508523893957305)
 (x = [0.36087019001907256, -0.16611474793054434, 0.2395618157882699, 0.3711618793767866, -0.06460938893835776, 0.33148656272044313, 0.8710102081765547, -0.5583007531532601, -0.4171167542602259], y = -1.1312102478383752)
 (x = [0.21112501929892322, -0.2059287528697113, 0.11995595861389464, 0.4039826003538237, -0.1331737508115247, 0.4496613168436186, 0.5798886546083102, -0.4424020323501438, 0.09299367303100865], y = -1.7804018454514616)
 (x = [-0.0681606562215688, -0.31777608759366294, 0.06300020833178978, 0.16045977521738233, -0.06695951494578647, 0.4335096250810043, 0.1559270000389159, -0.04600319174434339, 0.28161198949136645], y = -3.0234773584455)
 (x = [1.3187448856646302, 0.8805807894541576, -0.41106781546941645, -0.1773713099126042, -0.17401000894324856, -1.2115430706414563, -1.8222325781922246, 0.3084944069300579, -2.038390734274901], y = 0.9851213490632553)
 (x = [-0.027456694026952316, 0.04556951348921936, 0.06238527925893654, 0.026333202949686205, -0.06544675056025974, -0.04169856007201071, -0.050866993639435164, -0.02306541206568316, -0.038939935682488776], y = -6.279250686016974)
 (x = [-0.022691111328718934, 0.03171879192942364, 0.18205167083817306, 0.03853750757372371, 0.07259482588828164, -0.09809520693006533, -0.034149830010951336, -0.06955824402003749, -0.07020816398939438], y = -5.095337404514712)
 (x = [-0.0557257341247035, -0.06233793415556249, 0.23234639389948641, 0.09865831295283702, 0.10515831212976579, 0.05382754139186723, -0.05659485775957139, 0.11129923357297858, -0.0941202815157335], y = -4.427109807343103)
 (x = [-0.8296797371791871, -0.27529410741103716, 0.7259400386510486, -0.3270448534666208, 0.02909384319016162, -0.13026294159218735, -0.1884605025158245, -0.25699747821307906, -0.048672992150375335], y = -1.1896319231094101)

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

nts[1]
(x = [-1.3040992368892084, -0.030107723047677684, 0.5257262400660958, 0.8197729022276181, -0.6578114078405684, 0.3783528613689078, -0.617952594741113, 1.0810972569659907, -0.4723812570666979], y = -0.9136407361264414)

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.44 seconds
Compute duration  = 1.44 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.0220    1.0693    0.0240   1967.0121   757.1139    1.0015    ⋯
    x_raw[1]   -0.0046    0.9593    0.0302   1029.3006   612.5291    0.9991    ⋯
    x_raw[2]   -0.0089    1.0221    0.0237   1865.5163   908.5485    0.9997    ⋯
    x_raw[3]    0.0299    0.9865    0.0247   1613.8708   849.8517    0.9996    ⋯
    x_raw[4]   -0.0162    0.9993    0.0232   1888.2623   923.2531    1.0005    ⋯
    x_raw[5]    0.0185    0.9336    0.0205   2044.1236   797.6035    0.9992    ⋯
    x_raw[6]    0.0151    0.9890    0.0246   1609.2321   809.2381    1.0066    ⋯
    x_raw[7]   -0.0326    1.0048    0.0234   1847.6381   748.2981    0.9994    ⋯
    x_raw[8]    0.0193    1.0293    0.0249   1727.8495   766.6262    0.9991    ⋯
    x_raw[9]   -0.0083    0.9982    0.0239   1712.6028   878.3375    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   -2.0208   -0.7135    0.0234    0.7969    2.0076
    x_raw[1]   -1.9231   -0.6139    0.0055    0.6557    1.8501
    x_raw[2]   -2.0294   -0.6408   -0.0269    0.6873    1.9270
    x_raw[3]   -1.7803   -0.6989    0.0187    0.7253    2.0202
    x_raw[4]   -1.9644   -0.7045   -0.0257    0.7042    1.8265
    x_raw[5]   -1.7847   -0.6202    0.0213    0.6754    1.7866
    x_raw[6]   -2.0689   -0.6359    0.0232    0.6724    2.0252
    x_raw[7]   -2.0039   -0.6933   -0.0453    0.6607    1.9237
    x_raw[8]   -1.9877   -0.6644    0.0224    0.7170    1.9537
    x_raw[9]   -1.9195   -0.6750   -0.0143    0.6417    2.1223

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.013345795469510856, 0.02915057596488122, 0.06344357440249869, 0.02124029142053346, 0.03052809520669077, -0.005976406166475138, -0.010507578279118935, -0.023872271202902307, -0.05894908813914401], y = -5.814360065241523)
 (x = [14.857726639697397, -7.241638413234874, -21.569037628150536, -12.623962850413028, -8.711429070369103, 0.4556127213676224, -14.44123801802163, 10.316494592198122, 19.91743371624999], y = 5.840801559086043)
 (x = [-3.796655115403387, 0.9244205232211417, 3.7174543307163708, -3.1804067439915507, 0.9681923679078953, 5.487523392674842, -2.257590010965019, 0.263076995409206, -10.063177285974353], y = 3.2006484124494365)
 (x = [-4.386272100191857, 0.9109942977908301, 0.9827939628085498, -2.9186662223663773, -4.269744006230594, 5.006410377884329, -2.867951726551633, -1.5882183608713405, -4.603392571646004], y = 3.246316604804231)
 (x = [0.17558876094726264, 0.007908653471995951, -0.03024425289221757, 0.07813353310017669, 0.20563152688281566, -0.19806254966104087, 0.1636572058086884, 0.07401799002323317, 0.17203890490778986], y = -3.3230481320926355)
 (x = [-0.6279351195320074, -3.8017731426689605, -1.2213450489839395, -0.031313002372922505, 0.8390918161414604, -0.3702212745447081, -0.721330152000086, -0.2857243077363532, 0.5138516812181743], y = 0.3972527284742011)
 (x = [0.4351226889726952, 1.331119636044138, 0.8139646455643346, -0.03998326865311931, -0.5187895607024527, -0.13794540861945528, 0.9940222188547839, 0.17813119264137994, -0.35002968547076424], y = -0.3521797770352424)
 (x = [-0.5705935858943469, -0.6327525883074635, -1.183342902247518, 0.3576023341069932, 0.48451231237640824, 0.2983373171446613, -2.2172881181764734, -0.46184353252909116, 0.5205344921585231], y = 0.3869357255572427)
 (x = [-0.3741470869019218, -0.00947019544331518, -0.11155963518974006, 0.11300524176352532, -0.4634611114995864, -0.2118544768559461, -0.08241859548481226, -0.02905582693755615, -0.02257685777187427], y = -2.2138793426339256)
 (x = [3.280705540593439, -0.039894921884063836, 0.9297885192509148, 1.3008429007836335, 4.726747518712589, 2.5237462446573664, 2.813362031725218, -0.3530524985449286, 0.21309443771507663], y = 2.197952953702331)
 ⋮
 (x = [0.8490419245597823, -0.5332115249574894, -1.5330429809094839, -0.484851139148308, 0.6117332917863135, 0.35300307173070905, -1.059949481914532, -2.327109214836583, -0.6923742685258729], y = -0.027499289969548535)
 (x = [-0.4386279271962532, -0.048389327257210395, -0.7469870213488216, 0.49611101458022955, 0.8072175406015295, -0.20543504598324303, -0.5520832949528228, -0.8766801784361221, 0.768556950956694], y = -1.4338862689183924)
 (x = [-7.0299051274359075, 2.7523027402814635, 0.4735039483708107, 0.8207060353532757, -7.053523147563591, 9.821036158394183, -2.8364518026888548, 6.605901559207076, -11.90204802286869], y = 4.00307244580211)
 (x = [-0.5436709629717676, -0.21461379644917733, 0.07329183799496723, 1.3762769335827283, -1.020064223243353, 0.0932555244186523, 1.6816957589300143, 0.16943444863404997, -0.8227236414951661], y = -0.005919302198752696)
 (x = [0.7923218060920204, 0.8106151308142654, -0.09067879687911347, -1.354849682422535, 1.0897221626096685, 0.16251533255473316, -2.1641928349117063, 0.3747251668821594, 0.8710840289495496], y = 0.08446686951549887)
 (x = [-0.6412779080016217, 1.0020687423602836, 0.051826019534380235, 1.5214741951028523, -1.0667458090426662, 0.20755473032603336, 1.338221350093273, -0.38971388707690685, -0.7807096822036994], y = -0.11862903883066617)
 (x = [2.108120520428458, 0.45665137444795156, 0.6285121512934003, -1.747299907030149, 0.4524264019798116, 1.0691060947203896, -1.5941819242003914, -0.23690442732809985, 0.47228205400914747], y = -0.11690839912368438)
 (x = [-0.07685333350202464, -0.014319469535118087, 0.0702268363348157, 0.10735821984361166, -0.08665876206722674, -0.04250948623202325, 0.0988698567035298, 0.002086166752338155, 0.06834261910033301], y = -4.761479180609752)
 (x = [8.489703503724526, -12.936954393943283, -8.258172758378315, -12.824565843235444, 10.522767648466084, 5.832952239273235, -6.628438212867266, 1.9434408525346547, -8.230062003210628], y = 4.829286621050917)

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.5372281851248899, -0.10045195007382691, -0.9592933367354766, 0.20402839506649992, 1.1388106572658796, 0.33384028734892435, 0.8587879173736727, -1.1692769377900842, -0.04151524486442243], y = -0.32817917879943614)
 (x = [0.7434818763388934, -0.6232972884884219, -1.3125626817990301, 0.8069983808638638, 0.8825799960709008, -0.8545896506654259, 2.9373656855053825, -0.6279520769495186, 0.8461299256227957], y = -0.012487347917301939)
 (x = [-0.08674338854585494, 2.394955838465915, 1.2427198080473767, 0.3885093750075825, 0.03726418636592582, -4.139504250467066, -6.75029762550296, 0.9996584827049411, -2.739599972432099], y = 1.862432115208204)
 (x = [10.00516985077957, 8.767115022907765, 3.688618092301476, -8.618423190275074, -10.224066950212855, -21.30414508810116, -31.655447425457208, 8.229960711094133, -47.49424793346091], y = 5.50850203238142)
 (x = [0.0061448501024482915, -0.03382091179669639, -0.021197089316310633, -0.03356660441787928, 0.05116922756799769, 0.059630934264272614, 0.17116220935050436, -0.0662160852009517, 0.2289527413053411], y = -5.036381724984818)
 (x = [-0.03843573315354886, -0.01373724713354266, -0.0787090585488214, -0.026522502280137788, 0.036102123989579314, 0.0343835720040315, 0.13615175010208913, -0.036284827780871276, 0.12757985674763309], y = -5.583181955537853)
 (x = [2.251019076082119, -0.7772841709071805, -3.804526726530522, 0.9847651456445091, 0.9591848731342474, -5.917587442975747, -0.1906380876776975, 4.43009078087866, -2.3373176313920645], y = 2.394435504996551)
 (x = [0.8028939510762285, 0.37567867041263253, 0.10950464495025089, 0.9471606560571589, -1.2185142646849425, 1.4162239472793245, -0.42039209065945493, -1.2050319056316892, -0.3948384826640456], y = -0.47194026502894537)
 (x = [-0.09389870325014389, -0.018872226780154423, 0.4244672673826495, -0.17086327783092972, 0.33390548096097145, -0.4454194720825738, 0.09081921056940241, 0.40617159204535913, 0.1279212584041714], y = -2.8978686674756893)
 (x = [-0.0017909487584390315, -0.05407483233452696, -0.095467067610552, 0.1043764404643654, 0.043831661411633215, 0.06658604386301185, -0.037350302180635286, 0.06568808294555123, -0.14898985367576653], y = -4.714836549584823)
 ⋮
 (x = [-0.32102477392001316, 0.3588713581290194, -0.06972188114573458, -0.23540539688829687, -0.3120997408911981, -0.25568679493183233, 0.31797688556936743, -0.814205158741056, -0.7316435144396918], y = -1.792285520563384)
 (x = [-1.049279553260845, -0.4578527678561738, -0.012077981507773335, -2.3631423504132316, -1.40296885940942, 0.2400488338742077, -1.5762370088447792, -2.0694105383104637, 4.176400443703396], y = 1.192723254606594)
 (x = [0.4351554302629357, -0.03509228034174138, -0.7147296813997467, -0.6010506010001073, -0.3320754031328155, -0.018148781604554146, -0.7521600728640961, -0.3355559939859938, 0.7922563965268682], y = -1.5532682895893215)
 (x = [0.39691054932277475, -0.6984602744351456, 0.016746577241969197, -0.5801968027226551, -0.8720484768922835, -0.3805170820526903, -0.07735751829515065, 0.5477135574987458, -0.1585901770056899], y = -1.3562356151063448)
 (x = [-0.08173154853486582, -0.627927740469246, -0.43434745000498015, 0.6048875316885011, 0.3626297922690755, 1.3291798203781107, 0.5077108322307403, 1.4936747051989707, -0.3979933224323067], y = -0.1656419583486609)
 (x = [0.23334799967244013, 0.5050130221085902, -0.2816651768803523, -0.16175087918145192, 0.8335088145502932, 0.35288552994685213, 0.6365093403700857, 0.5128065476837959, -0.23921147873177498], y = -2.440414150473297)
 (x = [-4.771890822655091, -3.1382451397075415, 3.385442780924466, 3.63262665597109, -11.937606459140962, -5.259820964251124, -0.29230906800357875, -6.649982072126349, 1.9105501623665038], y = 2.5913133409105695)
 (x = [0.227206950247308, 0.2129520024834607, -0.057384609247012795, -0.12428526078339196, 0.40213817616919423, 0.08534756937987968, 0.015269616291582437, 0.48668218430811844, -0.013924728494907336], y = -3.0616459221929335)
 (x = [-10.137715216102338, 5.4808448096748394, -3.6155155022983503, -18.94943173872934, 4.240333428686416, -2.234262354576183, -6.158494774954351, -11.118969737356664, 10.31949211956257], y = 4.54563872418057)

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