MULAN
A Film Review by Brian Takeshita
Rating: *** out of ****
You've got to love Disney. No matter what they serve up, it is a guaranteed success as long as it's animated. Kids have to go see the movie. Then they have to get the toys. Oh, the video came out? Got to buy it, or risk little Billy's temper tantrums for the next month. All of this culminates in the childhood equivalent of a pilgrimage to Mecca: A visit to the Magic Kingdom. Stay at the Disneyland Hotel! Buy a Disney t-shirt! Eat an ice cream Mickey Mouse on a stick! It's both a vertical and horizontal monopoly when you think about it. Dale Carnegie should have had it so good. What's most amazing is that all this success is in spite of a severe lack of originality. You see, Disney animated features these days have two components: Theme and plot. The theme changes with each new movie; the plot does not. The plot is a mold into which the characters of some ancient fable are dropped, and try as they might to rise above the characters of previous features, they are nearly always destined to do no more than the same. However, while the success of a Disney animated feature is generally a given as far as box-office receipts, merchandising dollars, and glimmers in the eyes of little children, critically they are as varied as anything else that Hollywood has to offer. Luckily, Disney's latest animated offering, MULAN, manages to be engaging and refreshing, even while rife with formula.
The film starts with the invasion of ancient China by the Huns, led by the imposing Shan-Yu (Miguel Ferrer). Soon, China's emperor (Pat Morita) mobilizes his armies and decrees that one male from each family in the country shall serve to fight in China's defense. When the Fa family is served notice, it is the elderly father, Fa Zhou (Soon-Tek Oh) who must answer the call, as there are no other males in the household. Fearing her father will surely be killed in battle, Fa Mulan (Ming-Na Wen) disguises herself as a man and sneaks off with the royal orders to join the Chinese army.
 Mulan herself is a disgrace to her loving family, as she has a difficult time fitting into the traditional woman's role, and in a very amusing scene where a matchmaker attempts to assess her value to a potential husband, we see that "grace" is not one of her strong points. Very early on, we are presented with the high importance of bringing honor to one's family, and by botching her chance at gaining the favor of the matchmaker, Mulan fails at that task. By leaving home to fight in her father's place, she may not only spare his life, but bring honor, too.
As is the case with most Disney musicals, the songs are first rate and pervasive throughout the film. I'm not sure if they will get much airplay, but at least one of the songs will no doubt receive recognition come Oscar time. Both Lea Salonga, who provides the singing voice for Mulan, and Donny Osmond who sings for Shang, the captain of Mulan's army unit and obligatory love interest, are more than competent, although Salonga's voice translates much better to animation. You have to hear it to understand.
Interestingly, the musical numbers which are so often done with big flourishes are surprisingly muted in MULAN. There is no significantly big number, which is customary as the second or third song in a Disney film, but this does not detract significantly from the rest of the movie. It is, however, an expectation which has been built by Disney's own formulaic history, and some viewers may feel as if something is missing.
Artistically, the animators have chosen to adopt the more subdued pastels of Chinese artwork, and although this may not live up to the vibrance so associated with many of the other Disney works, it helps to contribute a more authentic, and therefore more credible, nature to what otherwise may be seen as a typically "Disneyfied" ethnic tale. There are also a couple of visually standout scenes, one involving the charge of Shan-Yu's Hun army, which utilizes the same computer-enhanced imagery Disney animators have employed since the chandelier in BEAUTY AND THE BEAST. The other scene worth mentioning is so quick you might miss it. When Mulan resolves to take her father's place, she dons her father's old battle armor, and unsheathes a sword. As she does so, you can see her reflection in the polished metal. It just left me thinking, "That was really cool."
A wonderful range of performances delight the audience throughout the film, varying from the straight, such as Soon-Tek Oh as Fa Zhou, to the comical, such as Harvey Fierstein as Yao, a gruff, pugilistic member of Shang's conscripted army. Even more outrageous is Eddie Murphy as Mushu, the diminutive guardian dragon sent to look after Mulan. Although an obvious attempt to relive the chemistry brought forth by Robin Williams in ALADDIN, Murphy nevertheless distinguishes himself with his own winning performance. I found the choice of B.D. Wong as Shang a little strange (you may remember him as Martin Short's wedding planner assistant in THE FATHER OF THE BRIDE), but they used Robbie Benson for the voice of the Beast in BEAUTY AND THE BEAST, so I guess anything's possible. In any event, Wong performs admirably as well.
One character which provides a significant amount of humor is Grandmother Fa. She deserves recognition not only because of the levity she brings to the movie, but also because she is voiced by two very remarkable people. June Foray, who supplies Grandmother Fa's speaking voice, is a venerable voice actress who may be best known for her work as Rocky the Squirrel and Natasha Fatale (as in Boris and Natasha). Marni Nixon, who provides Grandmother Fa's singing voice, is the same vocalist who dubbed the voices for Anna in THE KING AND I, Maria in WEST SIDE STORY, and Eliza in MY FAIR LADY.
MULAN is the latest Disney animated feature to get away from some of the eurocentrism which for so long dominated Disney films. In an effort to be culturally sensitive (and to avoid a "Miss Saigon"-type debacle), Disney has also wisely chosen to employ many Asian-American actors for both lead and supporting roles. In addition to the actors already mentioned, the cast includes such ubiquitous talents as James Hong, Gedde Watanabe, James Shigeta, and George Takei. I guess Clyde Kusatsu wasn't available.
At a running time of slightly under an hour and a half, MULAN moves quickly and provides solid entertainment for both children and, happily, adults. This is the kind of Disney feature that makes you wonder what they will do next, rather than hope that the next one is better.
Review posted July 7, 1998
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


