Generate a Latin Hypercube of parameters for a given FUSE model

In the previous post I showed how to get information regarding model building options and used parameters for a given FUSE model. In this post I’ll show how to sample (for the given model) a set of 100 parameters uniformly using the Latin Hypercube Sampling method.

Each FUSE model uses different parameters therefore, in order to sample uniformly, we need to remove the unused parameters and then sample. Here is how I achieve this.

Install/load the fuse package:

    install.packages("fuse", repos="http://R-Forge.R-project.org")
    library(fuse)

Now load devtools and source the gist below (it contains a function called GenerateFUSEParameters)

    require(devtools)
    devtools::source_gist("https://gist.github.com/cvitolo/9574a0cef0bf4f2cd28b")

Choose one of FUSE’s models and get model/parameters info using the FUSEinfo function described in the previous post:

    mid <- 60 # This is TOPMODEL
    x <- FUSEinfo(mid)

Now a Latin Hypercube of 100 samples for the above model (mid=60) is defined as follows:

    parameters <- GenerateFUSEParameters(NumberOfRuns = 100, 
                                         params2remove = names(x)[which(x==FALSE)])
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s