# The Hope -- MathPsych2017

Bayesian estimation using Drake equation

to meet our possible girlfriends in London

Authors Information

Mr. Unadon

26 years old ・ Unmarried ・ Looking for a lover

Future: Data Science?

MA(Psychology), Certificate of licensed cook,

Best award: A marketing analysis contest 2016

Unadon: MacOS Sierra10.12.1; Rversion３.３.2; rstan2.10.1

Contact : whitesnow1751★gmail.com

dastatis

23 years old ・ Unmarried ・ Seeking lovers

BD(Human Science), Psychometrics, Master Course

Best Award: A marketing analysis contest 2016

Academic award: The correction of respondent bias

Contact(Twitter): dastatis

dastatis: Windows10; Rversion３.３.3; rstan2.14.1

Introduction

We are not good at english.

Unadon

This year's Mathematical Psychology seems to be held in UK!!

Let's Go Coventry！ Warwick University!!

I'd like to go to London and party with a beautiful wome....

I want to learn cutting-edge Bayesian statistics！！！

This year's Mathematical Psychology seems to be held in UK!!

Let's Go Coventry！ Warwick University!!

I'd like to go to London and party with a beautiful wome....

I want to learn cutting-edge Bayesian statistics！！！

dastatis

UK is nice.

Of course, I plan to participate in MathPsych2017.

~~And, I wanna go drinking with girls in London.~~

And, I would like to go to London to see the famous universities.

UK is nice.

Of course, I plan to participate in MathPsych2017.

And, I would like to go to London to see the famous universities.

Unadon

Let's join the conference seriously.

But I hope.

If I could go to London,

I feel like I can meet a my future girlfriend!

Let's join the conference seriously.

But I hope.

If I could go to London,

I feel like I can meet a my future girlfriend!

dastatis

You noticed?

There is no such thing...

I also want to meet my future girlfriend,

but the probability of meeting

a possible girl friend in London will be... ZERO.

You noticed?

There is no such thing...

I also want to meet my future girlfriend,

but the probability of meeting

a possible girl friend in London will be... ZERO.

Unadon

Do you really think so?

Have a dream, dastatis.

Let's try to estimate the probability of

meeting our future girlfriend in London with Bayesian Modeling.

The Drake Equation will surely give us a hope ... maybe...

Do you really think so?

Have a dream, dastatis.

Let's try to estimate the probability of

meeting our future girlfriend in London with Bayesian Modeling.

The Drake Equation will surely give us a hope ... maybe...

The Drake Equation

dastatis

Mr.Unadon, what is the Drake Equation?

...Oh, This is the wonderful equation!

It can estimate the number of

extraterrestrial intelligent life.

Mr.Unadon, what is the Drake Equation?

...Oh, This is the wonderful equation!

It can estimate the number of

extraterrestrial intelligent life.

Unadon

That's right, dastatis.

And Mr.Peter applied this equation to estimate

the number of "Possible Girlfriend" in London.

That's right, dastatis.

And Mr.Peter applied this equation to estimate

the number of "Possible Girlfriend" in London.

dastatis

To caliculate "Possible Girlfriend",

Mr.Peter gave some constants below.

Popularion in UK (N*),

Rate of female(fw),

Rate of Londoners(fL)...and so on.(equation2)。

To caliculate "Possible Girlfriend",

Mr.Peter gave some constants below.

Popularion in UK (N*),

Rate of female(fw),

Rate of Londoners(fL)...and so on.(equation2)。

Unadon

Good, but I think these cannot be constants.

These are stochastic variable because

the population of London changes daily.

And other parameters will be also the stochastic varible, such as

the rate of our favorite age group(fA),

the rate of university graduates(fU)

and the rate of attractive woman(fB).

Good, but I think these cannot be constants.

These are stochastic variable because

the population of London changes daily.

And other parameters will be also the stochastic varible, such as

the rate of our favorite age group(fA),

the rate of university graduates(fU)

and the rate of attractive woman(fB).

dastatis

So you assume the probability distribution for

estimating the parameter of "Population in UK", right?

You are a bayesian! I am a bayesian!

Unknown is parameter.

So you assume the probability distribution for

estimating the parameter of "Population in UK", right?

You are a bayesian! I am a bayesian!

Unknown is parameter.

Unadon

Yes, our "possible girkfriends" will be defined as

a deterministic parameter!

Yes, our "possible girkfriends" will be defined as

a deterministic parameter!

dastatis

Now write a new Drake equation that defines

the number of the "possible girlfriend", please❤❤

Now write a new Drake equation that defines

the number of the "possible girlfriend", please❤❤

Unadon

OK, leave it to me(*´Д`)

(equation 3)

OK, leave it to me(*´Д`)

