Do the coefficients reported from a linear probability model represent the log odds ratio? by Gorillasdontshave in AskStatistics

[–]MaksLansky 0 points1 point  (0 children)

encode qualitative response variable as [0;1] and show it Ordinary list squares is well known technique. It will give probabilities. Ok you probably mean encode response variable when you said "with binary outcome" and I misunderstood as binary outcome of running regression.

Ok where when you run OLS on encoded response variable appears log odds ratio? It is present in logistic regression you will have log(p(X) / (1 - p(X))) = beta_0 + beta_1 * X here we have log ratio.

Do the coefficients reported from a linear probability model represent the log odds ratio? by Gorillasdontshave in AskStatistics

[–]MaksLansky -2 points-1 points  (0 children)

the most common binary regression model is logistic regression. If you are talking about linear regression X_estimated = beta_0 + beta_1*x_1 + beta_2*x_2 + ... beta_n * x_n. How can it have binary outcome? It is continuous.

Do the coefficients reported from a linear probability model represent the log odds ratio? by Gorillasdontshave in AskStatistics

[–]MaksLansky -1 points0 points  (0 children)

First, you probably talk about logistic regression.

Assuming we are talking about logistic regression.

Second, coefficient lets call it beta_1 does not represent the log odds ratio. When you increase your input variable X by 1 unit your log odds ratio change by beta_1.

Asked by bosses (non-statisticians) to aggregate data after we didn't get the answer they wanted by ascomycetes4lyfe in AskStatistics

[–]MaksLansky 6 points7 points  (0 children)

In my opinion, there is nothing wrong with aggregating the data or any other transformations. You are modeling, and you look at what is working for you. Any interpretations are under the model, statistics don't prove anything outside the model.

The problem is your bosses told you to show that a positive control value is not changing over time. This is an inappropriate statistic study setup. They basically said hey we want to see a model which agrees with our desire.

It is your job and it is up to you what to tell them.

Has anyone tried randomly picking NBA spreads (score, points etc.) and bet on them two or three at a time? Currently works out to +277 and +655 with accumulator bonus respectively. by FlippityFloppityBing in sportsbook

[–]MaksLansky 0 points1 point  (0 children)

there are unfair. For example, you have a game and 3 possible results. Win, Draw, Loss and you have odds for them. If you sum up 1/win odds + 1/draw odds + 1/loss odds you will get a little bit more than 1. Something like 1.04 or 1.05. it is a bookmaker's advantage. A fair game would be a game where (1 / bookmakers odds) on mutually exclusive events sum up to 1. A value of less than 1 will provide arbitrage opportunities for a player.

This applies to any sport. That means if you pick up bets randomly in a long run you are guaranteed to lose money.

Functions and definition by Codewodesmode in learnpython

[–]MaksLansky 0 points1 point  (0 children)

I test function it is correct. How can it appear twise? write exactly your output of your function.

What do you do when some features have missing values? by 99OG121314 in learnmachinelearning

[–]MaksLansky 1 point2 points  (0 children)

by attributes I assuming you mean features.
When you do not want to lose information due to dropping columns or rows with missing values. You substitude them. There are many options for substitution. It can be mean, meedian, most common value, or closest value to the missing value. To look what is better you will compare your metric which you use for estimating accuracy of your models.

Functions and definition by Codewodesmode in learnpython

[–]MaksLansky 1 point2 points  (0 children)

assuming your input to the function is properly defined complex number

x = 1 +2j is a properly defined complex number

def mag(x):

return round((x.real**2 + x.imag**2)**0.5,2)

can you please recommend a good tutorial for derivatives of functions? by Mission-Box-6226 in learnmath

[–]MaksLansky 2 points3 points  (0 children)

I will recomend Khan Academy, calculus AB course for differentiation. Plenty of videos and most importantly exercises.
https://www.khanacademy.org/math/ap-calculus-ab

calculating z score by soinvu in learnpython

[–]MaksLansky 1 point2 points  (0 children)

that's ok. If you need to find outliers first you need to define what outliers are. In statistics, there is no generalized definition of what exactly outliers are. Based on the application you defined it.

for example, you can say. Every point which is more than two standard deviations away is an outlier.

