臨床統計もおもしろいですよ、その2at HOSP
臨床統計もおもしろいですよ、その2 - 暇つぶし2ch335:卵の名無しさん
18/11/23 19:10:32.75 QoVjbOvp.net
URLリンク(www.f.waseda.jp)

336:卵の名無しさん
18/11/23 22:53:03.27 t+QLwcrH.net
1時間に平均値5人の患者がくる医院で
次の患者がくるまでの時間が10分以内である確率と
30分以上である確率はいくらか?

337:卵の名無しさん
18/11/24 01:25:40.73 5hOk6q/8.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

338:卵の名無しさん
18/11/24 11:07:29.76 wOJ88Y8z.net
deli <- function(course=90,hr=15,call=5){
# average 5 calls during 15 hours with 90 min delivery
k=call/hr
integrate(function(x)k*exp(-k*x),0,course/60)$value
}
vd=Vectorize(deli)
dc=0:180
plot(dc,vd(dc),type='l',lw


339:d=2,bty='l', xlab='Deli.course(min)',ylab='Prob of call')



340:卵の名無しさん
18/11/24 11:42:17.66 wOJ88Y8z.net
deli <- function(course=90,hr=15,call=5){
# average 5 calls during 15 hours with 90 min delivery
k=call/hr
integrate(function(x)k*exp(-k*x),0,course/60)$value
}
vd=Vectorize(deli)
dc=0:180
plot(dc,vd(dc),type='l',lwd=2,bty='l',
xlab='Deli.course(min)',ylab='Prob of call')
uniroot(function(x,u0=0.5)vd(x)-u0,c(0,180))$root
DH <- function(course=90,hr=15,call=5){
k=call/hr
x=course/60
1-exp(-k*x)
}
p2c=function(p,k=5/15) (-60*log(1-p)/k)
curve(p2c(x),bty='l',xlab='p',ylab='course(min)')

341:卵の名無しさん
18/11/24 13:12:14.88 owOvYQ4F.net
このスレの自称医者のほんまもん医師確率は?
検索した知識で医者を騙りMath
スレリンク(hosp板)

342:卵の名無しさん
18/11/24 14:11:47.95 4kuDQ9FR.net
こういうのを見ればわかるだろうに
URLリンク(egg.2ch.net)
>>878
>875は脾弯越えの操作でpullする時の話。
URLリンク(i.imgur.com)
馬鹿なのか、馬鹿じゃなきゃ、これにでも答えてみ!
1時間に平均値5人の患者がくる医院で
次の患者がくるまでの時間が10分以内である確率と
30分以上である確率はいくらか?

343:卵の名無しさん
18/11/24 14:18:05.42 4kuDQ9FR.net
>>316
これ用のスクリプト
18時から翌朝9時までの15時間の当直帯に平均5回のコールがある。当直室にデリヘル90分コースで呼んだとすると
デリヘル滞在中にコールされる確率はいくらか?

344:卵の名無しさん
18/11/24 16:38:49.21 wOJ88Y8z.net
two sample poisson test
パッケージでp値が異なるのでソースを確認。
X=2 ; Y=9
N=17877;M=16660
P=N/(N+M)
poisson.test(c(X,Y),c(N,M))$p.value
binom.test(X,X+Y,P)$p.value
library(rateratio.test)
rateratio.test(c(X,Y),c(N,M))$p.value
2*min(binom.test(X,X+Y,P,alt='l')$p.value,
binom.test(X,X+Y,P,alt='g')$p.value)

345:卵の名無しさん
18/11/24 17:00:00.40 wOJ88Y8z.net
救急車搬送数が日勤の8時間で0、夜勤の16時間で5であったときに
夜勤帯の方が時間あたり救急搬送が多いと言えるか?
救急車搬送数はポアソン分布に従うとして有意水準5%で検定せよ。
日勤0のとき夜勤で何台以上の搬送があれば有意と言えるか?
rm(list=ls())
library(rateratio.test)
poisson.test(c(0,5),c(8,16))$p.value
rateratio.test(c(0,5),c(8,16))$p.value
x=0:20
y=sapply(x,function(x) poisson.test(c(1,x),c(8,16))$p.value)
plot(x,y,bty='l')
x[which.max(y<0.05)]
y=sapply(x,function(x) rateratio.test(c(1,x),c(8,16))$p.value)
plot(x,y,bty='l')
x[which.max(y<0.05)]

346:卵の名無しさん
18/11/24 17:01:06.35 wOJ88Y8z.net
>>321
日勤と夜勤でお看取り件数に差があるかも検定できるな。

347:卵の名無しさん
18/11/24 20:15:42.14 mGu7MkO8.net
Last but not least, three laws of Do-Teihen(lowest-tier) Medical School, currently called Gachi'Ura by its graduates.
It is not the bottom medical school but its enrollee that is despicable, which deserves to be called a bona fide moron beyond redemption.
The graduates of Do-Teihen are so ashamed that none of them dare to mention their own alma mater they had gone through.
The Do-Teihen graduates are so ashamed of having bought their way into the exclusively lowest-tier medical school
that they tend to call a genuine doctor a charlatan who elucidates their imbecility.

348:卵の名無しさん
18/11/24 20:20:35.00 4kuDQ9FR.net
f = function(A=1,B=2,N=100){
p=0
for (i in 1:N){
for(j in 0:(i-1)){
p=p+dpois(i,A)*dpois(j,B)}}
p
}
f()
f(1,3)

349:卵の名無しさん
18/11/24 20:31:46.81 4kuDQ9FR.net
soccer= function(A=1,B=2,N=1000){
pa=pd=0
for (i in 1:N){
for(j in 0:(i-1)){
pa=pa+dpois(i,A)*dpois(j,B)
pd=pd+dpois(i,A)*dpois(i,B)
}}
c(Awin=pa,Bwin=1-pa-pd,Draw=pd)
}
soccer()

350:卵の名無しさん
18/11/24 20:39:49.49 4kuDQ9FR.net
>>325
サッカーの勝敗確率

351:卵の名無しさん
18/11/24 20:47:34.09 4kuDQ9FR.net
>>326 debugged
soccer= function(A=5,B=10,N=100){
pa=pd=0
for (i in 1:N){
pd=pd+dpois(i,A)*dpois(i,B)
for(j in 0:(i-1)){
pa=pa+dpois(i,A)*dpois(j,B)
}}
c(Awin=pa,Bwin=1-pa-pd,Draw=pd)
}

352:卵の名無しさん
18/11/25 02:02:43.79 JOuyBVrN.net
ポイント乞食ご用達の楽天銀行に貯金していて、
楽天に口座凍結されて無一文になった世田谷のS君 元気??
一応 開業医なのに楽天銀行って  
慶応のOBらが泣いてるよww

353:卵の名無しさん
18/11/25 08:07:10.02 Vr8P87vG.net
マルコフの確認
(pexp(2+4,1/3)-pexp(2,1/3))/(1-pexp(2,1/3))
pexp(4,1/3)

354:卵の名無しさん
18/11/25 09:08:24.99 B7CJHmdM.net
k=15
a=20
b=30
(pexp(a+b,1/k)-pexp(a,1/k))/(1-pexp(a,1/k))
pexp(b,1/k)

355:卵の名無しさん
18/11/25 12:02:52.13 9toFqzz4.net
k=15
a=20
b=30
y=function(x) 1-exp(-x/k)
(y(a+b)-y(a))/(1-y(a))
y(b)

356:卵の名無しさん
18/11/25 12:19:14.40 9toFqzz4.net
>>327
debugged again
soccer= function(A=5,B=10,N=100){
if(A>B){
tmp=A
A=B
B=tmp
}
pa=pd=0
for (i in 1:N){
pd=pd+dpois(i,A)*dpois(i,B)
for(j in 0:(i-1)){
pa=pa+dpois(i,A)*dpois(j,B)
}}
c(Upset=pa,Ordinal=1-pa-pd,Draw=pd)
}

357:卵の名無しさん
18/11/25 12:22:57.28 9toFqzz4.net
debugged with equivalent routine
soccer= function(A=5,B=10,N=100){
if(A==B) return(c(c(Upset=0,Ordinal=0,Draw=1)))
if(A>B){
tmp=A
A=B
B=tmp
}
pa=pd=0
for (i in 1:N){
pd=pd+dpois(i,A)*dpois(i,B)
for(j in 0:(i-1)){
pa=pa+dpois(i,A)*dpois(j,B)
}}
return(c(Upset=pa,Ordinal=1-pa-pd,Draw=pd))
}

358:卵の名無しさん
18/11/25 12:45:46.33 9toFqzz4.net
>>333
if(A==B) return(c(c(Upset=0,Ordinal=0,Draw=1)))
は不要だな。

359:卵の名無しさん
18/11/25 12:49:45.63 9toFqzz4.net
サッカーの特典はポアソン分布に従うとされている。
PK戦はなしで考える。
平均得点2点のチームAと平均得点3点のチームBが戦ったとき
Aが勝つ確率、Bが勝つ確率 および 引き分けの確率を求めよ。
得点の上限Nを100として計算。
soccer= function(A=2,B=3,N=100){
if(A>B){
tmp=A
A=B
B=tmp
}
pa=pd=0
for (i in 1:N){
pd=pd+dpois(i,A)*dpois(i,B)
for(j in 0:(i-1)){
pa=pa+dpois(i,A)*dpois(j,B)
}}
return(c(Upset=pa,Ordinal=1-pa-pd,Draw=pd))
}
> soccer(2,3)
Upset Ordinal Draw
0.2469887 0.5920274 0.1609839

360:卵の名無しさん
18/11/25 12:52:38.63 9toFqzz4.net
>>335
1億回シミュレーションしてみた。
> sim <- function(A=2,B=3,K=1e8) {
+ a=rpois(K,A) ; b=rpois(K,B)
+ c(Upset=mean(a>b),Ordinal=mean(a<b),Draw=mean(a==b))
+ }
> sim()
Upset Ordinal Draw
0.2470561 0.5851947 0.1677492
ほぼ同じした結果がでて、気分が( ・∀・)イイ!!

361:卵の名無しさん
18/11/25 14:41:03.20 9toFqzz4.net
λ0=3/60  # 平均到達率
μ0=4/60 # 平均サービス率 1/μ0 : 平均サービス時間
(ρ0=λ0/μ0) # 平均トラフィック密度

# □ ← ○○○○○○
ρ0/(1-ρ0)*(1/μ0)
ρ0/(1-ρ0)*(1/μ0)+1/μ0
# □ ← ○○○
# □ ← ○○○
(λ1=λ0/2)
(ρ1=λ1/μ0)
ρ1/(1-ρ1)*(1/μ0)
ρ1/(1-ρ1)*(1/μ0)+(1/μ0)
# □ ←
# \
#    ○○○○○
# /
# □ ←
(μ2=2*μ0)
(ρ2=λ0/μ2)
2*ρ2^3/(1-ρ2^2) * (1/μ0)
2*ρ2^3/(1-ρ2^2) * (1/μ0) + (1/μ0)
# □□ ← ○○○○○○
(μ3=2*μ0)
(ρ3=λ0/μ3)
ρ3/(1-ρ3)*(1/μ3)
ρ3/(1-ρ3)*(1/μ3) + (1/μ3)

362:卵の名無しさん
18/11/25 15:33:46.37 9toFqzz4.net
>>331
答えから、指数分布のマルコフ性が導き出されていることを確認

363:卵の名無しさん
18/11/25 21:52:47.06 9toFqzz4.net
# 10分に2本の割合で電車が到着するダイヤ。
# それぞれの平均待ち時間を求めてみよう
# 5分おきのダイヤでの、平均待ち時間は何分か?
i=j=5
fij <- function(x){
if(x<i) return(i-x)
return(i+j-x)
}
fij=Vectorize(fij)
curve(fij(x),0,10,type='h')
integrate(fij,0,10)$value/10
# 2(=i)分後、8(=j)分後、と電車が到着するダイヤでの平均待ち時間は何分か?
i=2 ; j=8 # 8:00,8:02,8:10,8:12,8:20,...
fij <- function(x){
if(x<i) return(i-x)
return(i+j-x)
}
fij=Vectorize(fij)
curve(fij(x),0,i+j,type='h')
integrate(fij,0,i+j)$value/(i+j)