|
An exciting change has taken place at our practice. Family Doctors of Belleview, whom you have trusted with your family’s health, is growing. We have joined with The Villages Health and effective July 1st only our name will change. Your FDB doctor will still be your Villages Health doctor. What does this mean for you? It means you will see and hear some changes at our practice in the coming weeks such as -
If you have not signed up for your online medical record account please call our Belleview office at<PHONE_NUMBER> or our Sharon Morse office at<PHONE_NUMBER> to get your user name and password to access your secure Villages Health medical record account. If you already have your user name and password enter the following address in your web browser address bar, or click on the following link https://health.eclinicalworks.com/tvhportal. What hasn’t changed are the physicians and familiar faces you are used to seeing when you come to the practice, as well as the excellent care and customer service you are accustomed to receiving. We are excited as we move forward to the next phase of this endeavor and want to assure you that we will make this transition as seamless as possible for you, our valued patient. Sincerest Regards, Family Doctors of Belleview |


Logo
HOME
LOGIN
SING UP
Search Results
Beef Stake
100
birr
4Kilo
Beef Stake
100
birr
4Kilo
Beef Stake
100
birr
4Kilo
Beef Stake
100
birr
4Kilo


DocStrap
DocStrap is Bootstrap based template for JSDoc3. In addition, it includes all of the themes from Bootswatch giving you a great deal of look and feel options for your documentation. Additionally, it adds some options to the conf.json file that gives you even more flexibility to tweak the template to your needs. It will also make your teeth whiter.
Features
- Fixed navigation at page top
- Right side TOC for navigation in pages
- Themed
- Customizable
What It Looks Like
Here are examples of this template with the different Bootswatch themes:
To change your theme, just change it in the conf.json
file. See below for details.
Ooooh, I want it! How do I get it?
First grab the zip file from github. Unzip it to your favorite hard drive and ask JSDoc to use it. Like so:
<path/to/jsdoc>/jsoc mysourcefiles/* -t <path.to.unzipped>/template -c <path.to.unzipped>/conf.json <path.to.output>/
Also take a gander at JSDoc's command line options.
Configuring the template
DocStrap ships with a conf.json
file in the template/ directory. It is just a regular old
JSDoc configuration file, but with the following new options:
"templates": {
"systemName" : "{string}",
"footer" : "{string}",
"copyright" : "{string}",
"navType" : "{vertical|inline}",
"theme" : "{theme}",
"linenums" : {boolean},
"collapseSymbols" : {boolean},
"inverseNav" : {boolean}
}
Options
- systemName The name of the system being documented. This will appear in the page title for each page
- footer Any markup want to appear in the footer of each page. This is not processed at all, just printed exactly as you enter it
- copyright You can add a copyright message below the footer and above the JSDoc timestamp at the bottom of the page
- navType
The template uses top level navigation with dropdowns for the contents of each category. On large systems these dropdowns
can get large enough to expand beyond the page. To make the dropdowns render wider and stack the entries vertically, set this
option to
"inline"
. Otherwise set it to"vertical"
to make them regular stacked dropdowns. - theme
This is the name of the them you want to use in all lowercase. The valid options are
amelia
cerulean
cosmo
cyborg
flatly
journal
readable
simplex
slate
spacelab
spruce
superhero
united
- linenums When true, line numbers will appear in the source code listing. If you have also turned that on.
- collapseSymbols
If your pages have a large number of symbols, it can be easy to get lost in all the text. If you turn this to
true
all of the symbols in the page will roll their contents up so that you just get a list of symbols that can be expanded and collapsed. - inverseNav
Bootstrap navbars come in two flavors, regular and inverse where inverse is generally higher contrast. Set this to
true
to use the inverse header.
Customizing DocStrap
No template can meet every need and customizing templates is a favorite pastime of....well, no-one, but you may need to anyway.
First make sure you have bower and grunt-cli installed.
Fetch the source using git
or grab the zip file from github. and unzip
it somewhere. Everything that follows happens in the unzip directory.
Next, prepare the environment:
bower install
and
grunt install
When that is done, you have all of the tools to start modifying the template. The template, like Bootstrap, used less.
The way it works is that ./styles/main.less
pulls in the bootstrap files uncompiled so that you have access to all of bootstraps mixins, colors,
etc, that you would want. There are two more files in that directory, variables.less
, bootswatch.less
. These are the
theme files and you can modify them, but keep in mind that if you apply a new theme (see below) those files will be overwritten. It is best
to keep your changes to the main.less
file.
To compile your changes to main.less
and any other files it loads up,
grunt less
The output is will be put in ./template/static/styles/site.<theme-name>.css
. The next time you create your documentation, it
will have the new css file included.
To apply a different template to the styles
directory to modify, open up the conf.json
in the template directory and
change the theme
option to the theme you want. Then
grunt apply
And the new theme will be in variables.less
, bootswatch.less
. Don't forget to compile your changes using grunt apply
to
get that change into the template.
NOTE that these steps are not necessary to just change the theme, this is only to modify the theme. If all you want to do is change the theme, just update conf.json with the new theme and build your docs!
Contributing
Yes! Contribute! Test! Share your ideas! Report Bugs!
Roadmap
- Integrate Darkstrap
- Make plain old bootstrap an option (doh!)
Jump to source line numbers- Document publish.js
History
v0.2.0
- Added jump to source linenumers - still a problem scrolling with fixed header
- changed syntax highlighter to sunlight
- Modify incoming bootswatch files to make font calls without protocol.
v0.1.0
Initial release
Notices
If you like DocStrap, be sure and check out these excellent projects and support them!
JSDoc3 is licensed under the Apache License
DocStrap is licensed under the MIT license.
License
DocStrap Copyright (c) 2012-2013Terry Weiss. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Toggle navigation
Home
Menu
About
Gallery
Location
"Fruit Cups" by PleaseRomaineCalm is licensed under CC BY 2.0
"Apples" by Nutrition, Food Safety & Health is marked with CC0 1.0
"City Java smoothies" by khawkins04 is licensed under CC BY 2.0
Previous
Next
Gallery
×


Awesome Sauce
is AWeSOME!@#$
Blink
Bring back the blink tag by adding the
blink
class to any textual element.


Consider reading 64K of contiguous data from a single disk. What are the differences between performing one 64K read or eight separate 8K reads? The total transfer time would be the same. But the single multiblock read would require only one seek and one rotational latency, whereas the eight separate reads might require extra seeks and rotational latencies depending on whether the disk had to service other requests in the interim. Also, the CPU usage of the eight separate reads would include eight times more overhead than the one multiblock read. In terms of resource usage, the only benefit of the eight separate reads is that they can conceivably all use the same 8K memory buffer, whereas the multiblock read might require a 64K memory buffer. The only other potentially significant difference is that the multiblock read would take longer to return the first block of data to the application for it to begin processing.
So, a large multiblock read size improves raw and direct I/O throughput significantly and reduces CPU usage, at the expense of a tiny increase in memory usage and a slight reduction in the "first rows" response times. This response time impact is of little concern. Multiblock reads are only performed for full table scans and fast full index scans, and these execution plans should not normally be used if response times are more important than throughput. So the multiblock read size should be as large as possible if you use raw or direct I/O (which you should). Unfortunately, finding and using the maximum effective multiblock read count possible for your database is not always easy. Find out how.
Of course, the foregoing only applies to unbuffered I/O. If you use buffered I/O the operating system will service multiblock reads as a series of small I/O operations anyway and so there will be almost no benefit in using a large multiblock read size, only a small saving in CPU usage. On the other hand, there is no point in using a small multiblock read size either, because the file system read ahead mechanism will be triggered anyway. So for buffered I/O, it is best to match the multiblock read size to the file system read ahead size exactly, in order to make optimum use of track buffering and file system read ahead.
You will notice that we are speaking of the multiblock read size as a constant, even though it is tunable - indeed it is session-modifiable. However, it is best to regard its setting as fixed from database creation because it is a factor in determining the optimal extent sizes for your database, and it is also a key factor in choosing the stripe element size for disk striping. Once these things have been fixed, they are not readily changed and so the multiblock read size should not be changed either.
Of the other read count parameters, there is no reason to use anything less than the maximum effective value for the _db_file_direct_io_count parameter. This parameter dictates the size of the multiblock I/O operations performed for all Oracle direct I/O except sorts and hash joins. The size of the multiblock I/O operations for sorts and hash joins are set by the _sort_multiblock_read_count and _hash_multiblock_io_count parameters. Although the principle that "large reads are efficient" also applies to these parameters, there are other factors that need to be considered, and so much greater care is needed here. Please use the search button below for information about setting the sort and hash multiblock read sizes.
|
© Ixora Pty Ltd. All rights reserved.
05-Apr-2002 |
|


1 Samuel 8:19
Nevertheless the people refused to obey the voice of Samuel; and they said, Nay; but we will have a king over us;


Noodles are a staple food in many cultures made from unleavened dough which is stretched, extruded, or rolled flat and cut into one of a variety of shapes
Pasta is anoodle made from an unleavened dough of a durum wheat flour mixed with water or eggs and formed into sheets or various shapes, then cooked by boiling or baking
The Breakfast Special is the first official release from the band Chasing Morgan, released in early 2011. The EP was produced by Kevin Johnston at Orca Sound Studios.
Sushi is a traditional Japanese food, either as a snack or a meal.It has a very interesting orgin ,that has lasted for centuries and continues to be a very popular food today.


Getting Started
Creating a new mapping class
- Copy the Frog.Orm.dll assembly to the Lib directory of your project.
- Add a reference to the assembly.
- Next, add a new empty class.
- Add public properties to the class, that matches your database schema (column
types and names) like in the example below.
1: [Table]
2: public class User
3: {
4: [PrimaryKey]
5: public long Id { get; set; }
6:
7: [Column]
8: public string Name { get; set; }
9: }
Retrieving data from the database
In order to retrieve data you first create a mapping class, that matches the structure of the data you are trying to fetch. Next, you can instantiate a Repository object that will actually fetch the data. See example below.1: public void Test()
2: {
3: using(var connection = new Connection("<connection string>");)
4: {
5: var repository = new Repository(connection)
6: var users = repository.GetAll<User>();
7:
8: foreach(var user in users)
9: {
10: Console.WriteLine(user.Name);
11: }
12: }
13: }
Naturally you can also perform more complicated queries using a repository. For instance you also want to get the users that meet a certain criteria. See the example below.
1: public void Test()
2: {
3: using(var connection = new Connection("<connection string>");)
4: {
5: var repository = new Repository(connection)
6: var users = repository.GetWhere<User>(Field.And(
7: Field.Equals("Name", "John"),
8: Field.GreaterThan("Age", 45)
9: )
10: );
11:
12: foreach(var user in users)
13: {
14: Console.WriteLine(user.Name);
15: }
16: }
17: }
Storing data in the database
As with retrieving data, you need a mapping class to store data in the database. In most situations you can use the same mapping class that is used when fetching data. You can create a new instance of your object, and provide it as a parameter to the Create or Update method on a Repository object. See example below.1: public void Test()
2: {
3: using(var connection = new Connection("<connection string>"))
4: {
5: var repository = new Repository(connection)
6: var user = new User();
7: user.Name = "Bill Gates";
8:
9: user = repository.Create(user);
10:
11: connection.CommitChanges();
12: }
13: }


{% if teams %}
Number
Name
Time
Pts
{% for team in teams %}
{{ team.warnings }}
{{ team.number }}
{{ team.name }}
{{ team.play_time }}
{{ team.score }}
{{ team.chart_script|safe }}
{% endfor %}
{% else %}
Teams (separated by commas):
{% endif %}


The $optimize()
method of a CmdStanModel
object runs
Stan's optimizer to obtain a posterior mode (penalized maximum likelihood)
estimate.
Any argument left as NULL
will default to the default value used by the
installed version of CmdStan. See the
CmdStan User’s Guide
for more details.
optimize( data = NULL, seed = NULL, refresh = NULL, init = NULL, save_latent_dynamics = FALSE, output_dir = NULL, output_basename = NULL, sig_figs = NULL, threads = NULL, opencl_ids = NULL, algorithm = NULL, init_alpha = NULL, iter = NULL, tol_obj = NULL, tol_rel_obj = NULL, tol_grad = NULL, tol_rel_grad = NULL, tol_param = NULL, history_size = NULL )
| data | (multiple options) The data to use for the variables specified in
the
|
|---|---|
| seed | (positive integer(s)) A seed for the (P)RNG to pass to CmdStan.
In the case of multi-chain sampling the single |
| refresh | (non-negative integer) The number of iterations between
printed screen updates. If |
| init | (multiple options) The initialization method to use for the
variables declared in the
|
| save_latent_dynamics | (logical) Should auxiliary diagnostic information
about the latent dynamics be written to temporary diagnostic CSV files?
This argument replaces CmdStan's |
| output_dir | (string) A path to a directory where CmdStan should write
its output CSV files. For interactive use this can typically be left at
|
| output_basename | (string) A string to use as a prefix for the names of the output CSV files of CmdStan.
|
| sig_figs | (positive integer) The number of significant figures used
when storing the output values. By default, CmdStan represent the output
values with 6 significant figures. The upper limit for |
| threads | (positive integer) If the model was
compiled with threading support, the number of
threads to use in parallelized sections (e.g., when
using the Stan functions |
| opencl_ids | (integer vector of length 2) The platform and
device IDs of the OpenCL device to use for fitting. The model must
be compiled with |
| algorithm | (string) The optimization algorithm. One of |
| init_alpha | (positive real) The initial step size parameter. |
| iter | (positive integer) The maximum number of iterations. |
| tol_obj | (positive real) Convergence tolerance on changes in objective function value. |
| tol_rel_obj | (positive real) Convergence tolerance on relative changes in objective function value. |
| tol_grad | (positive real) Convergence tolerance on the norm of the gradient. |
| tol_rel_grad | (positive real) Convergence tolerance on the relative norm of the gradient. |
| tol_param | (positive real) Convergence tolerance on changes in parameter value. |
| history_size | (positive integer) The size of the history used when approximating the Hessian. Only available for L-BFGS. |
A CmdStanMLE
object.
CmdStan can find the posterior mode (assuming there is one). If the posterior is not convex, there is no guarantee Stan will be able to find the global mode as opposed to a local optimum of log probability. For optimization, the mode is calculated without the Jacobian adjustment for constrained variables, which shifts the mode due to the change of variables. Thus modes correspond to modes of the model as written.
The CmdStanR website (mc-stan.org/cmdstanr) for online documentation and tutorials.
The Stan and CmdStan documentation:
Stan documentation: mc-stan.org/users/documentation
CmdStan User’s Guide: mc-stan.org/docs/cmdstan-guide
Other CmdStanModel methods:
model-method-check_syntax
,
model-method-compile
,
model-method-generate-quantities
,
model-method-sample_mpi
,
model-method-sample
,
model-method-variational
# \dontrun{ library(cmdstanr) library(posterior) library(bayesplot) color_scheme_set("brightblue") # Set path to CmdStan # (Note: if you installed CmdStan via install_cmdstan() with default settings # then setting the path is unnecessary but the default below should still work. # Otherwise use the `path` argument to specify the location of your # CmdStan installation.) set_cmdstan_path(path = NULL)#># Create a CmdStanModel object from a Stan program, # here using the example model that comes with CmdStan file <- file.path(cmdstan_path(), "examples/bernoulli/bernoulli.stan") mod <- cmdstan_model(file)#>mod$print()#> data { #> int<lower=0> N; #> int<lower=0,upper=1> y[N]; #> } #> parameters { #> real<lower=0,upper=1> theta; #> } #> model { #> theta ~ beta(1,1); // uniform prior on interval 0,1 #> y ~ bernoulli(theta); #> }# Data as a named list (like RStan) stan_data <- list(N = 10, y = c(0,1,0,0,0,0,0,0,0,1)) # Run MCMC using the 'sample' method fit_mcmc <- mod$sample( data = stan_data, seed = 123, chains = 2, parallel_chains = 2 )#> Running MCMC with 2 parallel chains... #> #> Chain 1 Iteration: 1 / 2000 [ 0%] (Warmup) #> Chain 1 Iteration: 100 / 2000 [ 5%] (Warmup) #> Chain 1 Iteration: 200 / 2000 [ 10%] (Warmup) #> Chain 1 Iteration: 300 / 2000 [ 15%] (Warmup) #> Chain 1 Iteration: 400 / 2000 [ 20%] (Warmup) #> Chain 1 Iteration: 500 / 2000 [ 25%] (Warmup) #> Chain 1 Iteration: 600 / 2000 [ 30%] (Warmup) #> Chain 1 Iteration: 700 / 2000 [ 35%] (Warmup) #> Chain 1 Iteration: 800 / 2000 [ 40%] (Warmup) #> Chain 1 Iteration: 900 / 2000 [ 45%] (Warmup) #> Chain 1 Iteration: 1000 / 2000 [ 50%] (Warmup) #> Chain 1 Iteration: 1001 / 2000 [ 50%] (Sampling) #> Chain 1 Iteration: 1100 / 2000 [ 55%] (Sampling) #> Chain 1 Iteration: 1200 / 2000 [ 60%] (Sampling) #> Chain 1 Iteration: 1300 / 2000 [ 65%] (Sampling) #> Chain 1 Iteration: 1400 / 2000 [ 70%] (Sampling) #> Chain 1 Iteration: 1500 / 2000 [ 75%] (Sampling) #> Chain 1 Iteration: 1600 / 2000 [ 80%] (Sampling) #> Chain 1 Iteration: 1700 / 2000 [ 85%] (Sampling) #> Chain 1 Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 1 Iteration: 1900 / 2000 [ 95%] (Sampling) #> Chain 1 Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 2 Iteration: 1 / 2000 [ 0%] (Warmup) #> Chain 2 Iteration: 100 / 2000 [ 5%] (Warmup) #> Chain 2 Iteration: 200 / 2000 [ 10%] (Warmup) #> Chain 2 Iteration: 300 / 2000 [ 15%] (Warmup) #> Chain 2 Iteration: 400 / 2000 [ 20%] (Warmup) #> Chain 2 Iteration: 500 / 2000 [ 25%] (Warmup) #> Chain 2 Iteration: 600 / 2000 [ 30%] (Warmup) #> Chain 2 Iteration: 700 / 2000 [ 35%] (Warmup) #> Chain 2 Iteration: 800 / 2000 [ 40%] (Warmup) #> Chain 2 Iteration: 900 / 2000 [ 45%] (Warmup) #> Chain 2 Iteration: 1000 / 2000 [ 50%] (Warmup) #> Chain 2 Iteration: 1001 / 2000 [ 50%] (Sampling) #> Chain 2 Iteration: 1100 / 2000 [ 55%] (Sampling) #> Chain 2 Iteration: 1200 / 2000 [ 60%] (Sampling) #> Chain 2 Iteration: 1300 / 2000 [ 65%] (Sampling) #> Chain 2 Iteration: 1400 / 2000 [ 70%] (Sampling) #> Chain 2 Iteration: 1500 / 2000 [ 75%] (Sampling) #> Chain 2 Iteration: 1600 / 2000 [ 80%] (Sampling) #> Chain 2 Iteration: 1700 / 2000 [ 85%] (Sampling) #> Chain 2 Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 2 Iteration: 1900 / 2000 [ 95%] (Sampling) #> Chain 2 Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 1 finished in 0.0 seconds. #> Chain 2 finished in 0.0 seconds. #> #> Both chains finished successfully. #> Mean chain execution time: 0.0 seconds. #> Total execution time: 0.2 seconds.#> # A tibble: 2 x 10 #> variable mean median sd mad q5 q95 rhat ess_bulk ess_tail #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 lp__ -7.29 -7.00 0.754 0.347 -8.80 -6.75 1.00 872. 638. #> 2 theta 0.253 0.236 0.123 0.124 0.0755 0.482 1.00 603. 533.#> # A draws_array: 1000 iterations, 2 chains, and 2 variables #> , , variable = lp__ #> #> chain #> iteration 1 2 #> 1 -6.8 -8.5 #> 2 -7.3 -8.7 #> 3 -7.1 -6.8 #> 4 -7.1 -6.8 #> 5 -7.1 -7.3 #> #> , , variable = theta #> #> chain #> iteration 1 2 #> 1 0.30 0.51 #> 2 0.13 0.53 #> 3 0.16 0.31 #> 4 0.37 0.31 #> 5 0.15 0.14 #> #> # ... with 995 more iterations#> # A draws_df: 1000 iterations, 2 chains, and 2 variables #> lp__ theta #> 1 -6.8 0.30 #> 2 -7.3 0.13 #> 3 -7.1 0.16 #> 4 -7.1 0.37 #> 5 -7.1 0.15 #> 6 -7.5 0.12 #> 7 -7.2 0.38 #> 8 -6.8 0.22 #> 9 -7.0 0.34 #> 10 -6.8 0.22 #> # ... with 1990 more draws #> # ... hidden reserved variables {'.chain', '.iteration', '.draw'}#>#> Processing csv files: /var/folders/h6/14xy_35x4wd2tz542dn0qhtc0000gn/T/RtmpEmZKF5/bernoulli-202104151127-1-84bf38.csv, /var/folders/h6/14xy_35x4wd2tz542dn0qhtc0000gn/T/RtmpEmZKF5/bernoulli-202104151127-2-84bf38.csv #> #> Checking sampler transitions treedepth. #> Treedepth satisfactory for all transitions. #> #> Checking sampler transitions for divergences. #> No divergent transitions found. #> #> Checking E-BFMI - sampler transitions HMC potential energy. #> E-BFMI satisfactory for all transitions. #> #> Effective sample size satisfactory. #> #> Split R-hat values satisfactory all parameters. #> #> Processing complete, no problems detected.fit_mcmc$cmdstan_summary()#> Inference for Stan model: bernoulli_model #> 2 chains: each with iter=(1000,1000); warmup=(0,0); thin=(1,1); 2000 iterations saved. #> #> Warmup took (0.0070, 0.0060) seconds, 0.013 seconds total #> Sampling took (0.018, 0.017) seconds, 0.035 seconds total #> #> Mean MCSE StdDev 5% 50% 95% N_Eff N_Eff/s R_hat #> #> lp__ -7.3 3.0e-02 0.75 -8.8 -7.0 -6.8 628 17943 1.0 #> accept_stat__ 0.93 2.6e-03 0.11 0.67 0.97 1.0 1.9e+03 5.3e+04 1.0e+00 #> stepsize__ 0.96 3.0e-02 0.030 0.93 0.99 0.99 1.0e+00 2.9e+01 1.1e+13 #> treedepth__ 1.4 2.2e-02 0.51 1.0 1.0 2.0 5.5e+02 1.6e+04 1.0e+00 #> n_leapfrog__ 2.7 2.8e-01 1.5 1.0 3.0 7.0 2.9e+01 8.3e+02 1.0e+00 #> divergent__ 0.00 nan 0.00 0.00 0.00 0.00 nan nan nan #> energy__ 7.8 3.9e-02 1.0 6.8 7.5 9.9 7.0e+02 2.0e+04 1.0e+00 #> #> theta 0.25 5.0e-03 0.12 0.075 0.24 0.48 608 17385 1.00 #> #> Samples were drawn using hmc with nuts. #> For each parameter, N_Eff is a crude measure of effective sample size, #> and R_hat is the potential scale reduction factor on split chains (at #> convergence, R_hat=1).# For models fit using MCMC, if you like working with RStan's stanfit objects # then you can create one with rstan::read_stan_csv() # stanfit <- rstan::read_stan_csv(fit_mcmc$output_files()) # Run 'optimize' method to get a point estimate (default is Stan's LBFGS algorithm) # and also demonstrate specifying data as a path to a file instead of a list my_data_file <- file.path(cmdstan_path(), "examples/bernoulli/bernoulli.data.json") fit_optim <- mod$optimize(data = my_data_file, seed = 123)#> Initial log joint probability = -9.51104 #> Iter log prob ||dx|| ||grad|| alpha alpha0 # evals Notes #> 6 -5.00402 0.000103557 2.55661e-07 1 1 9 #> Optimization terminated normally: #> Convergence detected: relative gradient magnitude is below tolerance #> Finished in 0.1 seconds.fit_optim$summary()#> # A tibble: 2 x 2 #> variable estimate #> <chr> <dbl> #> 1 lp__ -5.00 #> 2 theta 0.2# Run 'variational' method to approximate the posterior (default is meanfield ADVI) fit_vb <- mod$variational(data = stan_data, seed = 123)#> ------------------------------------------------------------ #> EXPERIMENTAL ALGORITHM: #> This procedure has not been thoroughly tested and may be unstable #> or buggy. The interface is subject to change. #> ------------------------------------------------------------ #> Gradient evaluation took 9e-06 seconds #> 1000 transitions using 10 leapfrog steps per transition would take 0.09 seconds. #> Adjust your expectations accordingly! #> Begin eta adaptation. #> Iteration: 1 / 250 [ 0%] (Adaptation) #> Iteration: 50 / 250 [ 20%] (Adaptation) #> Iteration: 100 / 250 [ 40%] (Adaptation) #> Iteration: 150 / 250 [ 60%] (Adaptation) #> Iteration: 200 / 250 [ 80%] (Adaptation) #> Success! Found best value [eta = 1] earlier than expected. #> Begin stochastic gradient ascent. #> iter ELBO delta_ELBO_mean delta_ELBO_med notes #> 100 -6.262 1.000 1.000 #> 200 -6.263 0.500 1.000 #> 300 -6.307 0.336 0.007 MEDIAN ELBO CONVERGED #> Drawing a sample of size 1000 from the approximate posterior... #> COMPLETED. #> Finished in 0.1 seconds.fit_vb$summary()#> # A tibble: 3 x 7 #> variable mean median sd mad q5 q95 #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 lp__ -7.18 -6.94 0.588 0.259 -8.36 -6.75 #> 2 lp_approx__ -0.515 -0.221 0.692 0.303 -2.06 -0.00257 #> 3 theta 0.263 0.246 0.115 0.113 0.106 0.481#># Specifying initial values as a function fit_mcmc_w_init_fun <- mod$sample( data = stan_data, seed = 123, chains = 2, refresh = 0, init = function() list(theta = runif(1)) )#> Running MCMC with 2 sequential chains... #> #> Chain 1 finished in 0.0 seconds. #> Chain 2 finished in 0.0 seconds. #> #> Both chains finished successfully. #> Mean chain execution time: 0.0 seconds. #> Total execution time: 0.4 seconds.fit_mcmc_w_init_fun_2 <- mod$sample( data = stan_data, seed = 123, chains = 2, refresh = 0, init = function(chain_id) { # silly but demonstrates optional use of chain_id list(theta = 1 / (chain_id + 1)) } )#> Running MCMC with 2 sequential chains... #> #> Chain 1 finished in 0.0 seconds. #> Chain 2 finished in 0.0 seconds. #> #> Both chains finished successfully. #> Mean chain execution time: 0.0 seconds. #> Total execution time: 0.2 seconds.fit_mcmc_w_init_fun_2$init()#> [[1]] #> [[1]]$theta #> [1] 0.5 #> #> #> [[2]] #> [[2]]$theta #> [1] 0.3333333 #> #># Specifying initial values as a list of lists fit_mcmc_w_init_list <- mod$sample( data = stan_data, seed = 123, chains = 2, refresh = 0, init = list( list(theta = 0.75), # chain 1 list(theta = 0.25) # chain 2 ) )#> Running MCMC with 2 sequential chains... #> #> Chain 1 finished in 0.0 seconds. #> Chain 2 finished in 0.0 seconds. #> #> Both chains finished successfully. #> Mean chain execution time: 0.0 seconds. #> Total execution time: 0.3 seconds.fit_optim_w_init_list <- mod$optimize( data = stan_data, seed = 123, init = list( list(theta = 0.75) ) )#> Initial log joint probability = -11.6657 #> Iter log prob ||dx|| ||grad|| alpha alpha0 # evals Notes #> 6 -5.00402 0.000237915 9.55309e-07 1 1 9 #> Optimization terminated normally: #> Convergence detected: relative gradient magnitude is below tolerance #> Finished in 0.1 seconds.fit_optim_w_init_list$init()#> [[1]] #> [[1]]$theta #> [1] 0.75 #> #># }