Coder Social home page Coder Social logo

Comments (4)

jgabry avatar jgabry commented on June 6, 2024

From @GregoryEady

I'm not sure if my problem is similarly related to the model object size, but I have a similar problem at the moment such that shinyStan won't load at all, even an hour after starting launch_shinystan() (R is running CPU at 100%, and has been for an hour now). For reference, I saved the model object to a .RDS file, which ends up being 2.5GB (a large country-year panel time-series IRT model). Is there any way I can load this in shinyStan, or might this be a separate problem?

from shinystan.

jgabry avatar jgabry commented on June 6, 2024

@GregoryEady since this question was originally posted at the old repository which has an older version of shinystan, first I just want to double check that you're using the latest version, which is the one on CRAN that can be installed with install.packages("shinystan").

Unfortunately even if you're using the new version a 2.5GB object can be a problem. A few questions and suggestions:

  • Which version of RStan did you use to fit the model? I think RStan >= 2.7 produces smaller stanfit objects than earlier versions (due to some issues with environments), so if this was fit using anything before RStan 2.7 maybe refitting it would make it more feasible.
  • If the model contains a lot of parameters but you're only interested in visualizing some of them then you could try fitting the model and using the pars argument to stan to save the draws for only a subset of the parameters.
  • Another option is to extract the parameter draws from the stanfit object for a subset of parameters that you want to visualize (using rstan::extract and selecting parameters using pars, and setting inc_warmup=TRUE, permuted=FALSE). This will give you a 3-d array of parameter draws and you can then use launch_shinystan(as.shinystan(X)) if X is this array. The downside to this option is that some of the plots won't be available because they require the information from the rest of the stanfit object.

from shinystan.

GregoryEady avatar GregoryEady commented on June 6, 2024

The model was fit using Stan 2.7.0-2 and shinystan 2.0.0. The model does indeed contain a very large number of parameters, but fitting the model takes ~36 hours, so I'd rather save all the parameters rather than do it piecewise. I'll see if I can opt for the third option of extracting the parameters manually and then treating them as a shinystan object. I wonder if it would be useful to include an option in launch_shinystan to automate the process of parameter selection so this wouldn't need to be done manually. Then again, perhaps few people have the problem I'm currently having. Thanks for your help! Greatly appreciated!

from shinystan.

mhandreae avatar mhandreae commented on June 6, 2024

Nice and detailed answer. Did you put it on the wiki page so future users
with similar Big Data issues would know?
Cheers
M.
On Sep 9, 2015 10:25 AM, "Jonah Gabry" [email protected] wrote:

@GregoryEady https://github.com/GregoryEady since this question was
originally posted at the old repository which has an older version of
shinystan, first I just want to double check that you're using the latest
version, which is the one on CRAN that can be installed with
install.packages("shinystan").

Unfortunately even if you're using the new version a 2.5GB object can be a
problem. A few questions and suggestions:

Which version of RStan did you use to fit the model? I think RStan >=
2.7 produces smaller stanfit objects than earlier versions (due to some
issues with environments), so if this was fit using anything before RStan
2.7 maybe refitting it would make it more feasible.

If the model contains a lot of parameters but you're only interested
in visualizing some of them then you could try fitting the model and using
the pars argument to stan to save the draws for only a subset of the
parameters.

Another option is to extract the parameter draws from the stanfit
object for a subset of parameters that you want to visualize (using
rstan::extract and selecting parameters using pars, and setting
inc_warmup=TRUE, permuted=FALSE). This will give you a 3-d array of
parameter draws and you can then use launch_shinystan(as.shinystan(X))
if X is this array. The downside to this option is that some of the
plots won't be available because they require the information from the rest
of the stanfit object.


Reply to this email directly or view it on GitHub
#13 (comment).

from shinystan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.