364:卵の名無しさん
18/11/25 22:09:31.18 9toFqzz4.net
# 8:15,8:50,


365:9:15,9:50,10:15,10:50.... i=50-15 ; j=60-(50-15) fij <- function(x){ if(x<i) return(i-x) return(i+j-x) } fij=Vectorize(fij) curve(fij(x),0,i+j,type='h') integrate(fij,0,i+j)$value/(i+j) (i*i/2+(60-i)*j/2)/(i+j)



366:卵の名無しさん
18/11/25 22:53:07.02 JHTxnUVJ.net
Prudence, indeed, will dictate that "uraguchi" long established cannot be changed for light and transient causes;
and accordingly all experience has shown, that BMS are more disposed to suffer, while evils are sufferable, than to right themselves by abolishing the forms from which they can pursue profit.
But when a long train of misbehavior and misconduct , showing invariably the same Imbecility evinces a design to reveal themselves as absolute Bona Fide Moron ,
it is their right, it is their duty, to expel such "uraguchi", and to provide new guards for their future security.

367:卵の名無しさん
18/11/26 00:38:59.24 ZChMNBQH.net
数学板の質問スレに俺でも答えられる問題がでるとホッとするな。
簡単すぎて誰も答えないからというのもあるが。

368:卵の名無しさん
18/11/26 01:19:35.09 ZChMNBQH.net
時刻表から平均待ち時間を算出する。
tt=c(0,10,13,20,23,30,40,47,50,60) # time table
ct2wt <- function(x){ # clock time to waiting time
n=length(tt)
if(x<=tt[1]){w8=tt[1]-x
}else{
for(i in 1:(n-1)){
if(tt[i]<=x & x<=tt[i+1]){
w8=(tt[i+1]-x)
break
}
}}
return(w8)
}
ct2wt=Vectorize(ct2wt)
curve(ct2wt(x),0,60,type='h',bty='l')
integrate(ct2wt,0,60)$value/60
x=diff(tt)
sum(x^2/2)/sum(x)

369:卵の名無しさん
18/11/26 01:24:22.62 iwt1L6U2.net
ちっちっ×××× ちっち××××
××××ち××××
へいたんな×× おうとつない
×××だけぷっくりしてるの
あまいあじがするから××てほしいな?
にゃにゃにゃにゃにゃにゃにゃん☆
ちっちっ×××× ちっち××××
××××ち××××
つるつるな×× おにくがない
しるくの×××ごこちなんだ
ほおずりですりすりっとしてほしいな?
×××××でいっぱい××て?
ぜんぶ××××から♪
ちっちっ×××× ちっち××××
××××ち××××
すべすべの×× おおきくない
けんこうにすっごくいいんだよ
ゆびさきで××××ってしてほしいな? 👀
Rock54: Caution(BBR-MD5:1341adc37120578f18dba9451e6c8c3b)


370:卵の名無しさん
18/11/26 07:32:00.16 ZChMNBQH.net
>>343
Haskellの練習
Prelude> let tt = [0,10,13,20,23,30,40,47,50,60]
Prelude> let diff = zipWith (-) (tail tt) (init tt)
Prelude> sum (map (\x -> x^2/2) diff) / sum(diff)
3.95

371:卵の名無しさん
18/11/26 07:50:43.97 ZChMNBQH.net
>>343
python の 練習
import numpy as np
diff=np.diff([0,10,13,20,23,30,40,47,50,60])
print ( sum(map (lambda x: x**2/2,diff))/sum(diff ))

372:卵の名無しさん
18/11/26 07:51:08.82 ZChMNBQH.net
>>343
問題はこれ
東京駅からのぞみ号で朝8時から9時に出発する(9時発も可)。
無作為に選んだ8時台の時間に出発ホームに到着したとすると平均の待ち時間は何分か?
以下が東京8時台発のぞみ号の時刻表である。
8:00 8:10 8:13 8:20 8:23 8:30 8:40 8:47 8:50 9:00

373:卵の名無しさん
18/11/26 18:21:38.38 ZDBUmL4t.net
>>347
この問題を数学板に書いたら応用問題が返ってきた。
ある駅のホームの1番線には1時間ごと、2番線には(1/2)時間ごと、3番線には(1/3)時間ごとに電車が来るようにダイヤを組みたい。
ランダムな時間に駅に着いたときの平均待ち時間を最小にするには、どのようにダイヤを組めば良いか。
ただし、何番線の電車に乗っても向かう方向や停車駅に違いは無いとする。
プログラミングで簡単に解けた。
w8 <- function(xy,Print=FALSE){
x=xy[1];y=xy[2]
if(x<0|x>20|y<0|y>30)return(Inf)
tt=c(0,x,x+20,x+40,y,y+30,60)
tt=sort(tt)
d=diff(tt)
w=sum(d^2/2)/sum(d)
if(Print){
print(tt)
cat(sum(d^2/2),'/',sum(d))
}
return(w)
}
optim(par=c(0,0),w8,method='Nelder-Mead')
w8(c(10,15),P=T)
optim(par=c(0,0),w8,method='Nelder-Mead',control=list(fnscale=-1))
w8(c(0,0),P=T)

374:卵の名無しさん
18/11/26 19:10:20.76 WZnn9Mtx.net
Last but not least, three laws of Do-Teihen(lowest-tier) Medical School, currently called Gachi'Ura by its graduates.
It is not the bottom medical school but its enrollee that is despicable, which deserves to be called a bona fide moron beyond redemption.
The graduates of Do-Teihen are so ashamed that none of them dare to mention their own alma mater they had gone through.
The Do-Teihen graduates are so ashamed of having bought their way into the exclusively lowest-tier medical school
that they tend to call a genuine doctor a charlatan who elucidates their imbecility.

375:卵の名無しさん
18/11/26 20:45:26.65 G0yfFsA6.net
>>348
1時間に4本の4番線にも拡大できるようにプログラムを一般化。
densha <- function(init,Print=FALSE){
init=c(0,init)
J=length(init)
if(any(init*(1:J)>60)|any(init<0)) return(60)
H=list()
for(i in 1:J){
H[[i]]=init[i]+60/i*(0:(i-1))
}
tt=sort(unlist(H))
tt=c(tt,tt[1]+60)
d=diff(tt)
w=sum(d^2/2)/sum(d)
if(Print){
print(H)
cat(sum(d^2/2),'/',sum(d),'\n')
}
return(w)
}
densha(c(15,10),P=T)
optim(par=c(10,10,10),densha,method='BFGS')
densha(c(15,10,7.5),P=T)

376:卵の名無しさん
18/11/27 08:33:47.65 WzO5TT32.net
Pn(t)=rho^n/n!P0(t) ,1<=n<=s
Pn(t)=rho^n/s!s^(n-s)P0(t) , n>=s
P0(t)= 1/{sigma[n=0,n=s]rho^m/n! + rho^(s+1)/(s!(s-rho))}
URLリンク(www.geocities.co.jp)

377:卵の名無しさん
18/11/27 08:48:31.40 WzO5TT32.net
Pn(t)=rho^n/n!P0(t) ,1<=n<=s
Pn(t)=rho^n/(s!s^(n-s))P0(t) , n>=s
P0(t)= 1/{sigma[n=0,n=s]rho^n/n! + rho^(s+1)/(s!(s-rho))}
URLリンク(www.geocities.co.jp)
MMS = function(t, n, lamda,mu,s){
rho=lamda/mu
sig=0
for(i in 0:n) sig=sig+rho^i/factorial(i)
p0t=1/( sig + rho^(s+1)/factorial(s)/(s-rho) )
ifelse(n >= s, rho^n/factorial(s)/s^(n-s)*p0t, rho^n/factorial(n)*p0t)
}

378:卵の名無しさん
18/11/27 09:47:23.68 WzO5TT32.net
MMS = function(n, lamda=1/20,mu=1/10,s=3){
rho=lamda/mu
sig=0
for(i in 0:s) sig=sig+rho^i/factorial(i)
p0=1/( sig + rho^(s+1)/factorial(s)/(s-rho) )
ifelse(n >= s, rho^n/factorial(s)/s^(n-s)*p0, rho^n/factorial(n)*p0)
}
1-sum(sapply(0:3,MMS))

379:卵の名無しさん
18/11/27 09:48:36.29 WzO5TT32.net
演習問題
&#61550; 問題
&#61550; 電話回線のチケット予約システムがあり、その窓口数は3であ

&#61550; 予約の電話は平均して20秒に1回
&#61550; 窓口は1件あたり10秒必要
&#61550; 予約時3つの窓口がすべて応対中であれば話中になる
&#61550; このシステム全体を損失系M/M/3とみなせるとする
このとき、
&#61550; 話中である確率を求めなさい
&#61550; 話中となる確率を1%未満とするには、窓口はいくつ必要です
か?

380:卵の名無しさん
18/11/27 09:56:32.58 WzO5TT32.net
>>354 MMS = function(n, lamda=1/20,mu=1/10,s=3){
rho=s*lamda/mu
sig=0
for(i in 0:s) sig=sig+rho^i/factorial(i)
p0=1/( sig + rho^(s+1)/factorial(s)/(s-rho) )
ifelse(n >= s, rho^n/factorial(s)/s^(n-s)*p0, rho^n/factorial(n)*p0)
}
1-sum(sapply(0:3,MMS))

381:卵の名無しさん
18/11/27 09:57:04.81 WzO5TT32.net
MMS = function(n, lamda=1/20,mu=1/10,s=3){
rho=s*lamda/mu
sig=0
for(i in 0:s) sig=sig+rho^i/factorial(i)
p0=1/( sig + rho^(s+1)/factorial(s)/(s-rho) )
ifelse(n >= s, rho^n/factorial(s)/s^(n-s)*p0, rho^n/factorial(n)*p0)
}
1-sum(sapply(0:3,MMS))

382:卵の名無しさん
18/11/27 09:59:56.71 WzO5TT32.net
MMS = function(n, λ=1/20,μ=1/10,s=3){
ρ=s*λ/μ
sig=0
for(i in 0:s) sig=sig+ρ^i/factorial(i)
p0=1/( sig + ρ^(s+1)/factorial(s)/(s-ρ) )
ifelse(n >= s, ρ^n/factorial(s)/s^(n-s)*p0, ρ^n/factorial(n)*p0)
}
1-sum(sapply(0:3,MMS))

383:卵の名無しさん
18/11/27 10:36:18.18 WzO5TT32.net
MMS = function(n, λ=1/20,μ=1/10,s=3){
ρ=λ/μ
sig=0
for(i in 0:s) sig=sig+ρ^i/factorial(i)
p0=1/( sig + ρ^(s+1)/factorial(s)/(s-ρ) )
ifelse(n >= s, ρ^n/factorial(s)/s^(n-s)*p0, ρ^n/factorial(n)*p0)
}

384:卵の名無しさん
18/11/27 11:23:34.49 WzO5TT32.net
draft
.lambda=1/20
.mu=1/10
.s=1
MMS = function(n, lambda=.lambda ,mu=.mu,s=.s){
rho=lambda/mu
sig=0
for(i in 0:s) sig=sig+rho^i/factorial(i)
p0=1/( sig + rho^(s+1)/factorial(s)/(s-rho) )
ifelse(n >= s, rho^n/factorial(s)/s^(n-s)*p0, rho^n/factorial(n)*p0)
}
now8=function(x){
p=0
for(i in 0:x) p=p+MMS(i,s=x)
}
1-now8(1)
E=0
for(i in 0:1e4) E=E+i*MMS(i)
E*(1/.mu)
n=(1:10)[which.max(sapply(1:10,now8)>0.9)]
now8(n)

