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
  ϵ = 3.2
Chains MCMC chain (1000×32×1 Array{Float64, 3}):

Iterations        = 501:1:1500
Number of chains  = 1
Samples per chain = 1000
Wall duration     = 6.77 seconds
Compute duration  = 6.77 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.0312    0.9656    0.0255   1431.7415   871.8009    1.0031    ⋯
    x_raw[1]    0.0320    0.9424    0.0274   1182.1671   818.2163    1.0001    ⋯
    x_raw[2]    0.0228    0.9785    0.0254   1465.7842   553.6736    1.0076    ⋯
    x_raw[3]    0.0130    0.9587    0.0257   1357.0596   678.8443    1.0035    ⋯
    x_raw[4]    0.0077    0.9524    0.0272   1240.1599   807.9263    0.9992    ⋯
    x_raw[5]    0.0226    0.9642    0.0271   1270.6388   610.5548    0.9998    ⋯
    x_raw[6]    0.0541    0.9466    0.0261   1307.8964   847.0356    1.0037    ⋯
    x_raw[7]    0.0217    1.0021    0.0273   1340.6891   662.4274    0.9993    ⋯
    x_raw[8]    0.0187    0.9950    0.0264   1427.2753   737.6439    1.0018    ⋯
    x_raw[9]   -0.0434    0.9968    0.0300   1110.1698   722.9295    1.0027    ⋯
           y    0.0936    2.8967    0.0764   1431.7415   871.8009    1.0031    ⋯
        x[1]    0.4859    6.5745    0.2363    969.6836   677.2613    1.0010    ⋯
        x[2]    0.5069    8.5936    0.2605   1046.4604   824.5427    1.0014    ⋯
        x[3]    0.2067    7.8229    0.2429   1018.0188   663.4155    1.0009    ⋯
        x[4]    0.3255    7.7555    0.2628    973.3717   674.3060    0.9992    ⋯
        x[5]    0.1155    8.4265    0.3028    952.3562   664.9316    1.0002    ⋯
        x[6]    0.6055   11.2357    0.3938    856.8444   717.2317    1.0012    ⋯
      ⋮           ⋮         ⋮         ⋮          ⋮          ⋮          ⋮       ⋱
                                                     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.7673   -0.6441    0.0220    0.7114    1.8531
    x_raw[1]   -1.8181   -0.5885    0.0330    0.6789    1.9028
    x_raw[2]   -1.7976   -0.6450   -0.0016    0.6825    1.9324
    x_raw[3]   -1.8605   -0.6560    0.0350    0.6704    1.8118
    x_raw[4]   -1.8511   -0.6550    0.0059    0.6933    1.7820
    x_raw[5]   -1.7980   -0.6591   -0.0163    0.6853    1.9057
    x_raw[6]   -1.7131   -0.6289    0.0391    0.7332    1.9584
    x_raw[7]   -1.9324   -0.6325    0.0091    0.6607    2.1080
    x_raw[8]   -1.8817   -0.6822    0.0247    0.6940    1.8649
    x_raw[9]   -1.9392   -0.7195   -0.0770    0.6016    1.9380
           y   -5.3020   -1.9322    0.0661    2.1342    5.5592
        x[1]   -8.3089   -0.4920    0.0080    0.7038   10.4641
        x[2]   -7.1687   -0.5720   -0.0004    0.6753   10.8950
        x[3]   -8.1848   -0.5674    0.0135    0.5589    9.8577
        x[4]   -8.3150   -0.5616    0.0033    0.6314   10.5166
        x[5]   -8.3883   -0.5027   -0.0041    0.6181    9.0392
        x[6]   -7.9854   -0.4732    0.0154    0.7100    9.7746
      ⋮           ⋮         ⋮         ⋮         ⋮         ⋮
                                                  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.51 seconds
