Polaris
The UGM-27 Polaris missile was a two-stage solid-fueled nuclear-armed submarine-launched ballistic missile (SLBM). As the United States Navy’s first SLBM, it served from 1961 to 1996. For more see:
load("slbm.dat")
library(DT)
#library(knitr)
datatable(slbm)
#kable(slbm,format="latex", caption = "SLBM data")
library(ggplot2)
library(GGally)
#Here we use function from https://www.r-bloggers.com/multiple-regression-lines-in-ggpairs/
my_fn <- function(data, mapping, ...){
p <- ggplot(data = data, mapping = mapping) +
geom_point() +
geom_smooth(method=loess, fill="red", color="red", ...) +
geom_smooth(method=lm, fill="blue", color="blue", ...)
p
}
g = ggpairs(slbm,columns = 2:6, lower = list(continuous = my_fn))
g
heatmap(cor(slbm))
library(rstan)
library(rstanarm)
library(bayesplot)
options(mc.cores = parallel::detectCores())
load("slbm.dat")
fit.slbm.bs<-stan_glm(sqrt(R)~S+D+L+W+log(M)+log(P),
data=slbm,chains=4,iter=10000,seed=12345)
fit.slbm.bs
## stan_glm
## family: gaussian [identity]
## formula: sqrt(R) ~ S + D + L + W + log(M) + log(P)
## observations: 26
## predictors: 7
## ------
## Median MAD_SD
## (Intercept) -41.1 107.2
## S 9.4 5.2
## D 37.3 19.6
## L 0.8 1.7
## W 3.3 5.6
## log(M) 6.7 15.0
## log(P) -7.3 6.0
##
## Auxiliary parameter(s):
## Median MAD_SD
## sigma 10.2 1.7
##
## ------
## * For help interpreting the printed output see ?print.stanreg
## * For info on the priors used see ?prior_summary.stanreg
plot(fit.slbm.bs)
posterior_vs_prior(fit.slbm.bs)
fit.slbm.bs2<-as.array(fit.slbm.bs)
mcmc_hist(fit.slbm.bs2)
mcmc_trace(fit.slbm.bs2)
summary(fit.slbm.bs)
##
## Model Info:
## function: stan_glm
## family: gaussian [identity]
## formula: sqrt(R) ~ S + D + L + W + log(M) + log(P)
## algorithm: sampling
## sample: 20000 (posterior sample size)
## priors: see help('prior_summary')
## observations: 26
## predictors: 7
##
## Estimates:
## mean sd 10% 50% 90%
## (Intercept) -41.4 110.0 -178.1 -41.1 96.4
## S 9.4 5.3 2.7 9.4 16.1
## D 37.2 20.5 11.7 37.3 62.6
## L 0.8 1.8 -1.4 0.8 3.1
## W 3.2 5.8 -4.1 3.3 10.5
## log(M) 6.7 15.8 -13.0 6.7 26.2
## log(P) -7.3 6.2 -15.2 -7.3 0.5
## sigma 10.4 1.8 8.3 10.2 12.8
##
## Fit Diagnostics:
## mean sd 10% 50% 90%
## mean_PPD 69.0 2.9 65.3 69.0 72.7
##
## The mean_ppd is the sample average posterior predictive distribution of the outcome variable (for details see help('summary.stanreg')).
##
## MCMC diagnostics
## mcse Rhat n_eff
## (Intercept) 1.1 1.0 9162
## S 0.0 1.0 13466
## D 0.2 1.0 9822
## L 0.0 1.0 12332
## W 0.1 1.0 13064
## log(M) 0.2 1.0 8766
## log(P) 0.1 1.0 15290
## sigma 0.0 1.0 11985
## mean_PPD 0.0 1.0 19056
## log-posterior 0.0 1.0 6342
##
## For each parameter, mcse is Monte Carlo standard error, n_eff is a crude measure of effective sample size, and Rhat is the potential scale reduction factor on split chains (at convergence Rhat=1).
Polaris SLBM
slbm.pp <- posterior_predict(fit.slbm.bs,
newdata = data.frame(L=9.86,D=1.37,S=2,W=2,
M=16200,P=760),seed=12345)
#Note. Input parameters for the model
#http://www.astronautix.com/p/polarisa3.html
Range.km <- slbm.pp^2
Range.km <- Range.km[1:10000,]
quantile(Range.km,probs = c(0.05,0.5,0.95))
## 5% 50% 95%
## 1553.025 3478.665 6211.902
library(grid)
Range.km <- slbm.pp^2
Range.km <- Range.km[1:10000,]
ggplot(data=as.data.frame(Range.km), aes(Range.km)) +
geom_histogram(bins = 30,col="black",fill="green") +
geom_vline(xintercept = mean(Range.km), color = "red") +
geom_errorbarh(aes(y=-5, xmin=quantile(Range.km,0.05),
xmax=quantile(Range.km,0.95)),
data=as.data.frame(Range.km), col="#0094EA", size=3) +
ggtitle(label="Probability density of Polaris A3 range")
Source: https://fas.org/nuke/guide/usa/slbm/a-3.htm
The first A3 flight test was conducted at Cape Canaveral on 7 August 1962. Considering the challenge and redesign involved in the development of the A3 missile, it was not until the seventh development flight that complete success was achieved. It was during the A3 development program that the concept of incorporating production components/processing was first introduced into the development phase of a program (A3X- 18) . (This approach was later to be called “production disciplines.”) During June 1963, the A3X was successfully tested for the first time in a tube-launched firing at sea from the USS Observation Island (EAG-154). The first launching of a POLARIS A3 missile from a submerged submarine, the USS Andrew Jackson (SSBN-619), took place on 26 October 1963. The A3X flight test program started on 7 August 1962 and was completed on 2 July 1964. There were a total of 38 flights, of which 20 were successful, 16 partially successful, and 2 failures. Of the 20 successes, only 15 had successful reentry vehicle operation and ejection. It was only until the 15 A3X flights that the program began to have a continuous series of success.
library(binom)
library(pwr)
binom.test(x = 15,n = 20,p = 0.85,alternative = "less")
##
## Exact binomial test
##
## data: 15 and 20
## number of successes = 15, number of trials = 20, p-value = 0.1702
## alternative hypothesis: true probability of success is less than 0.85
## 95 percent confidence interval:
## 0.0000000 0.8959192
## sample estimates:
## probability of success
## 0.75
pwr.p.test(h = ES.h(15/20,0.95),n=20,alternative = "less")
##
## proportion power calculation for binomial distribution (arcsine transformation)
##
## h = -0.5961707
## n = 20
## sig.level = 0.05
## power = 0.8464445
## alternative = less
bs <- binom.bayes(x = 15,n = 20)
bs
## method x n shape1 shape2 mean lower upper sig
## 1 bayes 15 20 15.5 5.5 0.7380952 0.5534553 0.9100745 0.05000001
binom.bayes.densityplot(bs,npoints = 500,alpha = 0.5)