385:卵の名無しさん
18/11/27 12:44:46.57 RTIAbEXI.net
”お待たせしません”を謳い文句にした真面耶馬医院で
患者の来院は平均して20分に1人、診療は1人あたり10分とする。
診察医は一人。
謳い文句に反して患者が待たされる確率は?
患者の平均待ち時間は?
待たされる確率を10%以下にするには何人の医師が必要か?
待ち時間を3分以下にするには何人の医師が必要か?
lambda=1/20;mu=1/10
MMS = function(n, lambda ,mu, s){
rho=lambda/mu # rho < s
sig=0
for(i in 0:s) sig=sig+rho^i/factorial(i)
p0=1/( sig + rho^(s+1)/factorial(s)/(s-rho) )
# Pn : probability of n guests in system
Pn=ifelse(n >= s, rho^n/factorial(s)/s^(n-s)*p0, rho^n/factorial(n)*p0)
Ps=rho^s/factorial(s)*p0
L=rho + Ps*s*rho/(s-rho)^2 # guests in system
Lq=Ps*s*rho/(s-rho)^2 # guests in que
Wq=Lq/lambda # waiting time in que
c(`Pn(t)`=Pn,L=L,Lq=Lq,Wq=Wq)
}
# No Wait Probability when s=x
nwp=function(x,lambda,mu){
p=0
for(i in 0:x) p=p+MMS(i,lambda,mu,s=x)
p
}
nwp(1,lambda,mu)
nwp(2,lambda,mu)

386:卵の名無しさん
18/11/27 13:05:37.04 RTIAbEXI.net
問題(第1種情報処理技術者試験・平成元年度春期午前問17を改題)
ある医院では、患者が平均10分間隔でポアソン到着にしたがって訪ねてくることがわかった。
医者は1人であり、1人の患者の診断及び処方にかかる時間は平均8分の指数分布であった。
設問1 患者が待ち始めてから、診断を受け始めるまでの「平均待ち時間」を求めなさい。
設問2 待っている患者の平均人数を求めなさい。
設問3 患者の「平均待ち時間」が60分となるような平均到着間隔は約何分か?秒単位を
      切り捨てた値を答えなさい。
これに 
設問4  「平均待ち時間」を10分以下にするには同じ診察効率の医師が何人に必要か?

387:卵の名無しさん
18/11/27 13:53:38.67 RTIAbEXI.net
# ある医院では、患者が平均10分間隔でポアソン到着にしたがって訪ねてくることがわかった。
# 医者は1人であり、1人の患者の診療にかかる時間は平均8分の指数分布であった。
# 「平均待ち時間」を5分以下にするには同じ診察効率の医師が何人に必要か?
# その最小人数で「平均待ち時間」を5分以下に保って診療するには1時間に何人まで受付可能か?
sapply(1:3,function(x) MMS(0,1/10,1/8,x)['Wq'])
MMS(0,1/10,1/8,s=2)
f= function(l) MMS(0,l,mu=1/8,s=2)['Wq']
v=Vectorize(f)
curve(v(x),bty='l',0,2/8) # rho=l/m < s , l < s*m
abline(h=5,lty=3)
60*uniroot(function(x)v(x)-5,c(0.1,0.2))$root
MMS(0,9.3/60,mu=1/8,s=2)

388:卵の名無しさん
18/11/27 15:40:44.01 RTIAbEXI.net
# M/M/S(s)
MMSs <- function(n,lambda,mu,s){
if(n > s) return(0)
rho=lambda/mu # rho < s
sig=0
for(i in 0:s) sig=sig+rho^i/factorial(i)
Pn=rho^n/factorial(n)/sig
return(Pn)
}
s=3
sapply(0:s,function(x) MMSs(x,1/20,1/10,s))
cnvg=function(x,lambda,mu) MMSs(x,lambda,mu,x) # 輻輳 convergence
vc=Vectorize(function(x) cnvg(x,10/60,1/30))
(1:10)[vc(1:10) < 0.05]

389:卵の名無しさん
18/11/27 18:51:54.59 sOmaXwxS.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

390:卵の名無しさん
18/11/27 20:30:45.92 RTIAbEXI.net
mms <- function(n,lambda,mu,s,t=0,Print=TRUE){
alpha=lambda/mu
rho=lambda/s/mu # alpha=s*rho
sig0=0
for(i in 0:(s-1)) sig0=sig0+alpha^i/factorial(i)
P0=1/( sig0 + alpha^s/factorial(s-1)/(s-alpha) )
Pn=ifelse(n >= s, alpha^n/factorial(s)/s^(n-s)*P0, alpha^n/factorial(n)*P0)
Lq=lambda*mu*alpha^s/factorial(s-1)/(s*mu-lambda)^2*P0
L=Lq+alpha
Wq=Lq/lambda
#=mu*alpha^s/factorial(s-1)/(s*mu-lambda)^2*P0
W=Wq+1/mu
Pc=mu*P0*alpha^s/factorial(s-1)/(s*mu-lambda)
#=s^s*P0/factorial(s)*rho^s/(1-rho)
PTt=Pc*exp(-(1-rho)*s*mu*t)
output=c(P0=P0,Pn=Pn,Lq=Lq,L=L,Wq=Wq,W=W,Pc=Pc,PTt=PTt)
# P0:0 in system, Pn:n in system, Lq:guests in que, Wq: waiting time in que
# L:quests in system, W:total waiting time, Pc:all windows occupied,
# P: waiting time in que greater than t
if(Print) print(output,digits=3)
invisible(output)
}
mms(n=0,lambda=1/60,mu=1/10,s=1,t=0)

391:卵の名無しさん
18/11/27 20:40:29.10 2tUinJG4.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

392:卵の名無しさん
18/11/27 21:06:39.05 RTIAbEXI.net
レジが1台ある。客の到着が1時間あたり平均12人であり、
レジの所要時間が平均3分のとき,次の値を求めてみよう。
?到着したとき,すぐにサービスが受けられる確率
?系の中にいる人の平均人数
?サービスを待っている人の平均人数
?到着してからサービスを受けて去るまでの平均時間
?到着してからサービスを受けるまでの平均待ち時間
?客の到着が2倍の平均24人になった。到着してからサービスを受けて去るまでの平均時間を変えないようにするには
レジの平均サービス時間を何分にすればよいか?求めてみよう。

393:卵の名無しさん
18/11/27 21:08:46.15 RTIAbEXI.net
筆算は面倒。数値を変えても算出できるようにした。
mms <- function(n,lambda,mu,s,t=0,Print=TRUE){
alpha=lambda/mu
rho=lambda/s/mu # alpha=s*rho
sig0=0
for(i in 0:(s-1)) sig0=sig0+alpha^i/factorial(i)
P0=1/( sig0 + alpha^s/factorial(s-1)/(s-alpha) )
Pn=ifelse(n >= s, alpha^n/factorial(s)/s^(n-s)*P0, alpha^n/factorial(n)*P0)
Lq=lambda*mu*alpha^s/factorial(s-1)/(s*mu-lambda)^2*P0
L=Lq+alpha
Wq=Lq/lambda
#=mu*alpha^s/factorial(s-1)/(s*mu-lambda)^2*P0
W=Wq+1/mu
Pc=mu*P0*alpha^s/factorial(s-1)/(s*mu-lambda)
#=s^s*P0/factorial(s)*rho^s/(1-rho)
PTt=Pc*exp(-(1-rho)*s*mu*t)
output=c(P0=P0,Pn=Pn,Lq=Lq,L=L,Wq=Wq,W=W,Pc=Pc,PTt=PTt)
# P0:0 in system, Pn:n in system, Lq:guests in que, Wq: waiting time in que
# L:quests in system, W:total waiting time, Pc:all windows occupied,
# P: waiting time in que greater than t
if(Print) print(output,digits=3)
invisible(output)
}
> mms(0,12/60,1/3,1)
P0 Pn Lq L Wq W Pc PTt
0.4 0.4 0.9 1.5 4.5 7.5 0.6 0.6
> uniroot(function(x) mms(0,24/60,1/x,1,P=F)['W']-7.5,c(0.1,2))$root
[1]


394: 1.874993



395:卵の名無しさん
18/11/27 23:07:59.15 RTIAbEXI.net
# M/M/s/K
MMSK <- function(lambda,mu,s,k){
alpha=lambda/mu
sig1=sig2=0
for(n in 0:s) sig1=sig1+alpha^n/factorial(n)
if(k>s) for(n in 1:(k-s)) sig2=sig2+alpha^s/s*(alpha/s)^n
Psk=s^s/factorial(s)*(alpha/s)^k/(sig1+sig2)
return(Psk)
}
MMSK(lambda=1/20,mu=1/10,s=3,k=3)
MMSS(n=3,l=1/20,m=1/10,s=3)
E2s <- function(alpha,s) MMSK(alpha,1,s,s)
E2s(0.5,3) # call loss, convergence α^s/s! / Σ[n=0,s]a^n/n!
a=seq(0,3,len=101)
plot(a,sapply(a,function(x)E2s(x,s=1)),type='l',bty='l',ylab='call loss prob.')
lines(a,sapply(a,function(x)E2s(x,s=2)),lty=2)
lines(a,sapply(a,function(x)E2s(x,s=3)),lty=3)

396:卵の名無しさん
18/11/27 23:08:01.08 yIHJQdw7.net
音楽の問題です
アヘ顔ダブルPEA~~~CE
v(゜∀。)v

397:卵の名無しさん
18/11/28 07:55:01.98 5n5kFcMp.net
f <- function() sum(rbinom(10,3,1/3)==rbinom(10,3,1/3))
g <- function(k) mean(replicate(k,f()))
h=Vectorize(g)
x=seq(1000,100000,by=1000)
re=h(x)
plot(x,re,pch=19,bty='l',ann=F)

398:卵の名無しさん
18/11/28 08:08:55.83 5n5kFcMp.net
f <- function() sum(rbinom(10,3,1/3)==rbinom(10,3,1/3))
g <- function(k) mean(replicate(k,f()))
h=Vectorize(g)
x=seq(1000,100000,by=1000)
re=h(x)
plot(x,re,pch=19,bty='l',ann=F)
x=rep(100,10000)
y=h(x)
cx=cumsum(x)
cy=cumsum(y)/1:10000
plot(cx,cy,type='l')

399:卵の名無しさん
18/11/28 13:47:18.06 5n5kFcMp.net
rm(list=ls())
n=10 ; lambda=10/60 ; mu=1/8
# service starc clock time(ssct) since 9:00
ssct=numeric(n)
# waiting time(w8)
w8=numeric(n)
# service end clock time(sect)
sect=numeric(n)
# arrival clock time(act)
set.seed(1234) ; act=round(cumsum(rexp(n,lambda)))
# duration of service(ds)
set.seed(5678) ; ds=round(rexp(n,mu))
# step by step
act
ds
ssct[1]=act[1] # 9:15
sect[1]=act[1]+ds[1] # 9:25
act[2] # 9:16
max(sect[1]-act[2],0) # 9:25-9:16 vs 0
w8[2]=max(sect[1]-act[2],0) # 9 min
ssct[2]=max(sect[1],act[2]) # 9:25 vs 9:16
sect[2]=ssct[2]+ds[2] # 9:25 + 8 = 9:33
act[3] # 9:17
max(sect[2]-act[3],0) # 9:33 - 9:17 vs 0
w8[3]=max(sect[2]-act[3],0) # 16 min
ssct[3]=max(sect[2],act[3]) # 9:33 vs 9:17
sect[3]=ssct[3]+ds[3] # 9:33 + 11 = 9:44

400:卵の名無しさん
18/11/28 15:01:41.58 5n5kFcMp.net
# ある医院に1時間あたり平均5人の患者が来院し、その人数の分布はポアソン分布にしたがうとする。
# 1時間あたりの平均診療人数は6人で、一人あたりの診療時間は指数分布に従うとする。
# 診察までの平均の待ち時間は何時間か?
rm(list=ls())
# Five patients comes every hour on average to the clinic,
# and the single physicaina treats six patients every hour on average.
# n=40 ; lambda=5/60 ; mu=6/60
MM1sim <- function(n=40,lambda=5/60,mu=6/60,seed=FALSE,Print=TRUE){
# service starc clock time(ssct) since 9:00
ssct=numeric(n)
# waiting time(w8)
w8=numeric(n)
# service end clock time(sect)
sect=numeric(n)
# arrival clock time(act)
if(seed) set.seed(1234) ;
act=round(cumsum(rexp(n,lambda)))
# duration of service(ds)
if(seed) set.seed(5678) ;
ds=round(rexp(n,mu))
# simulation assuming service starts at 9:00
head(act) # act : arrival clock time
head(ds) # ds : duration of service
# initial values
ssct[1]=act[1] # 9:15 service start clock time for 1st guest
sect[1]=act[1]+ds[1] # 9:25 sevice end clock time for 1st guest
w8[1]=0

401:卵の名無しさん
18/11/28 15:02:14.90 5n5kFcMp.net
# simulation step by step
#
# act[2] # 9:16 arrival clock time of 2nd
# max(sect[1]-act[2],0) # 9:25-9:16 vs 0 = ?sevice for 1st ends b4 2nd arrival
# w8[2]=max(sect[1]-act[2],0) # 9 min : w8ing time of 2nd
# ssct[2]=max(sect[1],act[2]) # 9:25 vs 9:16 = service start clock time for 2nd
# sect[2]=ssct[2]+ds[2] # 9:25 + 8 = 9:33 service end clock time for 2nd
#
# act[3] # 9:17 arrival clock time of 3rd
# max(sect[2]-act[3],0) # 9:33 - 9:17 vs 0 = ?serivce for 2nd ends b4 3rd arrival?
# w8[3]=max(sect[2]-act[3],0) # 16 min : w8ting time of 3rd
# ssct[3]=max(sect[2],act[3]) # 9:33 vs 9:17 = service start clock time for 3rd
# sect[3]=ssct[3]+ds[3] # 9:33 + 11 = 9:44 service end clock time for 3rd
#
for(i in 2:n){
w8[i]=max(sect[i-1]-act[i],0)
ssct[i]=max(sect[i-1],act[i])
sect[i]=ssct[i]+ds[i]
}
if(Print){
print(summary(w8))
hist(w8,freq=FALSE,col="lightblue",main="")
}
invisible(w8)
}
w8m=replicate(1e3,mean(MM1sim(P=F)))
summary(w8m)