(equation 3)

dastatis

(Yes... I know why we do not have a girlfriend...)

(Yes... I know why we do not have a girlfriend...)

Data collection

dastatis

Mr.Unadon, how many people do you like? Choose the girls below pictures, please.

(20-34years old? attractive UK women, famous in Japan)

I like Ms.Cara Delevigne and Ms.Sienna Guillory. Very good. Attractive!

referrence: Attractive UK women

Mr.Unadon, how many people do you like? Choose the girls below pictures, please.

(20-34years old? attractive UK women, famous in Japan)

I like Ms.Cara Delevigne and Ms.Sienna Guillory. Very good. Attractive!

referrence: Attractive UK women

Unadon

I like 26 women.

I like 26 women.

dastatis

Pardon?

Pardon?

Unadon

I like twenty-six women very much. I also like four women, too.

I like twenty-six women very much. I also like four women, too.

dastatis

You really like girls.

Certainly, I think it is a very good thing,

because you are good at finding out the each girl's charm!

You really like girls.

Certainly, I think it is a very good thing,

because you are good at finding out the each girl's charm!

Unadon

Thank you, dastatis.

You are a nice man.

Thank you, dastatis.

You are a nice man.

dastatis

Then, wee need as further data,

UK population,

number of Londoners,

the number of women between the ages of 20 and 34,

the probability that the UK girls likes us,

and the probability that the partner is unmarried.

Then, wee need as further data,

UK population,

number of Londoners,

the number of women between the ages of 20 and 34,

the probability that the UK girls likes us,

and the probability that the partner is unmarried.

Unadon

Here is the data of population in UK(from 1960 to 2014).

Let's estimate, at first, the UK population of 2017 using Bayesian state space model.

Here is the data of population in UK(from 1960 to 2014).

Let's estimate, at first, the UK population of 2017 using Bayesian state space model.

dastatis

In the Population data 2014,

I found the number of Londoners(8,538,689),

and the number of females in London

(female, 17-31 years old = 1,020,490).

So, Let's estimate the ratio of 20-34-year-old female in 2017 in London

from the data of 2014 in consideration of error.

I will assume binomial-beta distributions as priors.

In the Population data 2014,

I found the number of Londoners(8,538,689),

and the number of females in London

(female, 17-31 years old = 1,020,490).

So, Let's estimate the ratio of 20-34-year-old female in 2017 in London

from the data of 2014 in consideration of error.

I will assume binomial-beta distributions as priors.

dastatis

Finally, I set the probability that an Londoner female likes us, 0.05.

Finally, I set the probability that an Londoner female likes us, 0.05.

Unadon

OK, that is included our hope.

OK, that is included our hope.

Bayesian Modelings for our "Possible girlfriends"

Unadon

This is my state space model to estimate population UK in 2017(Figure1)。

Figure1: Bayesian Delta State Space model

This is my state space model to estimate population UK in 2017(Figure1)。

Figure1: Bayesian Delta State Space model

dastatis

Leave the Drake equaiton modeling to me!!!(Figure2)

Figure2： Bayesian model of drake equation for "Possible girlfriend"

Leave the Drake equaiton modeling to me!!!(Figure2)

Figure2： Bayesian model of drake equation for "Possible girlfriend"

Unadon

You always write the code fast.

MCMC(*´Д`)？

You always write the code fast.

MCMC(*´Д`)？

dastatis

Yes！ Let's MCMC(*´Д`)！

I want a posterior girlfriend as soon as possible!!

Yes！ Let's MCMC(*´Д`)！

I want a posterior girlfriend as soon as possible!!

Unadon

Good！

My stan_code is below.

Good！

My stan_code is below.

```
data {
int t;
int N[t];
}
parameters{
real<lower=0>mu_s[t];
real<lower=0>sigma_s;
real<lower=0>sigma;
real<lower=0>N_pred[3];
}
transformed parameters{
real delta[t-1];
delta[1] = (mu_s[2]-mu_s[1]);
delta[2] = (mu_s[3]-mu_s[2]);
for(i in 3:(t-1)){
delta[i] = (delta[i-2]+delta[i-1])/2;
}
}
model {
mu_s[1] ~ normal(52400000,sigma_s);
mu_s[2] ~ normal(52400000,sigma_s);
mu_s[3] ~ normal(mu_s[2]+delta[1],sigma_s);
sigma_s ~ cauchy(0,25);
sigma ~ cauchy(0,25);
for (j in 4 : t){
mu_s[j] ~ normal(mu_s[j-1]+delta[j-1],sigma_s);
}
{
int index;
index=0;
for (k in 1:t){
if (N[k]!=9999){
N[k] ~ normal(mu_s[k],sigma);
}else{
index=index+1;
N_pred[index] ~ normal(mu_s[k],sigma);
}
}
}
}
```

