PoonLab / KaphiShiny

A Shiny web interface for running Kaphi
0 stars 0 forks source link

combining the branches master and configNumericInputs #9

Closed 0ldM4j0r closed 7 years ago

0ldM4j0r commented 7 years ago

Now that I can generate inputs dynamically in configNumericInputs. I should pass said inputs to the server to initialize a config, from there I should process the data as in the master branch.

0ldM4j0r commented 7 years ago

I have added the code for initialising the config to app.R. I am currently ironing out the errors it returns.

0ldM4j0r commented 7 years ago

I get the following error:

Error in checkName: Must use single string to index into reactivevalues
Stack trace (innermost first):
    71: checkName
    70: [[.reactivevalues
    69: [[
    68: paste0
    67: distribution.parameters [/home/fabusard/git/KaphiShiny/app.R#429]
    66: paste0
    65: observeEventHandler [/home/fabusard/git/KaphiShiny/app.R#443]
     1: runApp

To reproduce run app.R from the configNumericInputs branch then click the Initialize SMC Settings button followed by the Initialize Priors & Proposals button.

When trying isolate the error I changed lin 429 to: distributionParameters[[i]] <- paste0(names(distributions[[distributionString]])[[i]], "=")

That resulted in this error:

Error in [[: attempt to select less than one element in get1index
Stack trace (innermost first):
    67: distribution.parameters [/home/fabusard/git/KaphiShiny/app.R#428]
    66: paste0
    65: observeEventHandler [/home/fabusard/git/KaphiShiny/app.R#445]
     1: runApp
0ldM4j0r commented 7 years ago

I solved the second error by pressing on the Proposals tab before pressing the Initialize Priors & Proposals button, this results in the Proposals inputs being initialized and therefore the get1index error is gone, as it was thrown due to not being able to access the Proposals inputs due to them not existing.

0ldM4j0r commented 7 years ago

I solved the first error b979471, but now an error is thrown when sampling priors:

Warning: Error in sample.priors: ERROR: argument must be an smc.config object
Stack trace (innermost first):
    70: sample.priors
    69: FUN [/home/fabusard/git/KaphiShiny/app.R#457]
    68: lapply
    67: sapply
    66: rbind
    65: observeEventHandler [/home/fabusard/git/KaphiShiny/app.R#457]
     1: runApp

when checking the config before setting the model it appears that the function distribution.parameters didn't work as expected:

$params
[1] "lambda"

$priors
$priors$lambda
[1] "rgamma(n=1,rate=,shape=)"

$prior.densities
$prior.densities$lambda
[1] "dgamma(arg.prior,rate=,shape=)"

$constraints
NULL

$proposals
$proposals$lambda
[1] "rnorm(n=1,mean=,sd=)"

$proposal.densities
$proposal.densities$lambda
[1] "dnorm(arg.delta,mean=,sd=)"

$model
[1] NA

$nparticle
[1] 1000

$nsample
[1] 5

$ess.tolerance
[1] 1.5

$final.epsilon
[1] 0.01

$final.accept.rate
[1] 0.015

$quality
[1] 0.95

$step.tolerance
[1] 1e-05

$dist
[1] "kernel.dist(x,y,decay.factor=0.2,rbf.variance=100.0,sst.control=1.0)"

$decay.factor
[1] 0.2

$rbf.variance
[1] 100

$sst.control
[1] 1

$norm.mode
[1] "NONE"
0ldM4j0r commented 7 years ago

Solved the above error with config 9783a6c42d22f27cbc165665bae52a1049ca352e 231fb37da548a526249881a56250ee6d426603b8

0ldM4j0r commented 7 years ago

Merge was successful bc3f51a2c94c9132257ed867e3d1016691f76f76