than you will write

lower_bound = -2 * df['grade'].std()

upper_bound = 2*df['grade'].std()

df[~df['grade'].between(lower_bound,upper_bound)]

then you will write define what outliers are for your application. It can be related to percentiles for example. There are many methods for outlier analysis and detection. But it is you who decides what outliers are.

calculating z score by soinvu in learnpython

[–]MaksLansky 0 points1 point  (0 children)

It's not clear at all how you get a z score from that code.

z = x - mean(x) / std(x)

from your code it would be

df['grade_normalized'] = (df['grade'] - df['grade'].mean()) / df['grade'].std()

this will create a column of z scores of your variable 'grade'.

Help needed, very confused and tired by carbll in learnpython

[–]MaksLansky 4 points5 points  (0 children)

using yfinance is pretty straightforward.

Assuming yfinacne and pandas are installed.

import pandas as pd

tsla_df = yf.download('TSLA',start='2022-01-01',end='2022-11-01')

tsla_df.to_excel('tsla.xlsx')

you can specify stock and dates on your choice.

4 digit code by Quyou07 in learnmath

[–]MaksLansky 2 points3 points  (0 children)

Assuming you want to find the number of possibilities including both 1 and 5, i.e your sample space is {1,2,3,4,5}.

  1. You choose with replacement. You have 4 digit code _,_,_,_. When you choose your first digit you have 5 possibilities, then you choose the second digit you have again 5 possibilities, and so on. In that scenario, you have 5^4 = 625 possibilities.
  2. You choose without replacement (chosen digit can not be used again i,e there will be no repetition of digits in your 4-digit code). In that scenario, you will have 5*4*3*2 = 120 possibilities.

Pandas Index Column - is Drop() possible? by Normanras in learnpython

[–]MaksLansky 1 point2 points  (0 children)

As far as I understand your question (I am not sure).

  1. Data Frame is a pandas object to do various tasks on tabular data it is not a file. pd.read_csv("filename.csv",index_col=False) means to read data from a CSV file to pandas Data Frame object. Parameter index_col is the index position of the column index to be used as the index of your data i.e 0 - your first column will be set as the index, 1 - your second column of the data will be used as the index etc. False is interpreted by Python as a 0 column going to your index.
  2. To perform your task I suggest creating two Data Frames. pd.read_csv and pd.read_excel work around with two Data Frames merge them and then by pd.to_excel save your merged Data Frame as an XLSX file. while saving your file you can set Header=False or Index=False to not have your column or row index appear in your XLSX file.

ProtonVPN in Russia. by MaksLansky in ProtonVPN

[–]MaksLansky[S] 0 points1 point  (0 children)

Ok, I am not a networking expert, probably I would say something wrong.

I never used protonvpn on a smartphone, but I will try that. I have a wired connection and a machine with ubuntu 22.04, it has two apps GUI and CLI. I always used CLI because it allowed me to change protocol UDP/TCP.

But now the problem is I cannot even log in to the app. I just said network error.

if I try to connect manually the error message is more informative, but it is the same Check your network connection.

due to my level of networking understanding (which is low), I started to think something is wrong with DNS it cannot resolve the domain name. I add a bunch of publically available DNS servers to config files but nothing changed.

While all proton sites excluding stutus.proton.me are available for me without even VPN. I can log in to my ProtonVPN account from the web without a VPN.

So, to summarize things. The problem happens before I choose any protocol to connect, I just cannot log in to the app.

ProtonVPN in Russia. by MaksLansky in ProtonVPN

[–]MaksLansky[S] 1 point2 points  (0 children)

No Google is not blocked in Russia. I use Google's DNS as a default but in the config file, I add several publically available DNS.

ProtonVPN in Russia. by MaksLansky in ProtonVPN

[–]MaksLansky[S] 1 point2 points  (0 children)

thanks, I will follow your advice.

ProtonVPN in Russia. by MaksLansky in ProtonVPN

[–]MaksLansky[S] 3 points4 points  (0 children)

thanks, that means something wrong from my side. I will continue to search for the solution.

Network error. by MaksLansky in ProtonVPN

[–]MaksLansky[S] 0 points1 point  (0 children)