dastatis

This is my drake equation using R and rstan！

This is my drake equation using R and rstan！

```
data {
int<lower=0> NL; //Londener
int<lower=0> mu; //UK population
int<lower=0> NLF; //Londener Female
int<lower=0> NLFA; //Londener Female Age-appropriate
int<lower=0> kgA; //UK girls Attractive
int<lower=0> Ng; //UK girls
real<lower=0, upper=1> xi; //Unmarried rate of kgA
real<lower=0, upper=1> omega; //desire rate
}
parameters{
real<lower=0, upper=1> pi; //women rate of mu
real<lower=0, upper=1> theta; //rate of NLF
real<lower=0, upper=1> phi; //rate of NLFA
real<lower=0, upper=1> psi; //rate of kgA
}
transformed parameters{
real<lower=0> G; //Possible Girl Friend
G = mu * pi * theta * phi * psi * xi * omega;
}
model{
pi ~ beta(1,1);
theta ~ beta(1,1);
phi ~ beta(1,1);
psi ~ beta(1,1);
NL~ binomial(mu, pi);
NLF~ binomial(NL, theta);
NLFA~ binomial(NLF, phi);
kgA~ binomial(Ng, psi);
}
```

Result: the number of our "possible girlfriends"

Unadon

MCMC~ ♪ HMC~ ♪(*´Д`)

...Finish！

Well mixed and convergence!!!(Figure3)！

Figure3: the prediction and forecasting (population UK)

Unadon

... And this is a posterior predictive distribution

of population UK in 2017(Figure4)

Figure4 : posterior predictive distributio

MCMC~ ♪ HMC~ ♪(*´Д`)

...Finish！

Well mixed and convergence!!!(Figure3)！

Figure3: the prediction and forecasting (population UK)

Unadon

... And this is a posterior predictive distribution

of population UK in 2017(Figure4)

Figure4 : posterior predictive distributio

Unadon

dastatis!

I will pass the μ= 65,321,365(pred 2017 Population)！

dastatis!

I will pass the μ= 65,321,365(pred 2017 Population)！

dastatis

μ= 65,321,365, I caught it!!

just I it passed on stan, and...

pressed Enter!!

(*´Д`) HMC~ ♪

μ= 65,321,365, I caught it!!

just I it passed on stan, and...

pressed Enter!!

(*´Д`) HMC~ ♪

Unadon

I am looking forward to the results!

Isn't it over yet?

I am looking forward to the results!

Isn't it over yet?

dastatis

Mr. Unadon, check it out(Figure5)！！！

This is our "Possible Girlfriends"!!

Figure5: The number of our "Possible Firlfriends" in London 2017(Posteiror)

Mr. Unadon, check it out(Figure5)！！！

This is our "Possible Girlfriends"!!

Figure5: The number of our "Possible Firlfriends" in London 2017(Posteiror)

Unadon

...？...？ How many our girlfriend are there in 2017 in London？？

...？...？ How many our girlfriend are there in 2017 in London？？

dastatis

Posterior mean indicates 17,653！

Posterior mean indicates 17,653！

Unadon

Oh！Fantastic!

So, when I met a 20-34 year old woman in London,

what is the probability that she is a possible girlfriend?

Oh！Fantastic!

So, when I met a 20-34 year old woman in London,

what is the probability that she is a possible girlfriend?

dastatis

1.729855%.

Now that I have a hope for London!

1.729855%.

Now that I have a hope for London!

Discussion

Unadon

Let's go to London to meet 17,653 possible our girlfriend!!

When we go to UK for MathPsych 2017, find a girl in London, at firs...

Let's go to London to meet 17,653 possible our girlfriend!!

When we go to UK for MathPsych 2017, find a girl in London, at firs...

dastatis

Wait. Wait please, Mr.Unadon.

Let's join the conference seriously.

There will be beautiful and smart girls

in the conference of Mathematical Psychology 2017.

You surely will have a wonderful encounter there.

Wait. Wait please, Mr.Unadon.

Let's join the conference seriously.

There will be beautiful and smart girls

in the conference of Mathematical Psychology 2017.

You surely will have a wonderful encounter there.

Unadon

Yes, I got it, dastatis.

Let's do our best poster presentation!

Yes, I got it, dastatis.

Let's do our best poster presentation!

dastatis

Yes！ I'm looking forward to the summer in UK.

Yes！ I'm looking forward to the summer in UK.

LET'S GO!!

Mathematical Psychology 2017!!

Thank you for your visiting this page.

Written on March 31, 2017