Compute duration  = 1.51 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.0025    0.9930    0.0268   1391.9366   725.8877    0.9992    ⋯
    x_raw[1]    0.0350    1.0134    0.0305   1097.7013   721.1150    1.0003    ⋯
    x_raw[2]    0.0104    0.9868    0.0238   1736.6171   811.9361    0.9990    ⋯
    x_raw[3]   -0.0037    0.9905    0.0247   1598.7959   963.6624    0.9993    ⋯
    x_raw[4]   -0.0203    1.0226    0.0267   1455.0605   909.1658    1.0001    ⋯
    x_raw[5]   -0.0121    0.9875    0.0201   2469.5512   700.9390    1.0010    ⋯
    x_raw[6]    0.0193    0.9728    0.0250   1504.5517   768.0003    1.0011    ⋯
    x_raw[7]   -0.0344    0.9890    0.0269   1340.8836   836.3523    0.9991    ⋯
    x_raw[8]   -0.0130    1.0218    0.0234   1932.0728   757.8167    0.9994    ⋯
    x_raw[9]   -0.0177    1.0020    0.0237   1748.4500   837.6947    1.0037    ⋯
                                                                1 column omitted

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

       y_raw   -2.1082   -0.6319    0.0238    0.6456    1.9278
    x_raw[1]   -1.8327   -0.6809    0.0386    0.6754    2.0964
    x_raw[2]   -1.8548   -0.6661    0.0471    0.6818    1.9006
    x_raw[3]   -1.8983   -0.6409    0.0109    0.6328    1.9343
    x_raw[4]   -2.0079   -0.7339   -0.0032    0.6536    1.9110
    x_raw[5]   -1.8827   -0.6746   -0.0413    0.6338    1.8967
    x_raw[6]   -1.9051   -0.5433   -0.0175    0.6593    2.0078
    x_raw[7]   -1.9269   -0.7228   -0.0312    0.6302    1.9252
    x_raw[8]   -2.0358   -0.7088   -0.0057    0.6396    2.0423
    x_raw[9]   -1.9185   -0.6794   -0.0259    0.6282    2.0135

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.3755555988457593, -0.29456570098646695, -0.14054961759740636, -0.20597845879022486, -0.8615530681163244, -0.3527714515242185, -0.9169094039506135, 0.7302332545983887, -0.2501529218723469], y = -0.5378264939796613)
 (x = [0.28377622499958033, -0.0805414014675825, 4.7506045268322526e-5, 0.03298582695860521, 0.08041263462366514, 0.04163624846025302, -0.04450230409950174, -0.024166882686652916, 0.16219247133372267], y = -3.591661726555896)
 (x = [0.3212490575465275, 0.1470614895783859, -0.13337088083257992, 0.35133777898978463, -0.040133628154887316, 0.03573221277611858, 0.01688265517325308, -0.28192401995499805, 0.08255263155919022], y = -3.0864178114323577)
 (x = [-0.9043151952015147, -0.6567818030994838, 0.9286348995537606, 0.9994142415664578, -0.204128172845485, 1.4422689721991506, 0.35931869806885974, 0.7186289464827312, -1.9584471397602738], y = 0.3183398712908462)
 (x = [-4.4031176921720325, 3.735788043711895, 3.6463162707329158, -2.0437847221612917, 7.136884099996775, 3.6691170812128857, 1.5781271592095143, -8.864870215807251, 0.2414013949686087], y = 3.5474179125596126)
 (x = [1.3990693845938131, -0.5958297530987321, -0.5664158082811936, -0.9268245488903921, -0.6907126305570443, -0.3138555705511685, -0.9460901018550172, 0.05547899313412939, -0.0979910344816236], y = -0.23900389684961865)
 (x = [0.08792496094157153, -0.10119053408896175, 0.16678301274791052, -0.3398589981887561, 0.3503280740473622, -0.2502217746760859, 0.015505625191095693, 0.3570545618608216, -0.35551251049014526], y = -2.562197829129973)
 (x = [-0.12659122116459215, -0.4900374991449102, -0.3610308226557644, -0.5111113413925324, -0.3122409561224187, -0.3100996946862751, 0.1503134367526279, 0.17474983068850514, -0.22608895088321868], y = -2.6422171008017545)
 (x = [1.5427529641275683, 0.17760653179164473, -3.4769894565423285, -2.2703326002954345, -4.981004452558196, 2.043210559102692, 2.4636059472378964, -1.5636464249901756, 2.8891595858229295], y = 2.7450340055107136)
 (x = [0.028022489472130024, 0.01211537826993658, 0.16307867041436455, 0.2570238632478153, 0.2094234138806831, -0.16259323780583795, -0.09322725097753355, 0.10355605230478425, -0.1847560375006207], y = -2.655806747469139)
 ⋮
 (x = [0.4758160341693236, -0.2553798760652266, -1.7284655240062197, -0.2948903155136449, 1.6276739664824802, -0.6387278910142465, 0.11960357018912121, -2.262413297623888, -1.3787173891857734], y = 0.5210947538106663)
 (x = [-1.095061802247098, 0.4240228945148422, 0.2888603308076258, -0.7974696238154672, -0.08630378100421997, -0.924381711317525, -0.1721670793539972, 0.7072485105785963, -1.019591191704353], y = -0.5598217169005152)
 (x = [-0.7327574912342897, -0.35863877419679346, 0.7194177635059118, -0.5438236587612035, -0.39992642562226066, -0.846728406788244, -0.35163006746530334, -0.016540215890268946, -0.25429959581445405], y = -0.9075199459639081)
 (x = [0.6108441163670111, 0.4967530868613577, -1.8340350622532842, 1.618673614086825, 0.6642949462787205, 2.0003745886336533, 0.7309610536159531, 0.014141130199905969, 0.6376128143247956], y = 0.8905865787422607)
 (x = [-4.802772441688305, -1.7201212310924696, 6.458361848364465, 7.411463883291919, -2.0027784397713253, -2.7980373802095433, 0.10767382529851968, 2.9444749932712626, -6.4292451813728615], y = 2.3699957154272067)
 (x = [0.689408286902895, 0.4718250524829224, -1.0075877545614942, -1.080633814706534, 0.06351727708802084, 0.4487669373882765, -0.0789864376125821, -0.5114137980853736, 0.9363848680784381], y = -1.2665574792496779)
 (x = [1.3683912056405048, -7.12054068431424, -0.17000679790916168, -4.155287491817754, 2.145108656907575, -3.4645071540702195, -7.292309181522661, -0.5424184384844294, 1.139698691366758], y = 2.7657668669244253)
 (x = [1.3683912056405048, -7.12054068431424, -0.17000679790916168, -4.155287491817754, 2.145108656907575, -3.4645071540702195, -7.292309181522661, -0.5424184384844294, 1.139698691366758], y = 2.7657668669244253)
 (x = [1.3839384279326152, -5.231037461457542, -2.2389367687274637, 6.171281635186532, 2.1140067602829635, -0.6030229007379858, -3.3663521233581544, 1.5423158708570162, -1.1567874300333894], y = 2.823410832735071)

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

