Comments (4)
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.
@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 tostan
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 (usingrstan::extract
and selecting parameters usingpars
, and settinginc_warmup=TRUE
,permuted=FALSE
). This will give you a 3-d array of parameter draws and you can then uselaunch_shinystan(as.shinystan(X))
ifX
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.
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.
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)
- use posterior package for handling draws HOT 2
- Check for R version 4.0 HOT 1
- selectizeInput for estimates statistics instead of checkboxGroupInput HOT 1
- Default for "max_treedepth"/"max_td" (11) incorrect? HOT 4
- Add support for CmdStanR objects HOT 3
- diagnostics page doesn't load if `stan_used=FALSE`? HOT 1
- Suppress messages when packages are loaded
- how to raise limit above 1000 parameters? HOT 3
- Shiny stan do not work in ubuntu (tested in ubuntu 20.04 and 16.04 both LTS versions)
- variables missing from drop-down HOT 5
- Problem with LaTeX table: ErrorL subscription out of bounds HOT 6
- Latex for graphs like stan_ac, stan_dens, and others HOT 3
- Rocker script?
- Problem with missing themes HOT 13
- Flickering when selecting parameters on page "ESTIMATE"
- gtools is orphaned - Consider a replacement?
- Issue when launching shinystan demo
- launch_shinystan error message
- toggle view for `exp(param)' ?
- Running ‘testthat.R’/opt/local/Library/Frameworks/R.framework/Resources/bin/BATCH: line 60: 98584 Bus error HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shinystan.