instruction
stringlengths
9
38.7k
Suppose I have a matrix with 34 binary predictors and a large number of observations such that there are always 5 ones per observation (i.e., 5 of the predictors are randomly set to 1 in each observations). Most of the matrix consists of 0s: library(Matrix) set.seed(132) R <- 34 m <- 5 reps <- 37980 out <- replicate(re...
I'm developing a code to predict how many bikes will arrive at a given station. The issue is that I'm having a hard time interpreting my metrics: On the one hand, it looks like I have a good MSE and a good RMSE, but adjusted r^2 and r^2, both negative, telling me that my model has a worse fit than a horizontal line. Ho...
I am trying to perform stepwise regression with direction as "both" based on BIC in r. But everytime is performing based on AIC only Following is my code train <- read.csv("Regression_train.csv", header=TRUE, stringsAsFactors=FALSE) test <- read.csv("Regression_test.csv", header=TRUE, stringsAsFactors=FALSE)...
The formula writes as this: $$I(X) = \left(\frac{\partial Z}{\partial X}\right)^\top I(Z) \left(\frac{\partial Z}{\partial X}\right),$$ in particular, if $Z = AX$, we have $$I(X) = A^\top I(Z) A.$$ Based on my understanding if $A$ is a short-fat matrix, this still holds. My question is that what if $AX$ is not sufficie...
Many statistical courses teach sampling techniques, such as rejection sampling and importance sampling, to sample data from a distribution. What are some concrete scenarios where a statistician needs to apply a sampling technique?
Is it possible to get credible intervals for regression paths using Blavaan package? Or, p-values for the regression estimates? R Code: ###------------Run Model: 1A----------------### Model1A <- ' C_ERC_ER ~ Valid + S_CCNES S_CCNES ~ C_attachment Valid ~ C_attachment C_ERC_ER ~ C_attachment #Estimating variances...
I have seen this, but it doesn't help me here. Here is my setup: I have four categories, and want to simultaneously test whether p_1 = 0.4, p_2 = 0.35, p_3 = 0.15, p_4 = 0.10. I am using a chi squared goodness-of-fit test here. I find that I should reject the null hypothesis, meaning that at least one of these populati...
I have a question. There's a library (uses this paper) which suggests in its cross lingual part that if the XLM-R is trained in english dataset, it can be directly applied to datasets in other languages, and zero shot cross lingual transfer can be conducted. So, my question is, if I trained XLM-R for english summarisat...
A cumulative distribution function is a function that returns probabilities of $X$ being smaller than or equal to some value $x$: $$Pr(≤)=()$$ What would you call a distribution function that returns probabilities $X$ being greater than or equal to some value $x$, i.e., $$Pr(≥)=()$$ ?
When learning about Regularization in Regression, I am used to seeing this in the following form (https://en.wikipedia.org/wiki/Regularization_(mathematics)): When watching this video (https://www.youtube.com/watch?v=0nYiGXooG4I), I see a similar equation as provided above: The thing which I don't understand is that ...
I am an MBA Student taking courses in statistics. We had this discussion today in our class. Suppose we have a large dataset that contains the "Age Group" and "Gender" of people within a country and if they have some specific "Disease or Not". Using this data, by filtering on different subsets, we calculate that: Supp...
I am training a Mixture Density Network (MDN) to map from continuous input vectors X to continuous targets Y [i.e. X -> Y]. There are missing labels on vector Yi, which I impute from the mdn (as below). If Yi is conditionally dependent on Y2, does this improve estimates on Yi? neglogloss = -MDN.log_prob( tf.where( tf.m...
I am looking into calculating distances between vectors for some data analysis. One question I have is whether I should use actual count data or convert to discrete probabilities. For some distances, the method is clear from the underlying theory (e.g. the Hellinger Distance). However, for other distances, which appr...
You are given three coins with the following probabilities of observing a Head when tossed: Coin 1 has a P(H) = 1/2, Coin 2 has a P(H) = 1/3, Coin 3 has a P(H) = 1/4. You observed two heads among three tosses, and you would like to find which coin the observations come from. What is the Maximum Likelihood Estimator for...
I have an overdetermined system of equations problem where n >> m and the OLS almost always finds an approximation instead of an exact solution. I already reduce the problem space from A to a lot smaller matrix A' using an algorithm based on domain knowledge but it is still not enough. The idea is to employ a regulariz...
(Sorry if talk in layman terms) Consider this you have 2 groups of populations. Let's assume we measure intelligence here. Let's assume the distributions are perfectly normal. One group is centered around 100 iq. Second group is centered around 120 iq. Now suppose first group is way larger than second group. To a point...
I am studying the cointegration between retail prices of pork. In an economical theory this should have a positive relationship. However, when I tested for cointegration using Johansen in Eviews, it only appears to be cointegrated at Case 4 and 5 where there is a linear trend in the cointegrating equation. When I tried...
[ I asked this earlier on DS SE: here but the question didn't receive sufficient attention there. I ask it here because I'm looking for a practical answer with some theoretical justification. ] I have a large dataset $D_1$. I have a Feed-forward deep Neural Network $N$, with hidden layers, that I trained on $D_1$, us...
I am a relatively inexperienced R user and is a newbie here. I would like to ask for your advice regarding how to plot a three-way interaction graph in R. My mixed effects regression model looks like this: model1 <- lmer(score ~ TaskType * Language * Time + VocabSize + (1|ID), data= vocabtestscore) TaskType is binary ...
Hi i am actually not an actuary but I'm currently working on an ML project on insurance pricing. The pricing is calculated by multiplying Claim Frequency and Severity, correct? I'm currently using Poisson GLM to predict the Claim Frequency, using Exposure as the offset, the data I have in hand is historical claim data ...
I am modelling a linear regression of two retail prices. Correlation shows a positive relationship. When I regressed it with each other, it showed a positive coefficient. However, when I added a trend variable to, it was significant but the regression coefficient becomes negative. How did this happen?[
I am new to statistics and find the following procedure unnatural and arbitrary. Could someone point out what I miss, and how I should be thinking? Assumptions I have two vectors of real numbers $x_{i}$ and $x'_{i}$ with length $N$, and I assume that they are respectively sampled from one-dimensional normal distributio...
What EXACTLY do percentiles (/does which) mean, how are they distributed exactly (equally/weighed)?
I had this question when reading section 3.5.3 on page 170 of "Pattern Recognition and Machine Learning" written by Christopher M. Bishop: Here $\mathbf\Phi$ represents the design matrix and $\beta$ is precision which is positive. My question is: why is $\mathbf\Phi^\top\mathbf\Phi$ a positive definite matrix? I tried...
I have an extremely skewed data with these info: Population: 25129 skewness: 3.336996478307211 kurtosis: 84.24134797666636 Min: 0.0 Mode: 5500.0 Median: 11300.0 Mean: 12226.218104649015 Max: 245540.0 What is the best way to determine the number of samples, and how to sample this? And please make it simple cause i'm a ...
Is there a way to perform Discriminant Analysis when your data is not normally distributed and the covariance matrices are not equal?
My dataset consists of 950k unique loan observations over the period of 4 months. The institution is international, so it has some observations from different countries (not panel data). I am studying the relationship between interest rates and a unique independent variable X. However, I want to control for macroeconom...
I am an MBA student taking courses in statistics. Recently, I posted a question (Can "Pooled Averages" be considered as "Better" compared to "Individual Averages"?) in which I asked if averaging different averages together can improve the quality of an estimate. Now, I have a slightly modified version of this question....
in the model below, can I say that 2021 G2 is not significant because it is calculated from a non-significant interaction ? These are my variables: CONT_Y = scores YEAR = A/B (2020 or 2021) MY_GROUP = test1 (G1) or test2 (G2) I have this model: Y ~ MY_GROUP * YEAR modInteraction <- lmer(Y ~ MY_GROUP * YEAR + (1|...
I apply 2 different machine learning models in my data, a Multiple Linear Regression and Random Forest. The results were bellow: Why the MAE and RMSE are higher for a higher R-squared? Both models were tested in the same test set but with different input varibales
Assume I have some distribution $p(x)$ that is constrained to some closed and bounded region in $R^n$. I would like to have some way of sampling from some distribution $q(x)$ such that $q(x)$ is high in regions where $p(x)$ is low and the inverse is true. Any ideas on how to do this? Thank you in advance :)
I have a large list of $n$ distinct numbers drawn from a discrete uniform distribution of integers in $[0, M[$, with $n \ll M$. $M$ is known, but $n$ isn't. It's too expensive to read all $n$ numbers, but I can read the $k$ smallest numbers in the list for some $k \ll n$. I want to estimate $n$ from this sample. Let's ...
I've been trying to understand very hard this exercise, but I haven't been able to understand how it's solved. The topic is Bayes's theorem. This is the same exercise stated here but that question doesn't have an answer and I went a bit forward. The exercise says: A woman lives in a country where only 1 out of 1000 pe...
Mean = u = 10 std = o = 2 Finding a and b such that P(a<x<b) = 0.90 and |u-a| = |u-b| So I looked at a Z table and found 0.90 sitting between a Z-Score of 1.28 and 1.29. I added those values up and took the average so that. 1.28 = 0.899727432 and 1.29 = 0.901474671 (0.899727432 + 0.901474671) / 2 = 0.9006010515 Z= 1.28...
Suppose $X \sim N(0, \sigma^2)$, is it possible to evaluate $E[\Phi(\frac{aX + b}{c}) | X > k]$ in closed form, where $\Phi$ is the standard normal cdf? The motivation comes from that it is possible to evaluate something like $E[\Phi(\frac{aX + b}{c})]$ with a closed-form expression. But not sure if something similar h...
Using rjags and jags.samples (), I have multiple parameters that are monitored and some parameters are in matrices. This means for example, with 2 chains and 5000 iterations, jags.samples() may return a list of mcarrays, say, "samp": par1 has dimension [1:2,1:2,1:5000,1:2] par2 has dimension [1:2,1:10,1:5000,1:2] par3 ...
I use the Poisson distribution in virology where we try to answer: "What is the probability that X viruses enter a cell given a E(x)=MOI (=virus/cell)". The analogy is that we throw a certain amount of balls on buckets and we ask how many balls enter in each bucket. If I understand everything correctly this is a case o...
I'm studying and implementing a variational auto encoders to perform unsupervised clustering. I understand that them use a probabilistic approach respect to a traditional neural network, but I don't understand which are their advantage respect to the traditional ones. Thanks for your answer
I'm experimenting with the marginaleffects package trying to calculate counterfactual marginal effects for the species variable. I'm just wondering if someone could help to show me what I'm doing wrong in the code as only two of the three pairwise comparisons are shown. Thanks. library(marginaleffects) dat_pen <- read....
In the OLS, we can run t-tests on the coefficients obtained from linear regression, but how can we test on the coefficients we obtained in the case of lasso or ridge? What's the common practice in data analysis
I runned two GLMs using the same dependent and independent variables, but modelling each analysis according a different type of distribution. Then, I compared its AIC values to find what distribution best fits the data: > glm_1 <- glm(data$Y ~ data$X, family = "gaussian") > glm_2 <- glm(data$Y ~ data$X, family = "Gamm...
I recently failed to solve a problem relating to conditional expectation. The problem states: A student is initially outside. He is given the choice with a probability of 0.4 of going to the playground, 0.3 of shopping in the mall and 0.3 of returning home. If he is in the playground, he takes 2 hrs of time and then d...
The actual values of NMDS axes are essentially arbitrary, as I understand them - there's no meaning to be gained from a value of 1 or 100 or 10,000. In keeping with good design principles should I drop the axis text and background grid and just include the zero-lines for each axis? Or is there something I'm missing tha...
Let N be the number of phone calls made by the customers of a phone company in a given hour. Suppose $N\sim Poisson(\beta)$, where $\beta > 0$ is known. Let $X_i$ be the length of the i'th phone call, for i = 1,2, . . . ,N. We assume $X_i$'s are independent of each other and also independent of N. We further assume $$X...
If we do linear regression we have the following decomposition of the sum of square. I call $y_i,x_i,\hat{y}_i$ the observed variables, the predictors and the linear predictions respectively. Then the residuals are $e_i=y_i-\hat{y}_i$. We also indicate with on overline the mean over all samples. Than: $$\sum_i (y_i-\ov...
I am following this https://www.coursera.org/learn/survival-analysis-r-public-health/lecture/s4N9p/how-to-run-simple-cox-model-in-r and I've found that the coxph command ( survival package) perform a likelihood ratio test after the application of one and one only cox model: Correct me if I am wrong but, as far as I kn...
If you allow a bit digression about the context: I am on a journey to better understand the power and usefulness of parametric distributions; I am a bit scared of them. Maybe due to the fact that I've entered the world of data analysis more from the side of "data science" & ML rather than from the side of pure statisti...
I observe some individuals (labeled id) that have made a choice from a set (the alternative variable is alt). The choice set remains constant, but choices are made at different periods (year). Also, all individuals from the sample are unique (i.e. I do not observe individuals making choices at different periods). Here'...
I'm not an expert on this methods, and maybe my approach have some error. But I wanted to know how to compute a Least Square estimators given samples with different dimensions. For example you have a sample $B:\{b_1\dots b_N\}$, and also a sample $C=\{c_1\dots c_M\}$ where $N\neq M$, and you also know the relation betw...
A book reports that ICA cannot be used if the independent components of the analyzed data are Gaussian (at most one can be Gaussian, but no other). However, in the same book, the following example is reported: "A number of 1024 samples of a two-dimensional normal distribution was generated with mean μ and covariance ma...
I'm stuck trying to understand the relationship between normality and autoregressive models. If we have a variable Y(t) given by an AR(1) model with zero mean for the marginal distribution, how do we actually check for normality for the conditional and marginal distributions given that the Y(t) is stationary? Some ques...
Suppose $X$ is a random variable that is bounded with high probability, i.e., $|X| < M$ for some $M \in \mathbb{R}^+$ with probability $1-p$. Is it correct to say that $\mathbb{E}(|X|)<M$ with probability $1 - p$ as well?
I'm working on a project where the objective is to determine whether there are factors that distinguish an emergency department (ED) encounter from a high-frequency patient (8 or more encounters per year) from all other encounters. My data is at the ED encounter level and contains data that is both specific to the enc...
When working with normal distributions, please could someone help me understand why the two following manipulations have different results? Is $X + X$ different from $2X$? Take $X$ to be normally distributed with mean and variance $X\sim N(2, 3).$ $Z = X + X$ is also normal, i.e. $Z\sim N(4, 6)$. $Q = 2X$ is also norma...
I have data on 150 sprint races $r$ and on the rankings and training routines of 20 athletes $i$ who have participated in each race. I am interested in finding out whether spending more time training is associated with an increased probability of winning a given race. I am thinking of approaching this with the followin...
(I am not sure if this is the right community to ask this question or whether math.stackexchange would be more appropriate. I feel this is the right one but let me know if I should cross-post) I'd like to (probabilistically) map barometer data to altitudes. In other words, for a given value of barometric pressure I'd l...
after reading this paper https://onlinelibrary.wiley.com/doi/10.1111/1440-1681.12052 I have real troubles deciding which test is most suitable for my analysis. The data is following: a group of patients with a phenotype was selected for a study to investigate the occurrence of certain feature X. The outcome of the stud...
I'm training an sklearn decision tree in python, and it has achieved around 99% accuracy on cross validated test data, so I would like to know what exactly the tree is doing in order for it to predict the test data so accurately. I know I can plot feature importance and look at SHAP values, but I'm wondering whether th...
Are these models considered linear models? I was reading an article that stated that GARCH(1,1) is superior to non-linear GARCH Models. Source: https://www.researchgate.net/publication/346647974_Comparison_of_linear_and_non-linear_GARCH_models_for_forecasting_volatility_of_select_emerging_countries This means that a GA...
I'm struggling to create a forest plot that separates the average effects by outcome. I ran a multivariate mixed effects meta-analysis with 6 outcomes, with 49 studies (some studies have effect sizes for all six outcomes; others have less). Here is the model and output: main_model <- rma.mv(ES, variance, mods = ~ RELAT...
Suppose we are given that $X_1$ and $X_2$ are two non-negative random variable such that $$X_1+X_2\sim\chi^2_{(2)}$$. Also we are given that $X_1\sim\chi^2_{(1)}$. Can we say the following $X_2$ is independent of $X_1$? $X_2\sim\chi^2_{(1)}$? If not, then please provide a counterexample. This is just a fun question q...
I have $n$ IID samples $X_i$ from some distribution. I can calculate $\min_{i \neq j}(|X_i - X_j|)$ and would like to get a confidence interval for said quantity. Naive Bootstrap clearly makes no sense here. Let $$ X^{\star}_1,\dots, X^{\star}_n $$ a bootsrapped sample. Then, with high probability, there exist $k\neq l...
I have given data for users which is right skewed with a long tail, meaning high gmv is driven by few users. Now I have 2 cohorts of users for whom I want to compare gmv distribution. My first instinct was to go for t-test but it has an assumption of normality. Though I also found I my readings that if my sample size...
Problem. Eggs are thought to be infected with the bacterium salmonella enteritidis so that the number of organisms, $Y$, in each has a Poisson distribution with mean $\mu$. The value of $Y$ cannot be observed directly, but after a period it becomes certain whether the egg is infected ($Y > 0$) or not ($Y = 0$). Out of ...
If we have a set of observations $\mathcal{D} = \{x_i\}_{i=1}^n$ then the likelihood $\mathcal{L}$ is: $$ \mathcal{L}(\theta \mid \mathcal{D}) = P_\theta(\mathcal{D})$$ and if the observations are independent then: $$\mathcal{L}(\theta \mid \mathcal{D}) = \prod_{i=1}^{n}P_\theta(x_i)$$ where $P$ is the probability mass...
I've recently learned about Gaussian mixture models (GMM) in school. The formula for a GMM goes something like this: $$p(x) = \sum_{k=1}^{K} \pi_i\mathcal{N}(x|\mu_i,\,\sigma^{2}_i)$$ Now, I know from probability theory that given a certain sample $x$, the probability for it should sum to 1. For example, if I roll a si...
Why do we need to estimate the variance of $\hat{\beta}_1|x_1, x_2,\ldots, x_n$ when we want to test a hypothesis about $\beta_1$?
I want one expression for the null hypothesis for the location tests (one-sample t-test and one-sample Wilcoxon test) can I write this for both tests $H_0:\mu=0$ as general expression?
Is there a way to obtain averaged marginal predictions (predict then average like the margins command in Stata, not average then predict like emmeans in R) using the marginaleffects package? I am looking for a package in R that does most (preferably all that margins does in Stata) in terms of not only calculating estim...
To explain clearly what my question is imagine this simple example. "There are 101 boxes each numbered 1,2,3... and so on. An android can randomly choose one of these boxes, but each one with a probability proportional to its number." import numpy as np from empiricaldist import Pmf, Cdf NB: The function Pmf() from e...
I have two measurements $X = x \pm \sigma_{x}$ , $Y= y \pm \sigma_{y}$, where $x,y$ are the mean values of $X$ and $Y$ and $\sigma_{x},\sigma_{y}$ are their corresponding uncertainties. The covariance matrix ($\Sigma$) for them is the following: \begin{equation} \Sigma = \begin{pmatrix} \sigma_{x}^{2} & \sigma_{xy}\\ ...
When I do ML estimation, I always get confused about whether I should $\max_\theta\prod P(D | \theta)$ or $\max_\theta\prod P(\theta | D)$, where $D=\{x_1,x_2,\dots,x_N\}$ and $\theta$ are the parameters of the distribution. I know that in the first case, what I am doing is maximizing the likelihood, and in the latter ...
My goal is to learn hypothesis testing one sample one sided. Honestly, I don't get it. Hypothesis testing one sample RIGHT SIDED H0: μ <= x̄ H1: μ > x̄ For example, I have a pg_df = pd.DataFrame([10,9,9,10,11,9,8]) The pg_df.mean() is 9.4 Questions: Google have been saying μ is mean population. But why do we compare ...
I'm carrying out a GLM on proportion data (derived from counts) After carrying out a GLM with the quasibinomial error distribution (my data is non-integer) model=glm(response~predictor1+predictor2, data=df, family=quasibinomial(link=logit) After which I get a summary which shows that the data is not overdispersed I was...
I am an MBA Student taking courses in statistics. In this last week, I have heard two conflicting opinions from my professors on Statistics. 1) Predictive Models can NOT make predictions on individuals - only on groups: My professor from my "Research Methods" class introduced us to the concept of the "Ecological Falla...
I have created 2 scripts for training a simple classification decision tree with cross-validation. The problem is that sklearn is performing better in time and accuracy than a spark. I have the exact same configuration so I don't really get how Spark gets 0.43 acc but sklearn gets 0.89 acc. Also, I have 4 nodes, 16Go R...
I need to investigate a chain of influences which can be described as following: First, a deliverer sends barrels of oil. These will be connected to a certain system and purified. Next, the oil will be pumped through a main line throughout the company with several valves. From these, mechanics can fill up oil according...
My colleagus has asked me to read through the ETOS material for estimating confidence intervals (published by Statistics Sweden) and point estimates, knowing I have a bachelor's degree in statistics. I know a bit about estimation but the terminology is partly new to me. How do I interpret the different parts of this cu...
Situation: My objective is to apply Machine Learning (for regression problems). Therefore, I have a panel dataset of time series with daily fund data from 2018-01-01 to 2020-12-31. My target is fund flow. To apply ML models, I wanted to split my dataset into train and test set, using 2018-01-01 to 2019-12-31 for traini...
I work in the field of linguistics, and my current project involves lots of distance matrices generated from language data, which measure the distance and similarity of dialects. Concretely, my distance matrices range between 0 and 1, where 0 represents no distance and 1 represents maximal distance between dialects. No...
I am working on time series data where I am using FB Prophet algorithm. I am willing to build a dashboard to produce validation results to my clients. What could be a possible model validation strategy, keeping in mind that I want to present the status of the model in the form of a Red-Amber-Green (RAG) status.
Hi I have a dataset including 885 observations. We are looking at the association between a set of predictors and the chance of pregnancy after embryo transfer. The response variable is dichotomous (pregnant or nonpregnant). Predictors are dichotomous (number of embryos; 1 or 2, time; before a certain date and after, e...
Warning: I am not a statistician, so please go easy! I have a (not) normally distributed measure of a population, with possible values from 0 to 100%. Its mean is 60%. I need to be able to shift the distribution to give it a mean of 70%. I obviously can't just add 10% to all scores because anyone who previously scored ...
I am trying to wrap my mind around causal inference, mostly because I think it will be useful for my work. I read the Book of Why, I read "Causal inference in statistics: A primer", I did an online course on that. As far as the maths in the primer goes, I can follow it without a great effort (but maybe I am fooling mys...
I need to compute an effective diameter is 90-th percentile of the distribution of shortest path lengths of a graph. My attempt is: library(igraph) set.seed(4) g <- erdos.renyi.game(n=50, p.or.m=100, type="gnm", directed=TRUE, loops=FALSE) sp <- as.vector(shortest.paths(g, algorithm = "dijkstra", mode="out")) sp <- sp[...
It's my understanding that if I center $y$, the intercept should be 0. However, when using glmnet, I get a non-zero intercept doing this: lasso_model = glmnet(x=bodyfat$x,y=bodyfat$y-mean(bodyfat$y),intercept=TRUE,alpha = 1,lambda = 1.5) The intercept is given as $-45.53019$, but shouldn't it be 0 because I've taken t...
I am working on time series with seasonality. However, the event that is repeated every year doesn't happen exactly in the same time, it advances by specific period of time. (example an event happened this year on 1st January, next year will take place on 11th January and the year after that 21st January and so on. eac...
I have some data of pairwise comparisons between players with a continuous value as outcome, for instance like this: Player1 Player2 Score --------------------- A B 12.38 A C 4.82 C B 6.41 C D 1.39 A D -1.05 ... ... ... Where a positive score me...
In a famous book whose authors do not want the solutions of the exercises published on the web, one can find the following exercise. Let $(X^i)_{i \in \{1,\cdots,n\}}$ be i.i.d gaussian vectors of law $\mathcal{N}(0,I_d)$, that is, each $X^i$ is a vector in $\mathbb{R}^d$, and each of its coordinates is a gaussian vari...
I'm running an imputation using the mice package in R (imputing 7 variables with missing values on the basis of 10 total variables). The imputation runs fine, and the imputed variables look reasonable in terms of the spread and gaps compared to the original distributions. Looking at the plot of the various imputation c...
We know, roughly speaking, the algorithm of decision tree is like an approximation with piecewise constants. For example, suppose we have a function $f$ from $[0,1]$ to $\mathbb R$. Then we can use decision tree to approximate it, i.e. using piecewise constant functions to approximate it. The trained model can tell us ...
I have a multivariate normal distribution for vector $\mathbf{x}$ with mean vector $\boldsymbol{\mu}$ and covariance matrix $\boldsymbol{\Sigma}$. In my specific use-case, $\boldsymbol{\Sigma}$ is actually a correlation matrix. For the sake of calculating some leave-one-out log-likelihood values downstream, I need to e...
I'm evaluating a large data set in pandas (over 4 million rows), and finding that the median values for a couple of my datapoints are completely unchanged over a period of three months. For example, when looking at a set of miles per day and calculating medians per month I get this: Median miles per day: January: 0.916...
I am building an indicator for developable land as the inverse of the principal component of four variables that are all negatively correlated with land availability (e.g. terrain slope, fraction of soil covered by water, etc.). This is the output of my analysis Principal components/correlation Number o...
I have a doubt from a passage in the ensemble learning chapter of Aurelien Geron's book "hands on machine learning... ". I do not understand If you do the math, you will find that the probability of obtaining a majority of heads after 1,000 tosses is close to 75%. The more you toss the coin, the higher the probabilit...
I want to evaluate the efficacy of an intervention that only about 50% of participants comply with. The intervention consists of giving people an app that they are asked to use over an extended period of time. The problem is that only about 50% of the participants who are asked to use the app do so consistently. We hav...
To calculate the PDF of the sum of two triangularly distributed random variables all I did was add them together and divided by two: $\dfrac{f(x, a1, b1, c1) + f(x, a2, b2, c2)}{2}$ And implementing it in Python gets me the following PDF: My issue was with the CDF. Addition doesn't work, but I don't know how to mathe...
Assuming I am conducting an AB testing on a website to see if there is an increase on user click thru rate. I know there are many different kinds of tests such as t-test, ANOVA, etc. Is it required for me to use these tests if my result is obvious that there is a substantial difference? In other words, when should I us...
Let the random variable $X$ follow the distribution: $$ f(x;\theta) = \theta^2(x+1)(1-\theta)^x$$ where $x$ takes values in $[0, \infty)$ and $\theta$ in $[0, 1]$. The likelihood is defined as: $$\mathcal{L}(x \mid \theta) = p_\theta(x)$$ and for $N$ i.i.d observations: $$\mathcal{L}(\theta) = \prod_{i=1}^N p_\theta(x_...
Is this misusing correlation? Am I being silly? maybe it would only be a correlation if there were multiple pictures of cats being on broken roofs