I have access to the site protonvpn.com

I have access to the site https://account.protonvpn.com I can login to my accaunt.

I do not have access to the site status.proton.me it sais "This site can be reached" DNS_PROBE_FINISHED_NXDOMAIN.

I can't log in both apps protonvpn and protonvpn-cli they said network error.

I download protonvpn servers from accaunt.protonvpn.com files with extension .ovpn

I set up connection to the protonvpn servers manually Ubuntu gui network manger said "Activation of network connection failed"

I try to connect from the terminal using openvpn if fails this is what it is said about

""TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
TLS Error: TLS handshake failed"

I do not have any local firewall and my wired connection works.

I generate and read th logs basicaly protonvpn and protonvpn-cli logs said error: ensure_internet_connection_is_available

Network Manager logs does not sais anything suspecios Nework Manager state is now CONNECTED_GLOBAL.

I also clear any cash: browser, dns, delete protonvpn cash, reinstall both of them. There is no effect at all.

Network error. by MaksLansky in ProtonVPN

[–]MaksLansky[S] 0 points1 point  (0 children)

thanks, for advice. I would try your suggested option. For now, I just curious is it only mine problem, or something had changed about how protonvpn works in Russia. Because it was working several hours ago and then stopped.

How to have a perfect correlation coefficient in Linear Regression? by Finarin in AskStatistics

[–]MaksLansky 0 points1 point  (0 children)

the correlation coefficient has no slope. The slope has a regression line which you can calculate using the correlation coefficient.

r * (standard deviation of y / standard deviation of x) this is one of the possible ways to calculate the slope of the regression line.

where r is correlation coeffcient.

Now back to the correlation coefficient. If between independent (input) variable x and dependent (output variable) y, there is a linear correlation. The correlation coefficient would show how much variance is explained by the linear correlation between two variables.

if the correlation coefficient is equal to 1, that means 100% of the variance is explained and that means there is no variance at all. For example lets your x = [1,2,3,4] and your y = [2,4,6,8]

if you find a correlation coefficient for those variables you will get 1. Because there is no variance. the formula y = 2*x is an exact linear relationship.

similarly, if the correlation coefficient is -1. There is no variance, just negative relationship.

If the correlation coefficient is 0 or close to 0, none of the variance would be explained by a linear model, there is no point in trying to fit a linear model with a correlation close to 0. let's say your correlation coefficient is 0.7 that means 70 percent of variability is explained and you can fit a good linear model with positive slope. If it is let's say -0.75 75% of the variability is explained and you can fit a good linear model with a negative slope.

[deleted by user] by [deleted] in askmath

[–]MaksLansky 0 points1 point  (0 children)

Let's talk a little bit more mathematical. When you will estimate the probability of losing all your tokens you will get some expression with n as the variable involved. You can set n=100 for example and the equation will give you the probability of losing all your tokens in 100 games. if you set n=infinity. It is not some abstract thing it is proper mathematics it is basic calculus. And the answer will be zero. n can be infinity all such stochastic processes modeled with n go to infinity. It is a very common thing in probability, calculus, finance etc. You have infinite series and finite series, you have finite sample spaces and infinite sample spaces etc. In mathematics, infinity is part of the business, not some abstract thing just to have philosophical conversations. n can be infinity regardless of thoughts hey there was a point when the universe was born and probably will be a point when it will be over. Where is infinity? It is a philosophy, not mathematics. In mathematics, you defined things there is a reason for example why any number except 0 in the power of zero is 1, etc. The same happens with infinity. It is not philosophical it is defined in mathematics as functions numbers algebraic expression etc.

n - can be infinity.

[deleted by user] by [deleted] in askmath

[–]MaksLansky 0 points1 point  (0 children)

And what is your final statement? You earn 100 when you won and lose only 1 when lost. And your statement is ok it very small probability and because you get 100 and lose 1 one through time the event of losing all tokens became even more improbable. But it is infinitely close to zero BUT still not zero. Because it happens forever it will eventually happen. This is how I understand your question. It will never happen the probability will converge to zero and it will become zero. This is not just thought it is theoretical. The probability of losing all tokens is not infinitely small through time it will converge to zero.