402:卵の名無しさん
18/11/28 19:33:11.50 5n5kFcMp.net
>>374
行列の長さが変わらない定常状態達したら理論値通りに動作しているようだ。
エラー処理はしていなし、細かいバグがあるかもしれないが、
一応完成。
URLリンク(www.tutorialspoint.com)

403:卵の名無しさん
18/11/28 21:10:01.72 CEw4d3xR.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

404:卵の名無しさん
18/11/29 13:46:13.50 vdx9uljL.net
待ち行列理論の公式って
待ち行列の長さが変わらない定常状態での計算値だなぁ。
こういう設定に適応していいのか疑問があるな。
# Five clients comes every hour on average to the office,
# and the single clerk serves six clients every hour on average.
# n=40 ; lambda=5/60 ; mu=6/60

405:卵の名無しさん
18/11/29 13:47:25.88 vdx9uljL.net
シミュレーターを改良
MM1sim <- function(n=40,lambda=5/60,mu=6/60,
Lcount=FALSE,seed=FALSE,Brief=TRUE,Print=TRUE,Round=FALSE){
# n: how many clients, lambda: clients per hour, mu: service per hour
# Lcont: calculate clients in que, seed: ?set.seed
# Brief: ?show summary, Print: ?print graphs, Round: ?round result
# service starc clock time(ssct) since 9:00
ssct=numeric(n)
# waiting time in que(Wq)
Wq=numeric(n)
# waiting time from arrival to service end(W)
W=numeric(n)
# service end clock time(sect)
sect=numeric(n)
# arrival clock time(act)
if(seed) set.seed(1234)
act=cumsum(rexp(n,lambda)) ; if(Round) act=round(act)
# duration of service(ds)
if(seed) set.seed(5678)
ds=rexp(n,mu) ; if(Round) ds=round(ds)
# initial values
ssct[1]=act[1] # 9:15 service start clock time for 1st guest
sect[1]=act[1]+ds[1] # 9:25 sevice end clock time for 1st guest
Wq[1]=0

406:卵の名無しさん
18/11/29 13:47:48.53 vdx9uljL.net
for(i in 2:n){
Wq[i]=max(sect[i-1]-act[i],0)
ssct[i]=max(sect[i-1],act[i])
sect[i]=ssct[i]+ds[i]
}
W=Wq+ds
L=Lq=NA
if(Lcount){
ct2Lq <- function(ct){ # ct:clock time to Lq
sum(act<ct & ct<ssct)
}
Lq=mean(sapply(seq(0,max(ssct),len=1e4),ct2Lq)) # average clients in que
ct2L <- function(ct){ # ct:clock time to Lq
sum(act<ct & ct<sect)
}
L=mean(sapply(seq(0,max(ssct),len=1e4),ct2L)) # average clients in que
}
if(Brief){
cat("Lq = ",Lq,'\n',"summary of Waiting in que \n")
print(summary(Wq))
cat("L = ",L,'\n',"summary of total time since arrival \n")
print(summary(W))}

407:卵の名無しさん
18/11/29 13:48:05.65 vdx9uljL.net
if(Print){
par(mfrow=c(2,2))
hist(Wq,freq=FALSE,col="lightblue",main="Waiting time in que")
hist(W,freq=FALSE,col="lightgreen",main="Total time since arrival")
plot(sect,1:n,type='n',bty='l',ylab="client",xlab='clock time',
main=paste('average waiting time :',round(mean(Wq),2)))
segments(y0=1:n,x0=act,x1=ssct,col='gray')
points(act,1:n,pch=1)
points(ssct,1:n,pch=19)
points(sect,1:n,pch=3,cex=0.6)
legend('bottomright',bty='n',legend = c('arrival','service start','service end'),pch=c(1,19,3))
if(Lcount){ct=seq(0,max(ssct),len=1e4)
plot(ct,sapply(ct,ct2Lq),xlab="clock time",ylab="",main="clients in que",
type='s',bty='l')}
par(mfrow=c(1,1))
}
output=list(Wq=Wq,W=W,Lq=Lq,L=L,arrival=act,start=ssct,end=sect,duration=ds)
invisible(output)
}
MM1sim(n=40,Lcount=T,R=T,P=T,seed=F)

408:卵の名無しさん
18/11/29 14:01:23.60 vdx9uljL.net
来院数がポアソン分布(来院間隔は指数分布)、
診療時間はそれまでの患者の診療時間に影響されない(マルコフ性とか無記憶性と呼ばれる)ので指数分布
と仮定して、1時間に5人受診、診療時間は10分を平均値として受診数を40人としてシミュレーションすると
こんなにばらついた。
URLリンク(i.imgur.com)
URLリンク(i.imgur.com)
待ち時間行列理論でクリニックの待ち時間計算すると現実と大きく乖離すると思える。

409:卵の名無しさん
18/11/29 14:23:01.20 vdx9uljL.net
来院数がポアソン分布(来院間隔は指数分布)、
診療時間はそれまでの患者の診療時間に影響されない(マルコフ性とか無記憶性と呼ばれる)ので指数分布
と仮定して、1時間に5人受診、診療時間は10分を平均値として受診数を40人としてシミュレーション。
その結果
診療までの待ち時間
> summary(Wqm)
Min. 1st Qu. Median Mean 3rd Qu. Max.
1.793 11.828 19.204 26.041 34.621 164.905
診療終了までの時間
> summary(Wm)
Min. 1st Qu. Median Mean 3rd Qu. Max.
7.952 20.296 29.359 35.335 44.600 161.234
診療待ちの人数
> summary(Lqm)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.1821 0.8501 1.5866 2.0976 2.7414 11.2506

410:卵の名無しさん
18/11/29 14:52:35.68 vdx9uljL.net
受診者数と平均待ち時間をシミュレーションしてみた。
受診者数が増えれば待ち行列時間の理論値50分に収束していくようだ。
URLリンク(i.imgur.com)

411:卵の名無しさん
18/11/29 17:16:02.63 pxHQyZHt.net
sim = function(){
x=cumsum(rexp(5,5/15))
x[4] < x[3]+1
}
mean(replicate(1e5,sim()))
pexp(1,5/15)

412:卵の名無しさん
18/11/29 19:04:59.01 vdx9uljL.net
>>384
定常状態での理論値
mms <- function(n,lambda,mu,s,t=0,Print=TRUE){
alpha=lambda/mu
rho=lambda/s/mu # alpha=s*rho
sig0=0
for(i in 0:(s-1)) sig0=sig0+alpha^i/factorial(i)
P0=1/( sig0 + alpha^s/factorial(s-1)/(s-alpha) )
Pn=ifelse(n >= s, alpha^n/factorial(s)/s^(n-s)*P0, alpha^n/factorial(n)*P0)
Lq=lambda*mu*alpha^s/factorial(s-1)/(s*mu-lambda)^2*P0
L=Lq+alpha
Wq=Lq/lambda
#=mu*alpha^s/factorial(s-1)/(s*mu-lambda)^2*P0
W=Wq+1/mu
Pc=mu*P0*alpha^s/factorial(s-1)/(s*mu-lambda)
#=s^s*P0/factorial(s)*rho^s/(1-rho)
PTt=Pc*exp(-(1-rho)*s*mu*t)
output=c(P0=P0,Pn=Pn,Lq=Lq,L=L,Wq=Wq,W=W,Pc=Pc,PTt=PTt)
# P0:0 in system, Pn:n in system, Lq:guests in que, Wq: waiting time in que
# L:quests in system, W:total waiting time, Pc:all windows occupied,
# P: waiting time in que greater than t
if(Print) print(output,digits=3)
invisible(output)
}
> mms(0,5/60,6/60,1)
P0 Pn Lq L Wq W Pc PTt
0.167 0.167 4.167 5.000 50.000 60.000 0.833 0.833

413:卵の名無しさん
18/11/29 21:16:08.05 W5xHj2Da.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

414:卵の名無しさん
18/11/30 10:07:25.16 c4eruZjZ.net
rm(list=ls())
graphics.off()
par(mfrow=c(1,2))
a=360 ; b=1
R = function(t) ifelse(0<=t&t<=2*b,-a*t*(t-2*b),0)
N = integrate(R,0,2*b)$value ; (N=4*a*b^3/3)
A = function(t) ifelse(0<=t&t<=2*b,-a*t^3/3 +a*b*t^2,N)
curve(A(x),0,3,lwd=2,bty='l',xlab='t')
mu=100
n.win=2
c=n.win*mu
curve(R(x),0,3,lwd=2,bty='l',xlab='t') ; abline(h=2:3*mu,lty=1:2)
uniroot(function(t) R(t)-c,c(0,1))$root
d = sqrt(b^2-c/a)
t1 = b - d ; t1
Q <- function(t) A(t)-A(t1)-c*(t-t1)
curve(Q(x),0,3,bty='l') ; abline(h=0,col=8)
Q. <- function(t) -a*(t-t1)^3/3 + a*d*(t-t1)^2
curve(Q.(x),0,3,bty='l') ; abline(h=0,col=8)
optimize(Q,c(0,1))$minimum
uniroot(Q,c(1,3))$root ; t1+3*d ; (t4.1=b+2*d)
Q(2*b)/c +2*b; (t4.2=a/3/c*(b+d)^2*(2*d-b) +2*b)
par(mfrow=c(1,1))
curve(A(x),0,3,lwd=2,bty='l',xlab='t')
curve(x*N/t4.1,add=T)
integrate(Q.,t1,t4.1)$value ; 9/4*a*d^4
integrate(Q.,t1,2*b)$value + 1/2*(t4.2-2*b)*Q.(2*b) ; a/36*(b+d)^3/(b-d)*(4*b*d-b^2-d^2)
integrate(Q.,t1,t4.1)$value/N
(integrate(Q.,t1,2*b)$value + 1/2*(t4.2-2*b)*Q.(2*b))/N
min(9/4*a*d^4,a/36*(b+d)^3/(b-d)*(4*b*d-b^2-d^2))/N

415:卵の名無しさん
18/11/30 10:11:24.11 c4eruZjZ.net
c2Wq <- function(c,a=360,b=1){ #-> Wq:平均待ち時間
# R(t): 到着率関数 -at(t-2b)
# c:サービス率
R = function(t) ifelse(0<=t&t<=2*b,-a*t*(t-2*b),0)
N=4*a*b^3/3
d = sqrt(b^2-c/a)
min(case1=9/4*a*d^4/N,case2=a/36*(b+d)^3/(b-d)*(4*b*d-b^2-d^2)/N)
}
c2Wq(300)

