# Not getting graph for VPC

**URL:** <https://discourse.pumas.ai/t/not-getting-graph-for-vpc/77>\
**Category:** vpc\
**Created:** [November 18, 2019, 7:39am UTC](https://discourse.pumas.ai/t/not-getting-graph-for-vpc/77 "2019-11-18T07:39:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sai\_matcha](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/sai_matcha/32/297_2.png) [@sai\_matcha](https://discourse.pumas.ai/u/sai_matcha)\
**Post date:** [November 18, 2019, 7:39am UTC](https://discourse.pumas.ai/t/not-getting-graph-for-vpc/77/1 "2019-11-18T07:39:39Z")

</div>

Hi  
i see a graph for `VPC` in working examples . i run some codes for my data and same as working example as well but i’m not able to get any graph for VPC. even i have a confusion about vpc code please tell me which is correct one either ` vpc(res1,3)` or  
`vpc(res1,3) |> plot`

please help me with this

```auto
md = CSV.read("D:\\NONMEMnights\\mould\\julia\\12.3.2\\2comp_iv_data.csv", missingstring=".")

trans = read_pumas(md, id=:id, time=:TIME, dvs=[:dv],)

dian = @model begin
  @param begin
    tvcl ∈ RealDomain(lower=0, init = 1.0)
    tvv ∈ RealDomain(lower=0, init = 20)
    tvQ ∈ RealDomain(lower = 0, init= 1)
    tvv2 ∈ RealDomain(lower = 0, init = 100)
    Ω ∈ PDiagDomain(init=[0.1])
    σ_prop ∈ RealDomain(lower=0,init=0.04)
  end
#end
  @random begin
# η ~ MvNormal(Matrix{Float64}(0.01I, 1, 1))
η ~ MvNormal(Ω)
    #η ~ MvNormal(Ω)
  end
#end
  @pre begin
    CL = tvcl * exp(η[1])
    V = tvv
    V2 = tvv2
    Q = tvQ
  end
#end
 #@covariates WT
#end
  #@dynamics ImmediateAbsorptionModel
    @dynamics begin
        # Depot' = -Ka*Depot
            Central' = Q*(Peripheral/V2) - (CL/V)*Central - Q*(Central/V)

         Peripheral' = Q*(Central/V)-Q*(Peripheral/V2)
    end
#end
@vars begin
       Cent = Central/V
       Peri = Peripheral/V2
   end
  @derived begin
      cp = Cent
     # dv ~ @. Normal(cp,sqrt(cp^2*σ_prop))
      dv ~ @. Normal(cp, sqrt(cp^2*σ_prop)+eps())
    end
end

param =init_param(dian)

sims = simobs(dian,trans,param)
plot(sims)

res1 = fit(dian,trans,param,Pumas.FOCEI())

#infer(res1)

preds = DataFrame(predict(res1))

resids = DataFrame(wresiduals(res1))

ebes = DataFrame(empirical_bayes(res1))

resout = DataFrame(inspect(res1))

vpc(res1,3)

vpc(res1,3) |> plot

```

error is

```auto

vpc(res1,3)|>plot
ERROR: Cannot convert Tuple{Float64,Float64} to series data for plotting
Stacktrace:
 [1] prepareSeriesData(::Tuple{Float64,Float64}) at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\Plots\h3o4c\src\series.jl:15
 [2] convertToAnyVector(::Tuple{Float64,Float64}, ::Dict{Symbol,Any}) at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\Plots\h3o4c\src\series.jl:26
 [3] (::getfield(Plots, Symbol("##143#146")){Dict{Symbol,Any}})(::Tuple{Float64,Float64}) at .\none:0
 [4] iterate(::Base.Generator{Array{Tuple{Float64,Float64},1},getfield(Plots, Symbol("##143#146")){Dict{Symbol,Any}}}) at .\generator.jl:47
 [5] append_any(::Any, ::Vararg{Any,N} where N) at .\essentials.jl:722
 [6] convertToAnyVector(::Array{Tuple{Float64,Float64},1}, ::Dict{Symbol,Any}) at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\Plots\h3o4c\src\series.jl:41
 [7] (::getfield(Plots, Symbol("##143#146")){Dict{Symbol,Any}})(::Array{Tuple{Float64,Float64},1}) at .\none:0
 [8] iterate(::Base.Generator{Array{Any,1},getfield(Plots, Symbol("##143#146")){Dict{Symbol,Any}}}) at .\generator.jl:47
 [9] append_any(::Any, ::Vararg{Any,N} where N) at .\essentials.jl:722
 [10] convertToAnyVector(::Array{Any,1}, ::Dict{Symbol,Any}) at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\Plots\h3o4c\src\series.jl:41
 [11] process_ribbon(::Array{Any,1}, ::Dict{Symbol,Any}) at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\Plots\h3o4c\src\series.jl:62
 [12] macro expansion at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\Plots\h3o4c\src\series.jl:139 [inlined]
 [13] apply_recipe(::Dict{Symbol,Any}, ::Type{Plots.SliceIt}, ::Array{Float64,1}, ::Array{Any,1}, ::Nothing) at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\RecipesBase\zBoFG\src\RecipesBase.jl:275
 [14] _process_userrecipes(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Tuple{Pumas.VPC}) at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\Plots\h3o4c\src\pipeline.jl:83 [15] _plot!(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Tuple{Pumas.VPC}) at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\Plots\h3o4c\src\plot.jl:178
 [16] #plot#133(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}, ::typeof(plot), ::Pumas.VPC) at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\Plots\h3o4c\src\plot.jl:57
 [17] plot at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\Plots\h3o4c\src\plot.jl:51 [inlined]
 [18] |>(::Pumas.VPC, ::typeof(plot)) at .\operators.jl:854
 [19] top-level scope at none:0

```

hope i`m clear

---

<div class="post-metadata">

**Author:** ![andreasnoack](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/andreasnoack/32/22_2.png) [@andreasnoack](https://discourse.pumas.ai/u/andreasnoack)\
**Post date:** [November 18, 2019, 8:13am UTC](https://discourse.pumas.ai/t/not-getting-graph-for-vpc/77/2 "2019-11-18T08:13:28Z")

</div>

> i see a graph for `VPC` in working examples .

Where did you find that example? Unfortunately, VPC isn’t currently supported but we are actively working on the implementation.

---

<div class="post-metadata">

**Author:** ![sai\_matcha](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/sai_matcha/32/297_2.png) [@sai\_matcha](https://discourse.pumas.ai/u/sai_matcha)\
**Post date:** [November 18, 2019, 1:12pm UTC](https://discourse.pumas.ai/t/not-getting-graph-for-vpc/77/3 "2019-11-18T13:12:20Z")

</div>

Thank you Andreasnoack

please find the link of example  
[https://tutorials.pumas.ai/html/exercises/workshop\_solutions.html](https://tutorials.pumas.ai/html/exercises/workshop_solutions.html)

---

<div class="post-metadata">

**Author:** ![andreasnoack](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/andreasnoack/32/22_2.png) [@andreasnoack](https://discourse.pumas.ai/u/andreasnoack)\
**Post date:** [November 18, 2019, 1:26pm UTC](https://discourse.pumas.ai/t/not-getting-graph-for-vpc/77/4 "2019-11-18T13:26:06Z")

</div>

Thanks. Indeed there used to be a `vpc` function but it had to be adjusted and we decided to temporarily remove it until it has been fixed.

---

<div class="post-metadata">

**Author:** ![Vaibhavdixit02](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/vaibhavdixit02/32/86_2.png) [@Vaibhavdixit02](https://discourse.pumas.ai/u/Vaibhavdixit02)\
**Post date:** [August 14, 2020, 1:37pm UTC](https://discourse.pumas.ai/t/not-getting-graph-for-vpc/77/5 "2020-08-14T13:37:38Z")

</div>

Hi Sai,  
You should be able to use `vpc` with the 1.0 release