nts[1]
(x = [0.3755555988457593, -0.29456570098646695, -0.14054961759740636, -0.20597845879022486, -0.8615530681163244, -0.3527714515242185, -0.9169094039506135, 0.7302332545983887, -0.2501529218723469], y = -0.5378264939796613)

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.49 seconds
Compute duration  = 1.49 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.0193    0.9077    0.0280   1056.7223   720.6882    1.0019    ⋯
    x_raw[1]   -0.0507    0.9549    0.0280   1157.5794   627.7129    0.9997    ⋯
    x_raw[2]    0.0370    0.9864    0.0320    947.5368   695.1290    1.0034    ⋯
    x_raw[3]   -0.0235    1.0133    0.0314   1038.7999   609.5113    1.0015    ⋯
    x_raw[4]    0.0244    1.0008    0.0279   1286.9988   645.8146    1.0056    ⋯
    x_raw[5]   -0.0315    0.9848    0.0287   1169.1933   809.1238    0.9995    ⋯
    x_raw[6]    0.0455    1.0177    0.0313   1066.0273   726.3208    1.0017    ⋯
    x_raw[7]   -0.0663    0.9582    0.0331    840.5854   734.1012    0.9992    ⋯
    x_raw[8]   -0.0328    0.9816    0.0279   1235.1229   720.1417    0.9991    ⋯
    x_raw[9]    0.0066    1.0124    0.0306   1103.1854   577.5259    1.0045    ⋯
                                                                1 column omitted

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

       y_raw   -1.7817   -0.5621   -0.0036    0.6388    1.8278
    x_raw[1]   -1.9374   -0.7286   -0.0503    0.6000    1.7687
    x_raw[2]   -1.8634   -0.6152    0.0318    0.7249    1.9173
    x_raw[3]   -2.0137   -0.7463   -0.0125    0.6893    1.8961
    x_raw[4]   -1.9677   -0.6478    0.0414    0.6532    2.0364
    x_raw[5]   -1.8446   -0.6940   -0.0215    0.6172    1.9633
    x_raw[6]   -2.0490   -0.6308    0.0620    0.7315    1.9318
    x_raw[7]   -1.8518   -0.7157   -0.0571    0.5670    1.7184
    x_raw[8]   -1.9322   -0.7045   -0.0328    0.6615    1.8191
    x_raw[9]   -1.9173   -0.6957   -0.0277    0.6931    1.9708

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 = [2.184532520172602, 1.3485883263424114, 2.407387950244651, -5.37935451381601, -4.366434396312612, 2.4683012952774326, -1.4422264927730761, -1.0635788005025826, 8.691515238630567], y = 2.9544379470687474)
 (x = [-1.0771176467915335, -0.7791980368765831, 0.2559969308294434, -0.9748804353092263, 1.0588443415306235, -0.4840653945978974, -1.0179918628540212, 0.21145593088299272, -0.3848607367136941], y = -0.10311091163219077)
 (x = [0.017120577405209128, 0.05818188272242017, 0.49924553328652876, 1.2258170242566035, -0.40667928377529505, 1.0667915159556458, -0.17451678893369735, 0.21362543212228696, 0.2226274402848097], y = -0.10163320476388348)
 (x = [-0.8699947959043562, -4.630937225203654, -2.033453260111407, 0.8872664813086105, -2.757203469953124, 0.529132601974927, 2.0347013554165407, 0.4922346787903561, -0.03657192101662438], y = 1.1954100497979157)
 (x = [0.22176469028123072, 0.7371207469764901, 0.28486423589355714, -0.15634946789351586, 0.44391434769480614, -0.3232736829602395, -0.07071122120825951, -0.27016954194132903, -0.018520096839457528], y = -2.22372787025377)
 (x = [-5.642030595453109, -16.510034413989835, -1.4295511353189603, 3.9242686304239625, -5.388904939234156, 0.5841971031757535, 1.8888581560217257, 3.705446069769572, 2.871082439243429], y = 3.295494577777874)
 (x = [-44.549576609162145, -151.58998239486314, -52.94661858619361, -0.45914924445615196, -17.22900297228913, 18.494073554264574, -75.94967912378729, 12.998251281290742, 24.820707955061202], y = 7.7994829701793265)
 (x = [-57.27721630863206, 33.135285750882495, 27.53623296875378, 27.883881399067118, -7.061358993422872, 12.548201630787576, 62.959778032600894, 7.84295088992854, 43.947160965191436], y = 7.3564587314842305)
 (x = [19.992440297944288, 11.583155998828218, 5.79175247985065, 9.8173315283449, 3.9917126034361288, 0.44101561945345047, 20.379260277093316, -17.620770251498843, 15.676399977338766], y = 5.154640948062025)
 (x = [0.40018919559136457, -0.5774642640621431, -0.49880199269389736, 0.21774211134902582, -0.36405382250983676, -0.6872880157247776, -0.0977608728224778, -0.33934130882234853, -0.16160927796992341], y = -0.5033127667206285)
 ⋮
 (x = [-4.479833675819275, 2.2691976026365994, 0.8358900378204616, -2.5362351516930084, 2.1733735383691104, -9.67901215303294, -8.97699318651528, 5.68142141400359, 1.0578854859269773], y = 2.9130972590888984)
 (x = [1.706863648303854, 7.355743022002683, -0.9450848577374296, 4.1705444039979795, 2.4388756921459454, -0.9121560953700988, -1.3772770523720805, -6.715326761184462, 1.3019599633196273], y = 2.151993692564243)
 (x = [0.33654212357852764, -1.2978551177889595, -0.5951268170778061, 0.35612443370710395, -0.34584572694643423, -0.5724488479869401, -0.0601238706008747, -1.165543323677109, 0.35034454782699787], y = -1.0777505197630848)
 (x = [-0.020070325423441195, -0.16531654005117088, 0.02685655522297318, 0.09779524226482551, -0.2075582760356429, -0.05542440092916852, 0.018033471144521744, -0.14202226626925626, -0.08907606827311178], y = -4.142318016690082)
 (x = [1.6356439960088753, 8.99369460692164, -14.460554405225576, -8.14976543834618, 4.336778579921777, -0.7139431514806089, 4.845642737676665, -5.876247328048408, 3.6231858784467197], y = 3.9819999877516636)
 (x = [-0.020116583204402776, -0.06319531084785415, 0.06271216660722435, 0.04957287732462581, 0.0005210853387998047, -0.006946642982140024, -0.053720954856780904, 0.05690044441457352, -0.020056325671775618], y = -5.877309495412958)
 (x = [-0.0647603813790843, -0.13525097362049107, 0.591080450206128, 0.7491637243939511, -0.29251742531122826, -0.1639508436215307, -0.31756757698939536, -0.8657759375770441, -0.03305091110935863], y = -1.4096275268023808)
 (x = [-0.014496032979738347, -0.0370867600937977, 0.057109000564658355, 0.0026366805137703385, -0.050183408335695075, -0.0358849463392213, 0.013945435694007137, 0.036297089236404824, 0.02460368004387229], y = -6.09998766435762)
 (x = [-0.014105998575343713, -0.030515157661328986, 0.029038562122737095, -0.05447208720485131, -0.07106188572142452, -0.08021263354964277, 0.08446238168011094, -0.07194230842387936, 0.04186541985940562], y = -5.7849549880839675)

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.683449842421827, 0.6642236855139476, -0.9792245552305548, -9.667216631207843, -4.30157243958286, -11.992280795945192, 12.576567078354108, 0.43481092447697756, -3.301608220866944], y = 3.810372002717188)
 (x = [0.08171071651080349, 0.02691179627345421, 0.06693309331757517, 0.09681876970366611, 0.04322587311085865, 0.20748124505013063, -0.13760406434507974, -0.04209717119924654, -0.0030358352699642794], y = -4.934985147589138)
 (x = [-3.510192131874279, -3.382058831547764, -6.06984882520839, -17.129786201885032, -8.121227265070594, -29.32596963207555, 33.17201511301077, 14.091376024708095, -6.629620315408347], y = 5.614202647220605)
 (x = [0.15806155299078592, -1.4053511283455558, -2.445716089816999, -0.22956681894204556, 0.2948214013879404, 0.22449093750389643, -0.28754766536194903, 1.6140213809614021, -1.9539621660178266], y = 0.5153031065766345)
 (x = [-0.06446574963409359, 0.16898905690382626, 0.3352211178749184, -0.14554336137005724, 0.9081711886062335, -0.4450763878011403, -1.54336112362702, 0.11151711289847492, -1.3823930989795044], y = -0.5581833383399272)
 (x = [-0.762279976244555, -5.131566202716762, -1.1243686094866658, -3.0988834733979123, -0.39152791990867825, 0.6764596848426241, -5.234736056101338, 1.5599336913255668, -1.3325563382165841], y = 1.825525632866389)
 (x = [0.8509455820105857, 0.5365085048570676, -0.1514601784707672, 1.1192014073767824, -0.3234688687773588, -0.2760211739968643, 0.13039071035659835, -0.571829117468211, 0.025346134004115325], y = -0.8434744948950497)
 (x = [-0.12797118431486146, 0.15427053260129397, -0.22794835393376112, -0.5498303551264092, 0.2381857001350738, 0.28056776288055274, -0.30740596749195787, -0.2574529706564812, -0.21289577838660767], y = -0.5984442728775689)
 (x = [4.077512167663932, -6.195927674836344, -0.5225330375745467, 3.8012709792700465, 1.4978669516048544, -0.8690773255672162, 0.45226474937671485, 2.9822600502414454, -0.8880053276546686], y = 2.516949776848417)
 (x = [-0.08494823533689039, 0.34735785977334893, 0.03316981332969206, -0.4279655616289698, -0.12055271984632557, 0.22729291977246618, 0.007134136179599492, -0.1489330707429884, 0.010534101727398241], y = -2.7891306757429764)
 ⋮
 (x = [1.898786637172408, -3.8575311862860207, 2.557164183570824, -8.249087661509597, -1.8275960876674096, -5.842044891562612, 0.833566934845951, -4.242418200401783, 0.955181248898363], y = 2.1765616331128763)
 (x = [29.794966680854106, -16.31411467567122, -18.80395870572983, -68.00792049308261, 8.06705154743251, 39.9638156948586, -71.1289354660318, 0.856947589163004, 33.38592376000539], y = 6.651701527398486)
 (x = [0.09378869556673924, 0.15390227591673838, 0.18396696556286768, 0.5169637781730317, 0.16616969427766085, -0.0023793344078285694, 0.10738628707742964, -0.2736757994894813, 0.27611037827659946], y = -3.4099031165583575)
 (x = [-0.019718948258676074, 0.1155484838644014, 0.29954819216687806, 0.2432649250447138, -0.44708174261622374, -0.19230891842309916, -0.16482871772801894, -0.0838359696689606, 0.20601274925017346], y = -2.183659976592317)
 (x = [0.15305657656030985, -0.04940449192766935, -0.035271978076879484, 0.07716837566628973, -0.07338155359293039, -0.06321960224318199, -0.09751668892639657, 0.1029374992166489, 0.1279307547021342], y = -4.675697499101359)
 (x = [-16.701869675048844, -10.337390098565741, 3.487033744503992, 9.983716195553448, -19.860396696853112, 23.4059983893913, 5.962003831174319, -10.38892021053544, -11.658204945867682], y = 5.544316104962103)
 (x = [0.038259784795490526, 0.04242578746838713, 0.032912155681393364, -0.052050990507439096, -0.012686048886224138, -0.011613781384497283, 0.022677140655207522, 0.05016422037777209, 0.005610682228918785], y = -6.415270223067093)
 (x = [-13.747178230265016, -29.044165597149174, -48.94733017575352, 32.531017248453985, 9.00285927905472, 0.6735877025076913, -17.191953603714673, 0.8174085320456314, -25.062134054905847], y = 6.624235716947453)
 (x = [0.5752441279875772, 0.022782071385720987, 0.09109719014454953, -0.11389326596511797, 0.12882751284090974, -0.02338194719897371, 0.10863949582393716, -0.31994719653577036, 0.3504985659307575], y = -1.451807710533112)

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