416:卵の名無しさん
18/11/30 14:10:17.12 c4eruZjZ.net
rm(list=ls())
graphics.off()
par(mfrow=c(2,1))
a=360 ; b=1 # R(t) at(t-2b) 到着率関数[0,2b]
R = function(t) ifelse(0<=t&t<=2*b,-a*t*(t-2*b),0)
curve(R(x),0,3,bty='l',xlab='t')
N = integrate(R,0,2*b)$value ; 4*a*b^3/3 # 総人数
A = function(t) ifelse(t<=2*b,-a*t^3/3 +a*b*t^2,N) # 流入関数=∫Rdt
# = integerate(function(t) R(t),0,t) 0<t<2b
curve(A(x),0,3,bty='l',xlab='t')
mu=100 # 一窓口当たりのサービス率
n.win=2 # 窓口数
c=n.win*mu # 全サービス率
curve(R(x),0,3,bty='l',xlab='t') ; abline(h=2:3*mu,lty=1:2,col=8)
legend('center',bty='n',legend=c("2窓口","3窓口"),lty=c(1,2),col=8)
uniroot(function(t) R(t)-c,c(0,1))$root # 行列>0 : 流入率>サービス率
d = sqrt(b^2-c/a)
t1 = b - d ; t1 # 行列の始まる時刻(解析値) : 流入率=サービス率
Q <- function(t) A(t)-A(t1)-c*(t-t1) # 行列の人数 定義域無視
curve(Q(x),0,3,bty='l',xlab='t')
optimize(Q,c(0,1))$minimum
# 行列の終わる時刻
uniroot(Q,c(1,1e6))$root
t4 = ifelse(2*d<b,b+2*d,a/3/c*(b+d)^2*(2*d-b) +2*b) ; t4 #解析値
 # 行列終了時刻 t4 < 2b : 入場締切前に行列0 (2*d<b)
if(2*d<b) c(t1+3*d, b+2*d)
 # 行列終了時刻 t4 > 2b : 入場締切後に行列0 (2*d>b)
 if(2*d>b) c(Q(2*b)/c +2*b, a/3/c*(b+d)^2*(2*d-b) +2*b)
Q <- function(t) ifelse(t1<=t & t<=t4 ,A(t)-A(t1)-c*(t-t1),0) # 行列の人数[t1,t4]
curve(Q(x),0,3,bty='l',type='h',xlab='t',ylab="Wq",col='navy')

417:卵の名無しさん
18/11/30 14:12:35.52 c4eruZjZ.net
Q.<- function(t){
if(t1<=t & t<= min(t4,2*b)) -a*(t-t1)^3/3 + a*d*(t-t1)^2}
# -a*(t-t1)^3/3 + a*d*(t-t1)^2 # 解析値[t1,min(t4,2b)]
tt=seq(t1,min(t4,2*b),len=1000)
lines(tt,sapply(tt,Q.),bty='l',type='l',xlab='t',ylab='Wq')
par(mfrow=c(1,1))
curve(A(x),0,3,bty='l',ylab='person',xlab='t',lwd=1,
main="到着率:at(t-2b) サービス率:200") # 累積入場者
curve(Q(x),0,3,col='navy',add=T,lwd=1,lty=3,type='h') # 待ち人数
tt=seq(0,3,len=1000)
lines(tt,sapply(tt,function(t)A(t)-Q(t)),lwd=2,col=4)
legend('right',bty='n',legend=c("流入総数","流出総数","待ち人数"),
col=c(1,4,1),lty=c(1,1,3),lwd=c(1,2,1))
integrate(Q,t1,t4)$value # 総待ち時間(=縦軸方向積分面積Area


418: under curve) Wtotal=ifelse(2*d<b,9/4*a*d^4,a/36*(b+d)^3/(b-d)*(4*b*d-b^2-d^2)) ; Wtotal Wq=Wt/N ; Wq



419:卵の名無しさん
18/11/30 14:22:24.86 c4eruZjZ.net
数式を追うだけだと身につかないからプログラムに入力して自分でグラフを書いてみると理解が捗る。
自分がどこができていないもよく分かる。必要な計算ができないとグラフが完成できないから。
プログラムしておくとあとで数値を変えて再利用できるのが( ・∀・)イイ!!
URLリンク(i.imgur.com)

420:卵の名無しさん
18/11/30 21:39:40.37 kXCX0lfh.net
Prudence, indeed, will dictate that "uraguchi" long established cannot be changed for light and transient causes;
and accordingly all experience has shown, that BMS are more disposed to suffer, while evils are sufferable, than to right themselves by abolishing the forms from which they can pursue profit.
But when a long train of misbehavior and misconduct , showing invariably the same Imbecility evinces a design to reveal themselves as absolute Bona Fide Moron ,
it is their right, it is their duty, to expel such "uraguchi", and to provide new guards for their future security.

421:卵の名無しさん
18/11/30 23:12:28.51 c4eruZjZ.net
#
source('tmp.tools.R') # 乱数発生にNeumann法
# 受付時間9:00-12:30,15:30-19:00
curve(10*(dgamma(x-9,2,1)+dgamma(x-16,8,5)),9,20,type='h') # 雛形
R <- function(x) ifelse((9<x&x<12.5)|(15.5<x&x<19),dgamma(x-9,2,1)+dgamma(x-16,8,5),0)
set.seed(123) ; data=vonNeumann2(function(x) R(x),9,19,Print=F)
N=100 # 来院患者数
n.win=1 # サービス窓口数
mu=8 # サービス率(1時間診察人数)
client=hist(data,freq=F,breaks=30,col='skyblue',main='',xlab='clock time')
breaks=client$breaks
y=client$counts/sum(client$counts)*N # 総数をN人に
# 到達率関数,離散量を連続関数に
R <- function(x) ifelse((9<x&x<12.5)|(15.5<x&x<19),y[which.max(x<=breaks)-1],0)
R=Vectorize(R)
curve(R(x),9,20,type='h',bty='l')
c=n.win*mu # 総サービス率
abline(h=c,col=8)
t1=uniroot(function(t)R(t)-c,c(9,10))$root ; t1 # 到達率=サービス率で待ち時間開始
t2=uniroot(function(t)R(t)-c,c(16,17))$root ; t2 # 午後の部

422:卵の名無しさん
18/11/30 23:12:57.93 c4eruZjZ.net
tt=seq(9,24,len=1000)
Rtt=R(tt)
plot(tt,Rtt,type='s',bty='l')
cumR=cumsum(Rtt)/sum(Rtt)*N # cumsumで累積来院数をgrid化
plot(tt,cumR,type='l',bty='l')
A <- function(t) cumR[which.max(t<=tt)] # 離散量を連続関数に
A=Vectorize(A)
curve(A(x),9,24,bty='l')
Q <- function(t){ # 時刻tでの待ち人数
if(t<t1) return(0)
if(t1<t&t<t2) return(max(A(t)-A(t1)-c*(t-t1),0)) # 午前の部
else return(max(A(t)-A(t2)-c*(t-t2),0)) # 午後の部
}
Q=Vectorize(Q)
curve(Q(x),9,24,bty='l',type='h',col=2,ylab='persons',xlab='clock time')
# 待ちの発生と終了の時刻をグラフから読み取る
t15=seq(14,15,len=100) ; plot(t15,sapply(t15,Q)) # 14.6
t17=seq(16.9,17.2,len=100) ; plot(t17,sapply(t17,Q)) # 17.0
Q(22.7)
t22=seq(22.75,22.80,len=100) ; plot(t22,sapply(t22,Q)) # 22.8
curve(Q(x),9,24,bty='l',type='h',col=2,ylab='persons',xlab='clock time')
MASS::area(Q,9, 14.6,limit=20)/A(14.6) # 午前の待ち時間
MASS::area(Q,17,22.8,limit=20)/(A(22.8)-A(17)) # 午後の待ち時間

423:卵の名無しさん
18/11/30 23:51:07.01 c4eruZjZ.net
午前の受付9時から12時30分まで午後の受付15時30分から19時までのクリニックに
図のような二峰性の分布で100人が来院するとする。
URLリンク(i.imgur.com)
> breaks
[1] 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 14.5
[13] 15.0 15.5 16.0 16.5 17.0 17.5 18.0 18.5 19.0
> round(y)
[1] 5 8 10 8 6 5 3 0 0 0 0 0 0 0 0 7 19 17 8 3
医師は一人、診察時間は平均8分として待ち時間をグラフ化。
URLリンク(i.imgur.com)
数値積分して平均の待ち時間を算出。
> integrate(Q,9,14.6,subdivisions=256)$value/A(14.6) # 午前の待ち時間
[1] 1.175392
> integrate(Q,17,22.8,subdivisions=256)$value/(A(22.8)-A(17)) # 午後の待ち時間
[1] 2.214289

424:卵の名無しさん
18/12/01 00:40:16.84 yFxD3TpK.net
>>385
混雑と待ち(朝倉書店)が届いたので
これやってみた。
ポアソン分布や指数分布を前提とせず、実際のヒストグラムから待ち時間のシミュレーション。
午前の受付9時から12時30分まで午後の受付15時30分から19時までのクリニックに
図のような二峰性の分布で100人が来院するとする。
URLリンク(i.imgur.com)
> breaks
[1] 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 14.5
[13] 15.0 15.5 16.0 16.5 17.0 17.5 18.0 18.5 19.0
> round(y)
[1] 5 8 10 8 6 5 3 0 0 0 0 0 0 0 0 7 19 17 8 3
医師は一人、診察時間は平均8分として待ち時間をグラフ化。
URLリンク(i.imgur.com)
数値積分して平均の待ち時間を算出。
> integrate(Q,9,14.6,subdivisions=256)$value/A(14.6) # 午前の待ち時間
[1] 1.175392
> integrate(Q,17,22.8,subdivisions=256)$value/(A(22.8)-A(17)) # 午後の待ち時間
[1] 2.214289

URLリンク(i.imgur.com)
診療終了23時w

425:卵の名無しさん
18/12/01 00:40:42.20 yFxD3TpK.net
午後から医師は二人に増やすとどうなるかシミュレーションしてみた。
診察時間は一人平均8分の設定は同じ。
URLリンク(i.imgur.com)
> integrate(Q,17,19.9,subdivisions=256)$value/(A(19.9)-A(17)) # 午後の待ち時間
[1] 1.496882
待ち時間が2.2時間から1.5時間に短縮。
診療終了は20時!

426:卵の名無しさん
18/12/01 09:45:22.56 j/i2xXms.net
Prudence, indeed, will dictate that "uraguchi" long established cannot be changed for light and transient causes;
and accordingly all experience has shown, that BMS are more disposed to suffer, while evils are sufferable, than to right themselves by abolishing the forms from which they can pursue profit.
But when a long train of misbehavior and misconduct , showing invariably the same Imbecility evinces a design to reveal themselves as absolute Bona Fide Moron ,
it is their right, it is their duty, to expel such "uraguchi", and to provide new guards for their future security.

427:卵の名無しさん
18/12/01 10:03:30.90 RmWyTNtb.net
rm(list=ls())
nwin=2 ; mu=10
C=nwin*mu # サービス効率
R <- function(t) dgamma(t,2,1)*100 # 到達関数
R=Vectorize(R)
curve(R(x),0,10,bty='l') ; abline(h=C,col=8)
t1=uniroot(function(x)R(x)-C,c(0,1))$root ; t1 # 行列開始時刻
t2=optimise(R,c(0,2),maximum = T)$maximum ; t2 # 行列増大速度最高時刻
t3=uniroot(function(x)R(x)-C,c(1,4))$root ; t3 # 行列最長時刻
A <- function(t) integrate(R,0,t)$value # 累積来客数
A=Vectorize(A)
curve(A(x),0,10,bty='l')
Q <- function(t) A(t)-A(t1)-C*(t-t1) # 行列人数
Q=Vectorize(Q)
curve(Q(x),0,10,bty='l') ; abline(h=0,col=8)
optimize(Q,c(0,10),maximum=T)$maximum ; t3 # 行列最長時刻
t4=uniroot(Q,c(4,8))$root ; t4 # 行列終了時刻
# calculate t4 w/o Q-function 到達関数から行列終了時刻を算出
curve(R(x),0,10,bty='l',xlab='clock time',ylab='arrival rate')
abline(h=C,col=8)
t13=seq(t1,t3,len=20)
segments(x0=t13,y0=C,y1=R(t13),col=3)
text(1.25,25,'V') ; text(c(t1,t3,t4),20,c('t1','t3','t4'),cex=0.95)
V=integrate(function(t)R(t)-C,t1,t3)$value ; V # 待ち時間*人数
dQ <- function(t) integrate(function(x) C-R(x),t3,t)$value - V
uniroot(dQ,c(t3,10))$root ; t4
t34=seq(t3,t4,len=20)
segments(x0=t34,y0=20,y1=R(t34),col='cyan') ; text(4,15,'V')

