First Course in Statistical Programming With R 2nd Edition Braun - The 2025 ebook edition is available with updated content
First Course in Statistical Programming With R 2nd Edition Braun - The 2025 ebook edition is available with updated content
com
https://ebookmeta.com/product/first-course-in-statistical-
programming-with-r-2nd-edition-braun/
OR CLICK HERE
DOWLOAD EBOOK
https://ebookmeta.com/product/asymptotic-statistical-inference-a-
basic-course-using-r-shailaja-deshmukh/
ebookmeta.com
https://ebookmeta.com/product/bayesian-networks-with-examples-in-r-
chapman-hall-crc-texts-in-statistical-science-2nd-edition-scutari/
ebookmeta.com
https://ebookmeta.com/product/the-cruel-birth-of-bangladesh-memoirs-
of-an-american-diplomat-2002nd-edition-archer-k-blood/
ebookmeta.com
Sin Demons 06.0 - Hell on Earth 1st Edition Mila Young
https://ebookmeta.com/product/sin-demons-06-0-hell-on-earth-1st-
edition-mila-young/
ebookmeta.com
https://ebookmeta.com/product/statistics-the-art-and-science-of-
learning-from-data-rental-edition-coll/
ebookmeta.com
https://ebookmeta.com/product/a-geek-girl-s-guide-to-electronics-and-
the-internet-of-things-1st-edition-audrey-oshea/
ebookmeta.com
https://ebookmeta.com/product/berlitz-pocket-guide-israel-travel-
guide-ebook-2nd-edition-berlitz/
ebookmeta.com
https://ebookmeta.com/product/this-long-thread-women-of-color-on-
craft-community-and-connection-1st-edition-jen-hewett/
ebookmeta.com
Dad Bod Secret Prince Dad Bod Series Men Built for Comfort
1st Edition Andrea Marie
https://ebookmeta.com/product/dad-bod-secret-prince-dad-bod-series-
men-built-for-comfort-1st-edition-andrea-marie/
ebookmeta.com
A First Course in Statistical
Programming with R
This new, color edition of Braun and Murdoch’s bestselling textbook
integrates use of the RStudio platform and adds discussion of newer
graphics systems, extensive exploration of Markov chain Monte
Carlo, expert advice on common error messages, motivating
applications of matrix decompositions, and numerous new examples
and exercises.
Second Edition
1 Getting started
1.1 What is statistical programming?
1.2 Outline of this book
1.3 The R package
1.4 Why use a command line?
1.5 Font conventions
1.6 Installation of R and RStudio
1.7 Getting started in RStudio
1.8 Going further
5 Simulation
5.1 Monte Carlo simulation
5.2 Generation of pseudorandom numbers
5.3 Simulation of other random variables
5.4 Multivariate random number generation
5.5 Markov chain simulation
5.6 Monte Carlo integration
5.7 Advanced simulation methods
7 Numerical optimization
7.1 The golden section search method
7.2 Newton–Raphson
7.3 The Nelder–Mead simplex method
7.4 Built-in functions
7.5 Linear programming
Index
Expanded contents
Preface to the second edition
Preface to the first edition
1 Getting started
1.1 What is statistical programming?
1.2 Outline of this book
1.3 The R package
1.4 Why use a command line?
1.5 Font conventions
1.6 Installation of R and RStudio
1.7 Getting started in RStudio
1.8 Going further
4 Programming with R
4.1 Flow control
4.1.1 The for() loop
4.1.2 The if() statement
4.1.3 The while() loop
4.1.4 Newton’s method for root finding
4.1.5 The repeat loop, and the break and next statements
4.2 Managing complexity through functions
4.2.1 What are functions?
4.2.2 Scope of variables
4.2.3 Returning multiple objects
4.2.4 Using S3 classes to control printing
4.3 The replicate() function
4.4 Miscellaneous programming tips
4.4.1 Always edit code in the editor, not in the console
4.4.2 Documentation using #
4.4.3 Neatness counts!
4.5 Some general programming guidelines
4.5.1 Top-down design
4.6 Debugging and maintenance
4.6.1 Recognizing that a bug exists
4.6.2 Make the bug reproducible
4.6.3 Identify the cause of the bug
4.6.4 Fixing errors and testing
4.6.5 Look for similar errors elsewhere
4.6.6 Debugging in RStudio
4.6.7 The browser(), debug(), and debugonce() functions
4.7 Efficient programming
4.7.1 Learn your tools
4.7.2 Use efficient algorithms
4.7.3 Measure the time your program takes
4.7.4 Be willing to use different tools
4.7.5 Optimize with care
5 Simulation
5.1 Monte Carlo simulation
5.2 Generation of pseudorandom numbers
5.3 Simulation of other random variables
5.3.1 Bernoulli random variables
5.3.2 Binomial random variables
5.3.3 Poisson random variables
5.3.4 Exponential random numbers
5.3.5 Normal random variables
5.3.6 All built-in distributions
5.4 Multivariate random number generation
5.5 Markov chain simulation
5.6 Monte Carlo integration
5.7 Advanced simulation methods
5.7.1 Rejection sampling
5.7.2 Importance sampling
7 Numerical optimization
7.1 The golden section search method
7.2 Newton–Raphson
7.3 The Nelder–Mead simplex method
7.4 Built-in functions
7.5 Linear programming
7.5.1 Solving linear programming problems in R
7.5.2 Maximization and other kinds of constraints
7.5.3 Special situations
7.5.4 Unrestricted variables
7.5.5 Integer programming
7.5.6 Alternatives to lp()
7.5.7 Quadratic programming
Index
Preface to the second edition
W. John Braun
Duncan Murdoch
November, 2015
Preface to the first edition
We have a lot of people to thank for their help in writing this book.
The students in Statistical Sciences 259b have provided motivation
and feedback, Lutong Zhou drafted several figures, Kristy Alexander,
Yiwen Diao, Qiang Fu, and Yu Han went over the exercises and
wrote up detailed solutions, and Diana Gillooly of Cambridge
University Press, Professor Brian Ripley of Oxford University, and
some anonymous reviewers all provided helpful suggestions. And of
course, this book could not exist without R, and R would be far less
valuable without the contributions of the worldwide R community.
W. John Braun
Duncan Murdoch
February, 2007
1
Getting started
In most cases other than this one and certain exercises, we will
show the actual response from R corresponding to the preceding
input.1
There are also situations where the code is purely illustrative and is
not meant to be executed. (Many of those are not correct R code at
all; others illustrate the syntax of R code in a general way.) In these
situations we have typeset the code examples in an upright
typewriter font. For example,
f( some arguments )
Once you have installed R and RStudio, you will be ready to start
statistical programming. We’ll start with a quick tour of RStudio, and
introduce more detail in later chapters.
You should do most of your work in the editor, but you can
occasionally type in the console.
The console pane displays what R is doing.
All of the panes can be resized and repositioned, so sometimes it
may appear that you’ve lost one, but there’s no need to worry:
just find the header of the pane and click there with your mouse,
and the pane will reappear. If the pane is there but the content
isn’t what you want, try clicking on the tabs at the top.
There are many textbooks that will teach you more about
statistics. We recommend Data Analysis and Graphics Using R:
An Example-Based Approach by Maindonald and Braun and
Introductory Statistics with R by Dalgaard for an introductory
level presentation, and the classic Modern Applied Statistics with
S by Venables and Ripley for more advanced material. Advanced
R by Wickham gives more detail about programming in R.
There are many tools that use R in preparing printed documents.
We particularly like knitr, which you can read about online at
http://yihui.name/knitr or in the book Dynamic Documents
with R and knitr by Xie. It provides a very rich system; for a
simple subset (useful to write your assignments for class!), take
a look at R Markdown (http://rmarkdown.rstudio.com/).
R can also be used to prepare interactive web pages. The Shiny
system displays output from R based on prepared scripts that are
controlled in a browser. The user doesn’t need to install R, but he
or she can see R output. You can see an example and read more
about Shiny at http://shiny.rstudio.com.
Having installed the R and RStudio systems, you are now ready to begin to learn
the art of statistical programming. The first step is to learn the syntax of the
language that you will be programming in; you need to know the rules of the
language. This chapter will give you an introduction to the syntax of R. Most of
what we discuss here relates to what you would type into the R console or into
the RStudio script window.
Having opened R or RStudio, you may begin entering and executing commands,
usually interactively. Normally, you will use the Source Pane to type in your
commands, but you may occasionally use the Console Pane directly. The greater-
than sign (>) is the prompt symbol which appears in the Console Pane.
Upon pressing the Enter key (or CTRL-Enter), the result of the above division
operation, 42, appears in the Console Pane, preceded by the command you
executed, and prefixed by the number 1 in square brackets:
The [1] indicates that this is the first (and in this case only) result from the
command. Many commands return multiple values, and each line of results will
be labeled to aid the user in deciphering the output. For example, the sequence
of integers from 17 to 58 may be displayed as follows:
The first line starts with the first return value, so it is labeled [1]; the second
line starts with the 23rd, so it is labeled [23].
Note the use of parentheses in the examples above. Parentheses are used to
ensure that the operations (in this case, :, *, and +) are carried out in the order
that we desire. In the first case, parentheses were necessary to obtain the result
we wanted to see. The following shows what happens when the parentheses are
omitted:
If you are surprised by this result, it would be a good exercise to break the
calculation down into the three separate operations in order to determine exactly
what R is doing.
The parentheses were not required in (7:10) + pi. We used them anyway, for
two reasons. First, they can help others read and understand the code more
quickly. Second, although R follows strict and consistent rules regarding order of
operations, we believe it is too easy for a user to forget one or more of these
rules. Therefore, we recommend using parentheses whenever you are unsure (or
even in cases where you think you may be right).
R can also be used to compute powers with the operator. For example,
Modular arithmetic is also available. For example, you can compute the
remainder after division of 31 by 7, i.e. :
We can confirm that 31 is the sum of its remainder plus seven times the
integer part of the fraction:
We tell R to make the assignment using an arrow that points to the left,
created with the less-than sign (<) and the hyphen (-). R also supports using the
equals sign (=) in place of the arrow in most circumstances, but we recommend
using the arrow, as it makes clear that we are requesting an action (i.e. an
assignment), rather than stating a relation (i.e. that interest.30 is equal to
1.0025^30), or making a permanent definition. Note that when you run this
statement, no output appears: R has done what we asked, and is waiting for us
to ask for something else.
You can see the results of this assignment by typing the name of our new
object at the prompt:
Example 2.1
An individual wishes to take out a loan, today, of P at a monthly interest rate i.
The loan is to be paid back in n monthly installments of size R, beginning one
month from now. The problem is to calculate R.
Equating the present value P to the future (discounted) value of the n monthly
payments R, we have
or
This is the formula for the present value of an annuity. We can find R, given P, n,
and i as
2.1.3 Quitting R
or choose Quit RStudio... from the File menu. You will then be asked whether
to save an image of the current workspace, or not, or to cancel. The workspace
image contains a record of the computations you’ve done, and may contain
some saved results. Hitting the Cancel option allows you to continue your current
R session. We rarely save the current workspace image, but occasionally find it
convenient to do so.
Note what happens if you omit the parentheses () when attempting to quit:
This has happened because q is a function that is used to tell R to quit. Typing
q by itself tells R to show us the (not very pleasant-looking) contents of the
function q. By typing q(), we are telling R to call the function q. The action of
this function is to quit R. Everything that R does is done through calls to
functions, though sometimes those calls are hidden (as when we click on
menus), or very basic (as when we call the multiplication function to multiply 14
times 3).
Rather than saving the workspace, we prefer to keep a record of the commands
we entered, so that we can reproduce the workspace at a later date. The easiest
way to do this is in RStudio is to enter commands in the Source Pane, and run
them from there. At the end of a session, save the final script for a permanent
record of your work. In other systems a text editor and some form of cut and
paste serve the same purpose.
Exercises
1 Calculate the remainder after dividing 31079 into 170166719.
2 Calculate the interest earned after 5 years on an investment of $2000,
assuming an interest rate of 3% compounded annually.
3 Using one line of R code, calculate the interest earned on an investment
of $2000, assuming an interest rate of 3% compounded annually, for
terms of 1, 2, , 30 years.
4 Calculate the monthly payment required for a loan of $200,000, at a
monthly interest rate of 0.003, based on 300 monthly payments,
starting in one month’s time.
5 Use R to calculate the area of a circle with radius 7 cm.
6 Using one line of R code, calculate the respective areas of the circles
having radii .
7 In the expression 48:(14*3), are the brackets really necessary? What
happens when you type 48:14*3?
8 Do you think there is a difference between 48:14^2 and 48:(14^2)? Try
both calculations. Using one line of code, how would you obtain the
squares of the numbers ?
2.2.1 Functions
Most of the work in R is done through functions. For example, we saw that to
quit R we can type q(). This tells R to call the function named q. The
parentheses surround the argument list, which in this case contains nothing: we
just want R to quit, and do not need to tell it how.
We also saw that q is defined as
This shows that q is a function that has three arguments: save, status, and
runLast. Each of those has a default value: "default", 0, and TRUE, respectively.
What happens when we execute q() is that R calls the q function with the
arguments set to their default values.
If we want to change the default values, we specify them when we call the
function. Arguments are identified in the call by their position, or by specifying
the name explicitly. For example, both
tell R to call q with the first argument set to "no", i.e. to quit without saving the
workspace. If we had given two arguments without names, they would apply to
save and status. If we want to accept the defaults of the early parameters but
change later ones, we give the name when calling the function, e.g.
2.2.2 R is case-sensitive
Consider this:
Now try
The calculations in the previous sections led to the creation of several simple R
objects. These objects are stored in the current R workspace. A list of all objects
in the current workspace can be printed to the screen using the objects()
function:
2.3 Vectors in R
A numeric vector is a list of numbers. The c() function is used to collect things
together into a vector. We can type
Vectors can be joined together (i.e. concatenated) with the c function. For
example, note what happens when we type
Here is another example of the use of the c() function:
If you type this in the R console (not in the RStudio Source Pane), R will
prompt you with a + sign for the second line of input. RStudio doesn’t add the
prompt, but it will indent the second line. In both cases you are being told that
the first line is incomplete: you have an open parenthesis which must be
followed by a closing parenthesis in order to complete the command.
Remember that the numbers printed in square brackets give the index of the
element immediately to the right. Among other things, this helps us to identify
the 22nd element of a.mess as 89: just count across from the 17th element, 67.
A nicer way to display the 22nd element of a.mess is to use square brackets to
extract just that element:
We can extract more than one element at a time. For example, the third,
sixth, and seventh elements of a.mess are
Negative indices can be used to avoid certain elements. For example, we can
select all but the second and tenth elements of numbers5to20 as follows:
Using a zero index returns nothing. This is not something that one would
usually type, but it may be useful in more complicated expressions. For example,
recall that x contains the vector so that
Do not mix positive and negative indices. To see what happens, observe
Exploring the Variety of Random
Documents with Different Content
FOOTNOTES:
[40] Omitted by Author.—A.B.L.
[41] This paper appears, from an independent source ['The Siege
and Fall of Port Arthur,' by Major-General Kostenko, President of
the Military Court of Port Arthur during the siege], to have been
the copy of a telegram to the Tsar which Stössel had despatched
to the Tsar before this council meeting was held. According to
Kostenko this telegram was: 'We cannot hold out more than a few
days; am taking measures to prevent a street massacre'; and in
his opinion Stössel did not read it out at this council meeting after
the feeling of the members had been so strongly declared against
surrender, because he was afraid of being arrested for having
sent it.—A.B.L.
CHAPTER XLI
THE FALL OF FORTIFICATION NO. 3—THE FAILURE OF THE
DEFENCE AND MEDICAL ORGANIZATIONS
The garrison no longer showed the same steadiness that it had
shown in the many desperate fights in the beginning of December.
This was certainly owing to the example of Fort Chi-kuan-shan. The
men's spirits seemed to have gone, and it was too late for the
officers to stop the hæmorrhage from the moral wounds caused by
Fock. A passionate desire for life was everywhere noticeable, and
any attempt to persuade the men that it was their duty to die was
now useless.
Early in the morning of the 31st Gorbatovsky was summoned by
Fock to confer with him. The latter was, as usual, dilating on the
splendid qualities of the men, and the pity it was to make them
suffer needlessly, when a great pillar of smoke suddenly shot up
from Fortification No. 3, followed by a tremendous explosion.
'I must go back, sir, and I will return at once and let you know what
has happened.'
'Yes, come back as soon as you can.'
Gorbatovsky then went off. Without waiting for a report from him,
Fock there and then, in the presence of Captain Rodionoff, of the
Engineers, wrote out his orders for the abandonment of Fortification
No. 3, and sent them off by (I think) a sailor. There was no
reference, no word to the Commandant, or even to Stössel.
Comment is unnecessary; such action speaks for itself.
What had happened is best seen by reference to the diary:
'December 31.—About 6 a.m. General Gorbatovsky was summoned
by General Fock to the third line of defences to confer. At 9 a.m.
three successive explosions took place in Fortification No. 3. After a
few minutes a telephone message came in from the work to say that
the enemy had exploded two charges in the corners of one of the
faces. At the moment when the garrison, led by its commanding
officer, Captain Spredovy, dashed out of the quarters in the gorge
casemate, in order to get out into the interior of the place before the
Japanese could seize the parapet, a third charge was fired, which
had been laid in the gorge itself. This charge destroyed the gorge
casemates, and buried the commanding officer and 140 men under
the débris. The fall of this mass of stuff caused the hand-grenades
heaped up in the casemates to detonate and set off four mines, laid
under the foundations. The wounded and remnants of the garrison
were thus shut up in the casemate, with only one small exit into the
gorge ditch, through which they had to crawl. Not being able to get
into the interior of the work, the garrison could do nothing to hold
the position. The enemy perceived this at once, quickly got into the
interior of the work, and seized the gorge, where they brought
machine-guns. About 10 o'clock we saw a white flag on the
fortification. It is not known who raised it. General Stössel and the
Fortress Commandant were informed, and within a quarter of an
hour the following order was received from General Stössel:
CHAPTER XLII
THE LAST DAY BUT ONE
The dawn of January 1, 1905, ushered in an anxious day. All the
roads near the forts were now so much under rifle and machine-gun
fire that movement on them soon ceased. In the Staff Office of the
section it was expected that the enemy would at any moment
commence to pound and then storm Eagle's Nest, which was now
the key to the position. Sure enough, about nine o'clock the
bombardment commenced, shell after shell with clockwork regularity
striking the top of the hill. The staff of the section went from their
usual observation-place to the dressing station, from which an
excellent view of the rearward slope of Eagle's Nest could be seen,
and which had a telephone. At noon Captain Galitsinsky, who was in
command of the work, began sending in alarming messages to the
effect that the enemy, by repeated rushes, were successfully
concentrating in force in front of the position, evidently with a view
to an assault, and asked that he might be reinforced. The assault
soon began, but made at first little progress in face of the garrison's
steady fire. General Gorbatovsky, commanding the section, kept the
Commandant regularly informed of the progress, and urged that our
guns should increase their fire. Our fortress guns poured in a fairly
heavy fire, but not so heavy as the circumstances warranted, as we
had but few howitzers, which alone could have been effective.
Galitsinsky continued anxiously to report the critical condition of the
position. Gorbatovsky never left the telephone, talking all the time
with either Fock, Biely, or the Commandant: he kept on begging for
reserves to be sent up, saying that without reinforcements he could
not guarantee the issue. Suddenly some infantry were seen running
back from Tumulus Hill, and it was ascertained that the enemy,
having climbed a spur in front of Eagle's Nest, had enfiladed some of
our trenches. The men in them wavered and then ran. The presence
of mind of Captain Stepanoff alone restored order and averted a
panic. A party of fifty sailors were sent up to Galitsinsky, followed by
a second party somewhat later, and the fight waged hotly, our men
with difficulty holding their own.
At midday, while the issue of the fight was in the balance, Rear-
Admiral Loschinsky received the following letter, No. 2,544 of
January 1:
FOOTNOTES:
[42] The text of this message has been quoted.—A.B.L.
[43] Valves which control the sea-water inlets of a ship.—E.D.S.
CHAPTER XLIII
THE END
Almost before dawn next morning, on the eastern front near Signal
Hill, was sounded the last note in the titanic struggle for Arthur.
Some volleys rang out on the quiet air, died away into independent
firing, then stopped. Boom! boom! went two guns, and then all was
silent. It appeared that the Japanese, thinking that Signal Hill was
only held by outposts, decided to seize it under cover of night. They
advanced without even taking the usual military precautions.
Unfortunately for them the hill was held by a company of infantry,
which, having noticed their approach, allowed them to get within
short range, and then poured volley after volley into them. Twenty
dead and eighty wounded were left on the ground. They wavered,
and our men charged with the bayonet. The fight continued for
some moments, costing us five wounded and one killed.
At daybreak all the hills on both sides swarmed with men who had
recently been foes: they stared at each other fascinated. The two
great masses of men differed but little from each other. Both had
come here to die, to die without a murmur and obediently. The only
difference was that on the one side they died for duty and for an
object understood by all, knowing their own superiority; on the other
they died for the same reason, but feeling their inferiority. The latter
it was who drank the bitter cup. Their one hope now was that they
should be spared the fate of being taken prisoners of war.
Negotiations were being carried on that day, and, of course, those
responsible would spare them the shame of imprisonment. But no!
They had to drain the dregs.
ADMIRAL WIREN.
A carriage was seen driving from the District Staff Office; it
proceeded quickly round the central Mandarin Road to the village of
Siu-shuing, the place appointed for the meeting. In it was Colonel
Reuss, who was escorted on horseback by Colonels Khvostoff,
Dmitrevsky, Captains Schesnovitch, Golovan, Student Lebedeff
(interpreter), and Malchenko. Before they started, General Stössel, in
the presence of Fock, told them all that he had given all instructions
and full authority for the conclusion of the capitulation confidentially
to Reuss, and that Reuss had also been given a letter for General
Baron Nogi. Stössel, Fock, and Reuss were nervous; they were also,
it seems, in a great hurry, for no lawyer was asked to look over the
terms of capitulation, nor was one present even when the terms
were signed.
The Commandant, holding aloof from any participation in the
surrender, sent the following cipher telegram to the Commander-in-
Chief, dated January 2, No. 1,300:
Reuss, with his companions, soon reached the appointed spot. They
were met by the Chief of the Staff of the Japanese Army, who
handed to them the proposed text of the agreement,[44] written in
English. He gave them an hour in which to think it over, and went
away. Reuss then read the contents aloud to the others. Golovan
began to protest; he was cut short. 'They are the victors; we must
submit to their demands.' After a short conference and passionate
protests from Khvostoff, Golovan, and Schesnovitch—as a matter of
fact their protests were waste of breath, for Reuss alone had plenary
powers, the others being only there for show—Reuss agreed to
make three alterations: (1) That the garrison should not be made
prisoners of war; (2) that officers should be permitted to take their
orderlies with them; (3) that the allowance of baggage should be
increased. The Japanese returned punctually within the hour, and
took away the text of the capitulation with the alterations for
consideration. After a quarter of an hour they returned, and said
definitely:
'We only agree to the second alteration. Will you sign?'
Reuss pondered for a moment, then said:
'I will.'
I will not bore the reader with the terms of the convention, which
are now well known, or the procedure of signing. No sooner was the
shameful document signed than Reuss sent a Japanese messenger
to Stössel with a note, saying:
'The capitulation is signed, and, in accordance with it, the
destruction of all property must be immediately stopped.
Stössel at once replied:
'I have done everything; tell the Japanese.'
The news of the surrender being an accomplished fact soon spread
among the garrison. Our men seemed suddenly to change their
natures, all discipline went to the winds, and rioting commenced.
Some, throwing their arms away, went straight down to the town,
which became one vast scene of drunkenness and orgy. The shops
and stores were looted, and wholesale robbery was the order of the
day. The crowd broke up everything they could, amongst other
things the library of the Novy Kry. The officers, seeing that it was
hopeless to try and cope with their men, hid from the maddened
crowds.
And now a few words as to General Stössel and how he took the
surrender. When the riot was reported to him, he at once became
alarmed, and asked for a hundred Japanese soldiers as a guard over
his house and property. Nogi sent the men, fully armed and
equipped. Fearing that matters would become serious, Stössel sent
the following note to Smirnoff:
'The strictest steps must be taken at once to deal with the looting
which has commenced. I would request you to be so kind as to send
out patrols. Reuss tells me that the terms of the surrender are
honourable. Please excuse pencil.'
It is difficult to understand what was in his mind when he wrote that
note. Was he laughing at the Commandant, or had he gone off his
head? As soon as Irman heard of the surrender he went to Smirnoff.
'Is it true, sir, that the Fortress has been surrendered?'
'I know nothing about it. Stössel has done everything without
reference to me. Go and ask him.'
Irman went at once to Stössel, and having ascertained that the
Fortress had been given up, he asked leave to go to Chifu on a
destroyer: he wished to break through to the army in the north. But
Stössel flatly refused permission, saying:
'Good heavens! what are you talking about? What are we to do with
all the gold vases? How am I to get them away? Why, the Japanese
might get them; we must save them.'
'If you want to make certain that the Japanese don't get them, sir, I
should throw them into the sea,' was Irman's answer.
Stössel was referring to the gold vases, goblets, spoons, etc., looted
from the Pekin Palace which were kept in Arthur. The gold plate had
been kept under special arrangements in the quarter-guard of the
12th Regiment, but when this corps left for Manchuria the plate was
left behind. On the evening of January 3 a mysterious cart arrived at
the quarter-guard, and disappeared in the dark of the night.
Some of the questions put to Stössel later at the Commission of
Inquiry, and his replies to them, may help to show how he was
occupied at this time. When asked by Major-General Roops why he,
contrary to all military regulations, took out of Arthur some thirty-
eight cartloads of his own property, he replied:
'I did it with the permission of the Emperor of Japan.'
On being asked why he did not share the fate of the garrison and go
into imprisonment, he answered:
'I was ordered not to by Her Imperial Highness the Tsarina.'
He had indeed received a telegram from the Empress in which she
had said she would be glad to 'see him in Russia.' The Emperor and
Russia did not at that time know what Stössel was!
When he was asked by the Commission why he surrendered Port
Arthur on his own responsibility, and did not summon the Council of
War to consider the question, he said:
'There was no time for that. I forestalled the Japanese, and did not
give them the possibility of breaking into Arthur; I was thus able to
prevent a street massacre.'
And this was the cry of all the whole Stössel clique before the
Committee of Inquiry.
One extract from the diary and I have finished:
'January 2, 1905.—On the way to the rendezvous of the Japanese
Commission appointed to take over, we met an officer of the
Japanese General Staff who greeted us in Russian. Ribnikoff at once
recognized him to be a man called Ito, who had been in Arthur for
several years as a watchmaker!'
Small wonder they beat us!
So it ended—so ended Russian Port Arthur. From its loss—from this
mighty struggle, this long-drawn-out nightmare of suffering, this
death of all our aspirations—new hope is born to our nation, a hope
of better days.
Salus patriæ. Suprema lex est.
FOOTNOTES:
[44] The text of this capitulation was drawn up two years before
by one of the most able Japanese lawyers.
CONCLUSION[45]
As this book leaves the hands of the printer, the columns of the daily
press are conveying to the world the terms of the indictment of the
chief characters mentioned in it for their share in the surrender of
the Fortress of Port Arthur to the Japanese. As this constitutes an
official confirmation of much that I have written, I include it in my
book, so that the reader may be in a position to judge if the title of
my work is justified.
This indictment, I may add, has been drawn up by three separate
Commissions, composed of the highest Government officials and
experts in military law.
Official Indictment.
Lieutenant-General Stössel, of the retired list, is charged as follows:
1. In that he, having on July 3, 1904, received an order from the
Commander-in-Chief of the Army in Manchuria to hand over
command of the Fortress of Port Arthur to its Commandant,
Lieutenant-General Smirnoff, and to leave the Fortress, disobeyed,
and, remaining in the Fortress, retained command of it—an action
provided for under Article 255, Book XXII., of the 'Military Code of
1869,' third edition.
2. In that he, in defiance of Order No. 339 of April 27, 1904, by the
Viceroy in the Far East, did interfere with the powers and duties of
the Commandant of the Fortress, thus undermining the latter's
authority, shaking public confidence in him, and so diminishing the
defensive capabilities of the Fortress. The following are instances of
such interference:
6. In that he, for his own advantage, and in order to place the
actions of his subordinates in the most favourable light, on May 28,
1904, reported to the Commander-in-Chief of the Army in Manchuria
that the force under Lieutenant-General Fock 'was falling back
gradually towards Wolfs Hills'—a statement directly opposed to facts,
as the retirement of the force direct on to Wolf's Hills (the last of the
advanced positions) was effected in complete disorder and in great
haste along a hilly road, blocked with transport and by the
inhabitants of Dalny retreating to Port Arthur.
Provided for under, etc.
7. In that he, for his own advantage, and in order to represent
himself as taking a part in various actions (which did not take place),
on June 14, 1904, reported in writing to the Commander-in-Chief of
the Manchurian Army as to his own great activity in the conduct of
the defence, in which report he stated, in opposition to facts: ' ... I
always make a point of being in every possible engagement ...';
while from February 8, 1904, to June 14—i.e., up to the date of his
letter to General Kuropatkin—not a single engagement with the
Japanese took place (except the battle at Kinchou, in which he—
General Stössel—took no part) but the bombardments, during which
the whole population of Port Arthur were in equal danger.
Provided for under, etc.
8. In that he, in the hope of justifying the prearranged surrender of
the Fortress to the enemy, on December 29, 1904, reported to the
Tsar in a telegram that: 'By the capture of Fort No. 3 the Japanese
have become masters of the whole north-east front, and the
Fortress can only hold out for a very few days. We have no artillery
ammunition ...'—a report which was not in accordance with the
facts, as at the Council of War held on that day (December 29),
when the members by a large majority declared themselves in
favour of holding out to the last moment, both Major-Generals Biely
and Nickitin declared that there was sufficient ammunition in hand
for a further defence.
Provided for under, etc.
9. In that he intentionally, improperly, and with false statements
recommended:
(a) When the battle had begun on the morning of May 26,
1904, instead of taking command, did go away to Inchenzy Bay
to select a position there for the 15th Regiment, in case the
Japanese should land there, and did not arrive at the attacked
position till 2 p.m.
(b) Did only send one of the four regiments present at Kinchou
into action, and thus did cause its separate destruction.
(c) Did not only fail to make any use of his reserves during the
battle, but did stop two battalions which were going up into the
fighting line, under orders from General Nadein.
(d) Without having exhausted every means of defence, and
without having recourse to the bayonet, did telegraph to
General Stössel in Port Arthur, in order to induce him to order a
retirement, as to 'the critical position,' and the complete lack of
gun ammunition, there being at the time a large quantity of
ammunition at the station of Nangalin.
(e) Having, in consequence of this, received instructions from
General Stössel to retire at dusk, did commence the retirement
in daylight, thus causing many casualties, and ceding to the
Japanese the fortified position at Kinchou, without having made
use of all the means at his disposal for its protracted defence.
FOOTNOTES:
[45] Written by the author in October, 1907. This was the official
indictment then published, and contains the main charges upon
which the officers stood their trial.—E.D.S.
[46]? January 1, 1905.—E.D.S.
APPENDIX I
General Fock's Memorandum re the Surrender of Fort No. 2. [Chi-kuan-
shan.]
In saying this General Smirnoff was quite in the right. Fock did not
reinforce the garrison either in time or sufficiently, although quite
able so to do. The whole essence of the defence at the end
consisted in the use of mobile reserves for the reinforcement of
threatened points. It was by his intelligent anticipation of Nogi's
tactics and his skillfull movement and employment of reserves that
Smirnoff was able so long to check the attack.