428:卵の名無しさん
18/12/01 10:07:43.30 RmWyTNtb.net
>>400
到着関数が一峰性だと待ち行列が0になる時間が割と簡単に算出できる。
ド底辺シリツ医大裏口入学には無理だけどw
URLリンク(i.imgur.com)

429:卵の名無しさん
18/12/01 10:24:54.70 RmWyTNtb.net
>>399
ド底辺シリツ医を蔑むパロディであることわかってコピペしてんの?
これにでも答えてみ!
あるド底辺裏口シリツ医大のある学年に100人の学生がいる。
100人の学生は全員裏口入学である。
裏口入学を自覚したら翌日に退学しなければならない。
学生は自分以外の学生が裏口入学であるとことは全員知っているが自分が裏口入学であることは知らない。
教授が全員の前で「この学年には少なくとも一人が裏口入学している」と発言した。
この後、どうなるかを述べよ。

430:卵の名無しさん
18/12/01 13:36:46.51 ZZpMV2Nw.net
この季節はいつも風邪気味になるなぁ
外来から貰ってんのかな
冬コミが近いのに原稿がまだできとらんが
体調管理はしっかりしていかんとなぁ
ジャンルはFTで良いかなぁ
ガチ百合にすっかなぁ

431:卵の名無しさん
18/12/01 16:09:30.06 ZZpMV2Nw.net
便秘


432:薬をいろいろ試しているが どれが良いかなぁ



433:卵の名無しさん
18/12/01 18:54:24.93 RmWyTNtb.net
t0fn <- function(n){ # terminal 0 of factorial n ( n=10, 10!=3628800 => 2
m=floor(log(n)/log(5))
ans=0
for(i in 1:m) ans=ans+n%/%(5^i)
ans
}
t0fn=Vectorize(t0fn)
t0fn(10^(1:12))
10!から1兆!まで末尾の0の数
> t0fn(10^(1:12))
[1] 2 24 249 2499 24999
[6] 249998 2499999 24999999 249999998 2499999997
[11] 24999999997 249999999997

434:卵の名無しさん
18/12/01 18:55:28.45 RmWyTNtb.net
おい、ド底辺。
1兆の階乗は末尾に0が
249999999997
並ぶと計算されたが、あってるか?
検算しておいてくれ。

435:卵の名無しさん
18/12/01 20:53:46.49 o9d/f5rc.net
今年の納税額は五千万超えるなぁ
冬コミはFTCW の新作出るかなぁ?

436:卵の名無しさん
18/12/01 21:08:44.05 o9d/f5rc.net
ふ◯◯◯ち◯◯れ◯◯◯◯

437:卵の名無しさん
18/12/01 22:41:26.00 N4WBnKxq.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

438:卵の名無しさん
18/12/01 23:38:07.20 yFxD3TpK.net
あるド底辺裏口シリツ医大のある学年に100人の学生がいる。
100人の学生は全員裏口入学である。
裏口入学を自覚したら翌日に退学しなければならない。
学生は自分以外の学生が裏口入学であるとことは全員知っているが自分が裏口入学であることは知らない。
教授が全員の前で「この学年には少なくとも一人が裏口入学している」と発言した。
この後、どうなるかを述べよ。

439:卵の名無しさん
18/12/02 06:45:16.31 e9Pc8hcV.net
# Troubled train T1 with m passengers left station S1 arrived S2 station s minute later
# than depature of train T0
# beta*m passenger got out and rs passengers got in, where
# r denotes in-passenger rate per minute, T0 took b(beta*m + rs) extra-minutes
# regular train T0 takes c minutes for exchange of passengers
dango <- function(s,m,beta=3/10,r=3,b=0.01,c=0){
mm=(1-beta)*m+r*s
ss=s+b*(beta*m+r*s)-c
c(ss,mm)
}
sm=c(10,100)
re=sm
for(i in 1:2){
sm=dango(sm[1],sm[2])
re=rbind(re,sm)
}
rownames(re)=NULL
plot(re)

440:卵の名無しさん
18/12/02 07:38:46.89 IdisUW1u.net
薬局の店舗数を増やそうかなぁ

441:卵の名無しさん
18/12/02 12:10:26.58 TL1hN1iv.net
dat=hist(c(rnorm(1e6),rnorm(1e5,5,0.5)))
attach(dat)
plot(breaks[-1],counts,type='s',log='y',ylim=range(counts))
segments(x0=breaks[-1],y=min(counts),y1=counts)
segments(x0=breaks[1],y=min(counts),y1=counts[1])

442:卵の名無しさん
18/12/02 21:14:03.05 qDXWsGoQ.net
liars <- function(Answer){ # case of all liars permitted
N=length(Answer)
dat=permutations(2,N,0:1,set=F,rep=T)
check <- function(y,answer=Answer){
all(answer[y==0]==sum(y)) # all honest answer compatible?  
} # numeric(0)==sum(y):logical(0) all(logical(0)) : TRUE
dat[apply(dat,1,check),]
}
liars(c(1,2,2,3,3))
liars(c(1,3,5,7,9,1,3,5,7,9))
(x=sample(10,10,rep=T)) ; apply(!liars(x),1,sum)
liars(c(8, 9, 8, 2, 4, 4, 2, 3, 9, 8))

443:卵の名無しさん
18/12/02 21:35:54.10 jYRj3cxk.net
Prudence, indeed, will dictate that "uraguchi" long established cannot be changed for light and transient causes;
and accordingly all experience has shown, that BMS are more disposed to suffer, while evils are sufferable, than to right themselves by abolishing the forms from which they can pursue profit.
But when a long train of misbehavior and misconduct , showing invariably the same Imbecility evinces a design to reveal themselves as absolute Bona Fide Moron ,
it is their right, it is their duty, to expel such "uraguchi", and to provide new guards for their future security.

444:卵の名無しさん
18/12/02 22:20:54.56 iMFc27fK.net
互いに相関のある5項目くらいのスコアの合計点から疾患の発生を予測するカットオフ値を求めました
単純に合計点した時の予測能は不十分であったため
主成分分析をして各主成分を線型結合して主成分スコアを出す時に、AUC値が最大になるように線型結合する係数に重み付けするのは一般的に大丈夫かしら?

445:卵の名無しさん
18/12/02 22:35:39.65 qDXWsGoQ.net
# 一般化、全員嘘つきも可、重複する答も可l
iars <- function(Answer){ # duplicate answer and/or case of all liars permitted
N=length(Answer)
dat=gtools::permutations(2,N,0:1,set=F,rep=T)
check <- function(y,answer=Answer){
if(all(y==1)) !all(1:N %in% answer)
else all(answer[y==0]==sum(y)) & !(sum(y) %in% answer[y==1])
# all honest answer compatible & not included in liar's anwer   
}
dat[apply(dat,1,check),]
}
liars(c(2,2,2,3,3))
liars(c(2,3,3,4,5))
liars(Answer<-sample(10,10,rep=T)) ; Answer
liars(c(4,5,5,6,7,7,8,8,9,10))

446:卵の名無しさん
18/12/02 22:54:14.37 5KkHnCxW.net
3S Policy Causes the ResultTruman of Panama document and 3S policy
We are keeping the citizens in a cage named "Freedom of Falsehood".
The way you just give them some luxury and convenience.Then release sports, screen, sex (3S).
Because the citizens are our livestock. For that reason, we must make it longevity. It makes it sick
(with chemicals etc.) and keeps it alive.This will keep us harvesting. This is also the authority
of the victorious country.The medal and the Nobel prize is not all Raoul declarationExamples of 3S policy
Hypocrites and disguised society and Panama document "He moved here here two years ago, I was afraid
of looking, but I thought it was a polite person to greet" Hello "when I saw it ... It was not like I was waking
this kind of incident ... ... "(Neighboring residents)On November 7, Shosuke Hotta, 42, a self-proclaimed office
worker in Sagamihara City, Kanagawa Prefecture, was arrested on suspicion of abusing her daughter Sakurai Ai.
This is the nature of the Earthlings

447:卵の名無しさん
18/12/02 23:16:13.68 +r9Osf+E.net
>>416
>互いに相関のある
なら変数減らせるんじゃね?
AUC?Area Under the Curve?
AICじゃなくて?

448:卵の名無しさん
18/12/02 23:31:52.94 61sstTZi.net
>>419
主成分3までで累積寄与度85%なので、3まで次元は減ります
主成分1 + 主成分2 + 主成分3とするのではなく
AUCを最大にする主成分1 + β1*主成分2 + β2*主成分3の
係数を出すっていうのは一般的に大丈夫なんでしょうか
AUCはarea under curveです

449:卵の名無しさん
18/12/02 23:42:05.45 +r9Osf+E.net
>>420
統計テキストの演習問題によくあるから一般的だろね。
三角形の周囲長のデータから線形回帰で面積を出すというような意味のないことやってるかも。

450:卵の名無しさん
18/12/02 23:50:18.66 5KkHnCxW.net
Prudence, indeed, will dictate that "uraguchi" long established cannot be changed for light and transient causes;
and accordingly all experience has shown, that BMS are more disposed to suffer, while evils are sufferable, than to right themselves by abolishing the forms from which they can pursue profit.
But when a long train of misbehavior and misconduct , showing invariably the same Imbecility evinces a design to reveal themselves as absolute Bona Fide Moron ,
it is their right, it is their duty, to expel such "uraguchi", and to provide new guards for their future security.

451:卵の名無しさん
18/12/02 23:57:57.44 iMFc27fK.net
>>421
次数が減るのがメリットかなと…

452:卵の名無しさん
18/12/03 07:19:35.51 DAMQxIpv.net
>>423
長方形の周囲長者から面積をだすのに
データが100個あればラグランジェの補完式で100次元式で完璧に当てはめることができる。
フィボナッチ数列も同じ。

453:卵の名無しさん
18/12/03 07:22:30.11 DAMQxIpv.net
象の体表面積の計算に有用な数値ってどこだろ?
身長体重鼻の長さ耳の大きさ?

454:卵の名無しさん
18/12/03 07:24:12.72 DAMQxIpv.net
スリーサ�


455:Cズと身長体重の相関とか某女子大の講師が書いてたなw



456:卵の名無しさん
18/12/03 08:49:08.21 cRcCrmb8.net
par(mfrow=c(2,1))
f <- function(x,a=0.01) a^x - log(x)/log(a)
curve(f(x),0,2,bty='l') ; abline(h=1,col=8)
D( expression(a^x - log(x)/log(a)),'x')
df <- function(x,a=0.01) a^x * log(a) - 1/x/log(a)
curve(df(x))
g <- function(x,a=0.01) a^x/(log(x)/log(a))
curve(g(x),0,2,bty='l') ; abline(h=1,col=8)
D(expression (a^x/(log(x)/log(a))),'x')
dg <- function(x,a=0.01) a^x * log(a)/(log(x)/log(a)) - a^x * (1/x/log(a))/(log(x)/log(a))^2
curve(dg,0,10)

457:卵の名無しさん
18/12/03 11:40:13.52 DAMQxIpv.net
>>420
AICとかWAICで比較する方法があったはず。

458:卵の名無しさん
18/12/03 12:54:57.80 DAMQxIpv.net
rm(list=ls())
library(gtools)
N=11
Answer=1:N
dat=permutations(2,N,0:1,set=F,rep=T) ; colnames(dat)=LETTERS[1:N]
# 1:嘘つき 0:正直 例.1 1 1 0 1 1 1 1 1 0 1で矛盾がないか調べる
check <- function(y,answer=Answer){ # remark 各人の解答
if(all(y==1)) !all(1:N %in% answer) # 正直者がいないとき
else all(answer[y==0]==sum(y)) & !(sum(y) %in% answer[y==1])
# すべての正直者の答のみが現実と一致するか?  
}
dat[apply(dat,1,check),]
# 一般化、全員嘘つきも可、重複する答も可
liars <- function(Answer,Strict=TRUE){ # duplicate answer and/or case of all liars permitted, Strict:liars always lie
N=length(Answer)
dat=gtools::permutations(2,N,0:1,set=F,rep=T)
check <- function(y,answer=Answer){
if(all(y==1)) !all(1:N %in% answer)
else if(Strict) all(answer[y==0]==sum(y)) & !(sum(y) %in% answer[y==1])
else all(answer[y==0]==sum(y))
# all honest answer compatible & not included in liar's anwer
}
dat[apply(dat,1,check),]
}
liars(c(2,2,2,3,3))
liars(c(2,3,3,4,5))
liars(Answer<-sample(10,10,rep=T)) ; Answer
liars(c(4,5,5,6,7,7,8,8,9,10))
liars(c(4,5,5,6,7,7,8,8,9,10),S=F)

459:卵の名無しさん
18/12/03 13:13:54.59 DAMQxIpv.net
シリツ医の使命は裏口入学撲滅国民運動の先頭に立つことだよ。
裏口入学の学生を除籍処分にしないかぎり、信頼の回復はないね。つまり、いつまで経ってもシリツ医大卒=裏口バカと汚名は拭えない。シリツ出身者こそ、裏口入学に厳しい処分せよを訴えるべき。
裏口入学医師の免許剥奪を!の国民運動の先頭に立てばよいぞ。
僕も裏口入学とか、言ってたら信頼の回復はない。

460:卵の名無しさん
18/12/03 15:36:25.67 1KqGOOJS.net
rm(list=ls())
graphics.off()
.a=0.01
f = function(x,a=.a) a^x-log(x)/log(a)
curve(f(x),bty='l',lwd=2) ; abline(h=0,col=8)
max=optimize(f,c(0,1),maximum=T)$maximum
min=optimize(f,c(0,1),maximum=F)$minimum
x1=uniroot(f,c(0,max))$root
x2=uniroot(f,c(max,min))$root
x3=uniroot(f,c(min,1))$root
ans=c(x1,x2,x3) ; ans
points(ans,c(0,0,0),pch=19,col=2)

461:卵の名無しさん
18/12/03 21:38:41.65 uthawMyt.net
liars <- function(Answer,Strict=TRUE){ # duplicate answer and/or case of all liars permitted
N=length(Answer)
dat=gtools::permutations(2,N,0:1,set=F,rep=T)
check <- function(y,answer=Answer){
if(all(y==1)) {!all(1:N %in% answer)}
else{
if(Strict){all(answer[y==0]==sum(y)) & !(sum(y) %in% answer[y==1])}
else {all(answer[y==0]==sum(y))}
}
# all honest answer compatible & not included in liar's anwer
}
dat[apply(dat,1,check),]
}
liars(c(2,2,2,3,3))
liars(c(2,3,3,4,5),S=F)
liars(Answer<-sample(10,10,rep=T),S=F) ; Answer
liars(Answer)
sort(Answer)
liars(c(1, 2, 3, 4, 5, 5, 5, 5, 9, 9, 9),Strict=FALSE)
liars(c(1, 2, 3, 4, 5, 5, 5, 5, 9, 9, 9),Strict=TRUE)

462:卵の名無しさん
18/12/03 21:39:50.88 uthawMyt.net
> liars(c(1, 2, 3, 4, 5, 5, 5, 5, 9, 9, 9),Strict=FALSE)
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
[1,] 1 1 1 1 1 1 1 1 0 0 1
[2,] 1 1 1 1 1 1 1 1 0 1 0
[3,] 1 1 1 1 1 1 1 1 1 0 0
[4,] 1 1 1 1 1 1 1 1 1 1 1
> liars(c(1, 2, 3, 4, 5, 5, 5, 5, 9, 9, 9),Strict=TRUE)
[1] 1 1 1 1 1 1 1 1 1 1 1

463:卵の名無しさん
18/12/03 22:45:35.45 uthawMyt.net
liars <- function(Answer,Strict=TRUE){ # duplicate answer and/or case of all liars permitted
N=length(Answer)
arg=list()
for(i in 1:N) arg[[i]]=0:1
dat=do.call(expand.grid,arg) # expand.grid(0:1,0:1,0:1,...,0:1)
colnames(dat)=LETTERS[1:N]
check <- function(y,answer=Answer){
if(all(y==1)) {!all(1:N %in% answer)}
else{ # Strict: all honest answer compatible & not included in liar's anwer
if(Strict){all(answer[y==0]==sum(y)) & !(sum(y) %in% answer[y==1])}
else {all(answer[y==0]==sum(y))}
}
}
dat[apply(dat,1,check),]
}
liars(Answer<-sample(10,10,rep=T),S=F) ; Answer
liars(c(1, 2, 3, 4, 5, 5, 5, 5, 9, 9, 9),Strict=FALSE)
liars(c(1, 2, 3, 4, 5, 5, 5, 5, 9, 9, 9),Strict=TRUE)

464:卵の名無しさん
18/12/03 23:36:09.50 kWZ8ngVO.net
しゅごーいAWP

465:卵の名無しさん
18/12/03 23:36:55.91 uthawMyt.net
liars <- function(Answer,Strict=TRUE){ # duplicate answer and/or case of all liars permitted
N=length(Answer)
arg=list()
for(i in 1:N) arg[[i]]=0:1
dat=do.call(expand.grid,arg) # expand.grid(0:1,0:1,0:1,...,0:1)
colnames(dat)=LETTERS[1:N]
check <- function(y,answer=Answer){
if(all(y==1)) {!all(1:N %in% answer)}
else{ # Strict: all honest answer compatible & not included in liar's anwer
if(Strict){all(answer[y==0]==sum(y)) & !(sum(y) %in% answer[y==1])}
else {all(answer[y==0]==sum(y))}
}
}
res=as.matrix(dat[apply(dat,1,check),])
rownames(res)=NULL
return(res)
}
liars(Answer<-sample(10,10,rep=T),S=F) ; Answer
liars(c(1, 2, 3, 4, 5, 5, 5, 5, 9, 9, 9),Strict=FALSE)
liars(c(1, 2, 3, 4, 5, 5, 5, 5, 9, 9, 9),Strict=TRUE)

466:卵の名無しさん
18/12/04 01:12:57.83 nI+jKERK.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

467:卵の名無しさん
18/12/04 15:14:54.20 nfS0Ph7I.net
>>436
個数を表示するように改造
# 一般化、全員嘘つきも可、重複する答も可
liars <- function(Answer,Strict=FALSE){ # duplicate answer and/or case of all liars permitted
N=length(Answer) # Strict: liars always lie, never tell the truth
arg=list()
for(i in 1:N) arg[[i]]=0:1
dat=do.call(expand.grid,arg) # expand.grid(0:1,0:1,0:1,...,0:1)
colnames(dat)=LETTERS[1:N]
check <- function(y,answer=Answer){
if(all(y==1)) {!all(1:N %in% answer)}
else{ # Strict: all honest answer compatible & not included in liar's anwer
if(Strict){all(answer[y==0]==sum(y)) & !(sum(y) %in% answer[y==1])}
else {all(answer[y==0]==sum(y))}
}
}
re=as.matrix(dat[apply(dat,1,check),])
rownames(re)=1:nrow(re)
return(rbind(re,Answer))
}

liars(Answer<-sample(10,10,rep=T),S=F)
liars(c(1,2,3,4,5,5,5,5,9,9,9),Strict=FALSE)
liars(c(1,2,3,4,5,5,5,5,9,9,9),Strict=TRUE)
liars(c(7,7,7,7,8,8,8,9,9,10,11),Strict=F)

468:卵の名無しさん
18/12/04 19:24:56.87 nfS0Ph7I.net
バスの到着間隔が平均30分の指数分布であるEバスと
平均30分の一様分布であるUバス�


469:ナはどちらが待ち時間の期待値が小さいか?



470:卵の名無しさん
18/12/05 00:36:57.95 DRmF49xK.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

471:卵の名無しさん
18/12/05 18:34:25.14 mPAQrzgG.net
-- zerOne 5 -> [[0,0,0,0,0],[0,0,0,0,1]....[1,1,1,1,1,1]
zeroOne :: Num a => Int -> [[a]]
zeroOne n = (!! n) $ iterate (\x-> [a:b|a<-[0,1],b<-x]) [[]]

472:卵の名無しさん
18/12/05 19:07:50.43 XTI9A75j.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

473:卵の名無しさん
18/12/05 22:12:31.75 kHtcpiLC.net
# dat : all possible combinations
n=5 ;arg=list()
for(i in 1:n) arg[[i]]=0:1
dat=do.call(expand.grid,arg) # expand.grid(0:1,0:1,...)
dat=as.matrix(dat)
colnames(dat)=LETTERS[1:n]
# A=>!B, B=>C, C=>!D&!E, D=>!E, E=>E
is.compati<-function(i,x){ # i:index of honest, x: possible combination
switch(i, # 1..n
x['B']==0, # testified by A (=LETTERS[1])
x['C']==1, # testified by B (=LETTERS[2])
x['D']==0 & x['E']==0, # ...
x['E']==0,
x['E']==1)
}
check=function(x){
re=NULL
honest=which(x==1) # index of honest
for(i in honest){
re=append(re,is.compati(i,x))
}
all(re)
}
dat[apply(dat,1,check),]

474:卵の名無しさん
18/12/05 22:13:09.98 kHtcpiLC.net
正直者は嘘をつかないが
嘘つきは嘘をつくこともつかないこともある。
A~Eの5人が次のように発言している
A「Bはウソつきだ」
B「Cはウソつきではない」
C「D.Eはどちらもウソつきだ」
D「Eはウソつきだ」
E「私はウソつきではない」
5人のうち、正直者と嘘つきは誰か?
可能性のある組合せをすべて示せ。

475:卵の名無しさん
18/12/06 09:56:22.91 cp3ws/tO.net
>>444
嘘つきが必ず嘘をつくStrict=TRUE、嘘も真実もいうStrict=FALSE
でどちらにも対応。
# dat : all possible combinations
n=5 ;arg=list()
for(i in 1:n) arg[[i]]=0:1
dat=do.call(expand.grid,arg) # expand.grid(0:1,0:1,...)
dat=as.matrix(dat)
colnames(dat)=LETTERS[1:n]
# A=>!B, B=>C, C=>!D&!E, D=>!E, E=>E
is.compati.H<-function(i,x){ # i:index of honest, x: possible combination
switch(i, # 1..n
x['B']==0, # testified by A (=LETTERS[1])
x['C']==1, # testified by B (=LETTERS[2])
x['D']==0 & x['E']==0, # ...
x['E']==0,
x['E']==1)
}
is.compati.L <- function(i,x){# is compatible for liars?
# i:index of liars, x: possible combination
switch(i, # 1..n
!(x['B']==0), # testified by A (=LETTERS[1])
!(x['C']==1), # testified by B (=LETTERS[2])
!(x['D']==0 & x['E']==0), # ...
!(x['E']==0),
!(x['E']==1))
}

476:卵の名無しさん
18/12/06 09:56:52.33 cp3ws/tO.net
check=function(x,Strict){
re=NULL
honest=which(x==1) # index of honest
for(i in honest){
re=append(re,is.compati.H(i,x))
}
if(Strict){
liar=which(x==0) # index of liar
for(i in liar){
re=append(re,is.compati.L(i,x))
}
}
all(re)
}
dat[apply(dat,1,function(x) check(x,Strict=TRUE)),]
dat[apply(dat,1,function(x) check(x,Strict=FALSE)),]

477:卵の名無しさん
18/12/06 16:42:18.52 E+1fMA/x.net
dat=as.matrix(expand.grid(1:0,1:0,1:0))
colnames(dat)=LETTERS[1:3]
compati.H <- function(i,x){ # i index of honest, x: possible combination
switch(i, # i= 1,2,or,3
# if A is honest, B should be honest, compatible?
ans <- x[2]==1, # when i=1
# if B is honest,C is a liar thereby A should be honest. compatible?
ans <- x[3]==0 & ifelse(x[3]==0,!(x[1]==0),x[1]==0), # when i=2, x[3]==0 & x[1]==1
ans <- NULL) # when i=3
return(ans)
}
compati.L <- function(i,x){ # i index of liar, x: possible combination
switch(i,
ans <- x[2]==0,
ans <- x[3]==1 & x[1]==1,
ans <- NULL)
return(ans)}
check <- function(x,Strict){
re=NULL
honest <- which(x==1)
for(i in honest){
re=append(re,compati.H(i,x))}
if(Strict){
liar <- which(x==0)
for(i in liar){
re=append(re,compati.L(i,x)) }}
all(re)}
dat[apply(dat,1,function(x) check(x,Strict=TRUE)),]
dat[apply(dat,1,function(x) check(x,Strict=FALSE)),]

478:卵の名無しさん
18/12/06 20:20:59.86 E+1fMA/x.net
a=1
m=100
n=1e6
x=sample(c(a/m,m*a),n,rep=T,prob=c(m/(m+1),1/(m+1))) ; hist(x,freq=F) ; mean(x)
a/m*m/(m+1)+m*a*1/(m+1) ; a/(m+1)*(1+m)
plot(c(m/(m/1),1/(m+1)),c(a/m,m*a),bty='l')
EX2=(a/m)^2*m/(m+1)+(m*a)^2*(1/(m+1))
(EW = EX2/a/2) ; mean(x^2)/mean(x)/2
EW <- function(m,a=1) (m^3+1)/m/(m+1)/2*a
m=1:100
plot(m,EW(m),bty='l')

479:卵の名無しさん
18/12/07 03:14:44.29 YE3oTb4v.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

480:卵の名無しさん
18/12/07 08:24:44.19 ySmU7MDt.net
>>449
裏口馬鹿にもわかるように原文もつけなきゃ。

原文はこれな。
私は昭和の時代に大学受験したけど、昔は今よりも差別感が凄く、慶応以外の私立医は特殊民のための特殊学校というイメージで開業医のバカ息子以外は誰も受験しようとすらしなかった。
常識的に考えて、数千万という法外な金を払って、しかも同業者からも患者からもバカだの裏口だのと散々罵られるのをわかって好き好んで私立医に行く同級生は一人もいませんでした。
本人には面と向かっては言わないけれど、俺くらいの年代の人間は、おそらくは8-9割は私立卒を今でも「何偉そうなこと抜かしてるんだ、この裏口バカが」と心の底で軽蔑し、嘲笑しているよ。当の本人には面と向かっては絶対にそんなことは言わないけどね。

481:卵の名無しさん
18/12/07 08:27:54.51 ySmU7MDt.net
開業医スレのシリツ三法則(試案、名投稿より作成)
1.私立医が予想通り糞だからしょうがない
>スレリンク(hosp板:101番)-102
>スレリンク(hosp板:844番)-853
ID:RFPm1BdQ
>スレリンク(hosp板:869番)
>スレリンク(hosp板:874番)-875
>スレリンク(hosp板:874番)-880
>スレリンク(hosp板:882番)
ID:liUvUPgn
2.馬鹿に馬鹿と言っちゃ嫌われるのは摂理
実例大杉!
3.リアルでは皆思ってるだけで口に出してないだけ
URLリンク(ishikisoku.com)

482:卵の名無しさん
18/12/07 20:21:20.38 g1XwAPhY.net
3S Policy Causes the ResultTruman of Panama document and 3S policy
We are keeping the citizens in a cage named "Freedom of Falsehood".
The way you just give them some luxury and convenience.Then release sports, screen, sex (3S).
Because the citizens are our livestock. For that reason, we must make it longevity. It makes it sick
(with chemicals etc.) and keeps it alive.This will keep us harvesting. This is also the authority
of the victorious country.The medal and the Nobel prize is not all Raoul declarationExamples of 3S policy
Hypocrites and disguised society and Panama document "He moved here here two years ago, I was afraid
of looking, but I thought it was a polite person to greet" Hello "when I saw it ... It was not like I was waking
this kind of incident ... ... "(Neighboring residents)On November 7, Shosuke Hotta, 42, a self-proclaimed office
worker in Sagamihara City, Kanagawa Prefecture, was arrested on suspicion of abusing her daughter Sakurai Ai.
This is the nature of the Earthlings

483:卵の名無しさん
18/12/08 07:31:43.87 xRW0g7nq.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

484:卵の名無しさん
18/12/08 20:18:41.06 W3abFsTH.net
liars <- function(Answer,Strict=TRUE){ # duplicate answer and/or case of all liars permitted
N=length(Answer)
arg=list()
for(i in 1:N) arg[[i]]=0:1
dat=do.call(expand.grid,arg) # expand.grid(0:1,0:1,0:1,...,0:1)
colnames(dat)=LETTERS[1:N]
check <- function(y,answer=Answer){
if(all(y==1)) {!all(1:N %in% answer)}
else{ # Strict: all honest answer compatible & not included in liar's anwer
if(Strict){all(answer[y==0]==sum(y)) & !(sum(y) %in% answer[y==1])}
else {all(answer[y==0]==sum(y))}
}
}
dat[apply(dat,1,check),]
}
liars(Answer<-sample(10,10,rep=T),S=F) ; Answer
liars(c(1, 2, 3, 4, 5, 5, 5, 5, 9, 9, 9),Strict=FALSE)
liars(c(1, 2, 3, 4, 5, 5, 5, 5, 9, 9, 9),Strict=TRUE)

485:卵の名無しさん
18/12/09 09:45:50.49 EZ1Q6//t.net
URLリンク(www.tutorialspoint.com)
URLリンク(i.imgur.com)
URLリンク(i.imgur.com)

486:卵の名無しさん
18/12/10 04:15:43.72 u30TNISd.net
呪文:「ド底辺シリツ医大が悪いのではない、本人の頭が悪いんだ」を唱えると甲状腺機能が正常化するという統計処理の捏造をやってみる。
TSH : 0.34~4.0 TSH:μIU/mlを基準値として(これが平均±2×標準偏差で計算されているとして)呪文前と呪文後のデータを正規分布で各々50個つくる。
負になった場合は検出限界以下として0にする。
URLリンク(i.imgur.com)
同じ平均値と標準偏差で乱数発生させただけなので両群には有意差はない。
横軸に呪文前のTSHの値、縦軸にTSHの変化(呪文後-呪文前)をグラフしてみると
URLリンク(i.imgur.com)
つまり、呪文前のTSHが高いほど呪文後はTSHは下がり、呪文前のTSHが低いほど呪文後のTSHは上がるという傾向がみてとれる。
これを線形回帰して確かめてみる。
回帰直線のパラメータは以下の通り。
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.3812 0.3323 7.165 4.10e-09 ***
before -1.0351 0.1411 -7.338 2.24e-09 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.0


487:5 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.8365 on 48 degrees of freedom Multiple R-squared: 0.5287, Adjusted R-squared: 0.5189 F-statistic: 53.84 on 1 and 48 DF, p-value: 2.237e-09 p = 2.24e-09 なので有意差ありとしてよい。 ゆえに、「ド底辺シリツ医大が悪いのではない、本人の頭が悪いんだ」という呪文は甲状腺機能を正常化させる。 ここで問題、この統計処理のどこが誤っているか?



488:卵の名無しさん
18/12/10 14:52:10.55 SBKPI/ud.net
アタマわるわる~

489:卵の名無しさん
18/12/10 22:04:30.67 7+YyXAYs.net
>>457
頭が悪いのは誤りを指摘できないお前の頭な。

490:卵の名無しさん
18/12/11 08:23:18.37 EyBBmFk4.net
野獣先輩、オナシャス
アタマわるわるわ~るわる~
アタマわるわるわ~るわる~
あそれっ
アタマわるわるわ~るわる~
アタマわるわるわ~るわる~
あよいしょっ
アタマわるわるわ~るわる~
アタマわるわるわ~るわる~
あくしろよ
アタマわるわるわ~るわる~
アタマわるわるわ~るわる~
endless

491:卵の名無しさん
18/12/11 08:39:06.09 PFEjAytf.net
>>459
文章だけでド底辺シリツ医大卒の裏口馬鹿とわかる。
これに答えられない国立卒がいた。
駅弁らしいが。
平均0、分散1の正規分布の95%信頼区域は[-1.96,1.96]で区域長は約3.92である。
平均0、分散1の一様分布の95%信頼区域の区域長さはいくらか?

492:卵の名無しさん
18/12/11 13:32:28.73 c5MyHopu.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

493:卵の名無しさん
18/12/12 22:30:23.75 x9HwYbel.net
おいこら
あっちでまた非医師仲間のコンプが湧いてるぞ
さっさと引き取れや

494:卵の名無しさん
18/12/14 12:51:17.00 eeDD4wBK.net
回答付きでレスできない椰子ってシリツ卒なんだろうな。

495:卵の名無しさん
18/12/14 23:45:34.35 /gtLrghw.net
お前は今までに吐いたゲロの回数を覚えているのか?

496:卵の名無しさん
18/12/15 06:52:37.95 PqeMZC8f.net
>>464
ゲロの回数の従う事前分布をどう想定する?

497:卵の名無しさん
18/12/15 06:57:22.51 PqeMZC8f.net
ある女医が一日に5回屁をこいたとする。
屁の回数はポアソン分布と仮定して
この女医の一日にこく屁の回数の95%信頼区間を述べよ、
という問題にできるぞ。
答えてみ!

498:卵の名無しさん
18/12/15 07:17:43.02 PqeMZC8f.net
事前分布を想定して現実のデータからその分布の最適分布を算出する。当然、区間推定にある。
relocation of probability dustrubution
これがベイズ統計の基本的な考え方だよ。
上記の女医の屁の回数も区間推定できる。

499:卵の名無しさん
18/12/15 07:47:09.33 PqeMZC8f.net
ゲロの回数だとゼロ過剰ポアソン分布の方がいいだろうな。

500:卵の名無しさん
18/12/15 07:57:08.94 PqeMZC8f.net
URLリンク(kusanagi.hatenablog.jp)

501:卵の名無しさん
18/12/15 08:21:49.91 dSAl+lHg.net
臨床問題です
サブとアドンとBLの関連を原稿用紙30枚以上で考察せよ

502:卵の名無しさん
18/12/15 08:23:29.62 PqeMZC8f.net
>>470
んで、女医の放屁数は出せた?

503:卵の名無しさん
18/12/15 08:25:40.34 PqeMZC8f.net
>>470
問題の意味がわからないから詳述してくれ。
女医の屁の方は問題設定が明確だぞ。

504:卵の名無しさん
18/12/15 08:48:13.42 PqeMZC8f.net
ゲロの回数の事前分布なら
Zero-Inflated Negative Binomial Distribution
の方がいいかな。
Rにパッケージがあったような。
ポアソンよりパラメータが多くなるな。

505:卵の名無しさん
18/12/15 08:53:38.00 PqeMZC8f.net
VGAMに含まれてた。
URLリンク(www.rdocumentation.org)

506:卵の名無しさん
18/12/15 09:36:45.73 ek4No3cm.net
今日はこれで遊ぶかな。
URLリンク(stats.idre.ucla.edu)

507:卵の名無しさん
18/12/15 13:48:34.67 dSAl+lHg.net
問題に回答できないとは
さては中卒ニートだな

508:卵の名無しさん
18/12/15 14:06:30.51 Eu3ncs/k.net
>>476
>>470
問題の意味がわからないから詳述してくれ。
女医の屁の方は問題設定が明確だぞ。

509:卵の名無しさん
18/12/15 15:08:53.35 5ZAJ5aCI.net
こんな感じでゼロ過剰ポアソン分布モデルがつくれるな。
1年間にゲロを吐かない確率0.9
ゲロを吐いた場合の1年間あたりの回数=平均2のポアソン分布
theta=0.9
lambda=2
N=1e5
# Zero inflated poisson distribution
zip=numeric(N)
for (i in seq_along(zip)){
if(rbinom(1,1,1-theta)==0){
zip[i]=0
}else{
zip[i]=rpois(1,lambda)
}
}
おい、ド底辺、上記の過剰ポアソン分布モデルで
1年間に吐くゲロの回数の平均値を出してみ!

510:卵の名無しさん
18/12/15 15:09:33.17 5ZAJ5aCI.net
女医の放屁の方はポアソン分布でよさそうだな。
95%信頼区間を計算できたか?

511:卵の名無しさん
18/12/15 15:18:08.34 efNsfNge.net
自分で出した算数クイズは解けても
考察を要する問題は中卒には難しいようだな
解きやすいように少し簡単な問題にしてやろう
さて臨床問題です
ガチユリとフタナリの相関性について原稿用紙30枚以上で考察せよ


次ページ
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch