instruction
stringlengths
9
38.7k
I want to estimate the following regression equation: $y = a + \frac{b}{r*x + 1}$ x is the independent variable, and a, b and r are parameters to be estimated. I have been told that the model is not identified, I suppose because I am trying to estimate both b and r with just one independent variable. Theoretically, wha...
I am new to multivariate analysis. I have been given a set of survey answers with around 120 binary questions. My goal is to first perform cluster analysis to find the optimal number of respondent "types". In the next step, I want to analyze what distinguishes the different clusters within correlation between different...
Given a random variable $X$ with known pdf $f$ and some computer simulation model $g(x): \mathcal R \rightarrow \mathcal R$, mapping samples $x \sim f$ to a scalar metric $g$, we can estimate the probability $P(g(x) > 0)$ using Direct Monte Carlo Simulation: $\hat{p} = 1/N \sum_{i=1}^N I(x_i)$, where the indicator f...
I'm trying to understand this formula for the variance in Kohler's PGM text. It's theorem 7.3: Let $Y$ be a linear Gaussian of parents $X_1 .. X_k$: $$p(Y|X) = \mathcal{N}(\beta_0 + \beta^T\mathbf{x}; \sigma^2)$$ Assume that $X_i .. X_k$ are jointly Gaussian with distribution $\mathcal{N}(\mathbf{u}, \Sigma)$ Then: Th...
Let's say I have some regression model, say $\mathbb E[y]=\beta_0+\beta_1x_1+\beta_2x_2$. However, I am fitting this regression because I want to estimate $\beta_1$ while "controlling for" the effect of $x_2$, as is common. A typical approach might be to fit the regression with a method like least squares or maximum li...
I am working on a project where I am attempting to estimate the causal impact of civil war peace agreements (treatment) on levels of violence (outcome). While developing the DAG, I came across an issue where some of the nodes cause each other (pictured below is a simplified version of the DAG designed to only include t...
I'm trying to understand the basics of Gaussian Distribution. I struggle to visualice how the variance of the conditional probability of say P (Y|X) changes when X is fixed (given X and Y have a joint gaussian distribution). So, I have two pictures , in picture A from many sources shows that the variances dont change b...
In Measuring nominal scale agreement among many raters, where the authors define Fleiss kappa, the agreement by chance is defined as where $p_j$ is defined as the proportion of ratings which were to the $j$th category. Can someone explain how the authors arrived at this equation? An additional reference for the equati...
I came across this post in using GAM with the default Gaussian family to examine the significant difference of the patterns across two categorical variables Statistical differences between two hourly patterns I am wondering why is Gaussian used here, instead of Gamma family since MET (metabolic rate) seems to not inclu...
Quantile regression allows to estimate a conditional quantile for y (like e.g. the median of y,...) from data x. I do not see any distributional assumptions about y being made. This seems in contrast to maximum likelihood estimation which starts with making an assumption about the distribution of y (e.g gaussian distri...
This might be a basic question but here it goes: I have a differentiable (arbitrary) function $f(t)$ on some interval $[0, T]$ that has mean $T^{-1}\int_0^T f(t) = 0$. I want to sample a set $S$ of $n > 1$ points such that the sample average is as close to $0$ as possible, on average. I think I would formulate this as ...
In my textbook, the autocovariance of the AR(1) model is derived as such: $$Y_t=\phi Y_{t-1}+e_t$$ After multiplying both sides by $Y_{t-k}(k=1,2,...)$ and take expected values, you get: $$E(Y_{t-k}Y_t)=\phi E(Y_{t-k}Y_{t-1})+E(e_tY_{t-k})$$ which implies that $$\gamma_k=\phi\gamma_{k-1}+E(e_tY_{t-k})$$ However, I don'...
I am performing a random forest model in R using caret = rf method. I have 20 explanatory variables and most are continuous but a few are categorical and numeric. For example, there are 6 categories of soil drainage coded as 1-6 class = integer. Before running the model I converted these categorical variables to factor...
Let's say that we have a population of 1000 people, and every day people eat some number of oranges. We run a survey to find how many oranges each individual has eaten in each of the last 360 days. We then bucket those 360 responses into 30-day periods, noting the mean and stdev for each, and mix them all into the same...
I have 1100 objects to inspect whether they meet the standard or not (yes or no question), of which 100 have been inspected already and 99% of them passed the test. Due to resource constraints, we can't inspect all the remaining 1000 objects and hence need to take a random sample of them. How can I calculate the minimu...
I have heard people say, "One of the disadvantages of neural networks is that they are generally less interpretable". But I wonder, how is another model, such as XGBoost, more interpretable than neural networks? In XGBoost, one could use feature importance, SHAP, or PDP to explain the model, which I believe can also ap...
I am working on Bayesian estimation: suppose that $X_1,\dots, X_n$ is an iid sample from Uniform$[0,\theta]$. Assume a Pareto prior for $\theta\sim Pareto(\alpha,\beta)$, i.e. $$ f(\theta)=\frac{\alpha\beta^\alpha}{\theta^{\alpha+1}}, \, \theta\ge \beta, \alpha>0, \beta>0 $$ What is the Bayes estimator of $\theta$? Do ...
I have a linear regression task where I am trying to predict in the interval of roughly [-100, 100]. I'd like to build a GBM (it doesn't have to be) that allows me to see the probability distribution of potential outcomes instead of the point prediction. My end goal is to sample from that distribution for a simulation ...
I was linked a youtube video where the first two characters were underscores, how could I calculate the probability of that happening? 64 possible characters, 11 character long string, and only two underscores appearing twice at the beginning. Is this possible?
I'm running a likelihood ratio test to check whether or not a condition has a significant outcome for subjects performing an experiment, and I'm using lmer in R to do this. So I run something like > mod = lmer(outcome~ 1 + (1 | subject_id),data=df) > mod2 = lmer(outcome~ 1 + (1 | subject_id) + condition,data=df) > anov...
I'm writing a paper that uses a random forest algorithm. I want to represent the model in the paper. But I was wondering how to illustrate a random forest model using an equation in a paper, with the target variable, y and features, x. I hope this makes sense.
Consider the model [1] $$y_n=X_n\beta_n+\epsilon_n$$ $$\beta_i|\sigma^2,v_i \sim \mathcal{N}(0,\sigma^2 v_i), i=1,\ldots,p$$ $$v_i \sim \beta^\prime(a,b)$$ $$\sigma^2 \sim \mathcal{IG}(c,d)$$ where $\beta^\prime$ is the beta prime distribution and $\mathcal{IG}$ the inverse gamma distribution. In [1], the authors prove...
Let $(U_i,V_i)$ be i.i.d samples from a bivariate distribution. Show that $$\mathbb{E}[(1-U^2_1)\cdot(1-U^2_{2})\cdot|V_1-V_2|]=\mathbb{E}\left\{\mathbb{E}[(1-U^2_1)|V_1]\cdot\mathbb{E}[(1-U^2_2)|V_2]\cdot|V_1-V_2| \right\}$$ I have no ideal how to start.Are there some properties of conditional expectation I should use...
I would like to compute ratio of proportions coming from a Dirichlet distribution. My understanding is that each proportion should be treated as a random variable and therefore I should use Taylor expansion to compute mean and variance of ratio. However when I follow this procedure I seem to obtain very different resul...
Define $I_n(\lambda_j) = \frac{1}{2\pi n} |\sum_{t = 1}^n Z_t e^{it\lambda_j}|^2 = \frac{1}{2 \pi} \sum_{h = - \infty}^{\infty} \hat{\gamma}_n(h) e^{ih\lambda_j}$ where $Z_t$ is a $WN \sim (0, \sigma^2)$ and $\gamma(h) = cov(Z_{t}, Z_{t - h})$ is the autocovariance of the process at lag $h$, $\hat{\gamma}_n(h)$ is samp...
I want to examine the relative importance of the predictors in my model. I know the domir package in R allows for the examination of relative importance for glm but my model is a nb.glm. Is there a way that I can use to examine the relative importance in this situation?
Lets suppose we have a time series with monthly data (frequency=12) my_tS <- ts(my_monthly_data, start=c(2002,1), frequency=12) When I plot it, I can see a seasonality every 6 months. So, to remove it, I should compute a differencing every 6 months: my_tS_stationary <- diff(my_tS, 6) I check it with KPSS and its stat...
I have a mixed-ANOVA design: 2 groups (experimental & control) x 4 time points (pre, post, post2, post3), and am using G*Power to calculate the required sample size. My understanding is that the "ANOVA Repeated measures, between factors" should be used if I am interested in the sample size required to detect the main e...
We apply the student’s t instead of the normal when we are estimating the standard deviation too (for example in a t-test). But what happens with other probability distributions when we do a hypothesis test? Say for example we are using a Cauchy distribution with all its parameters being estimated.
I have a data set on a large group of long-term stroke survivors. I need to determine whether there is a difference in ability (on a scale of 1-10) between their left and right arms. The ordinal data is heavily skewed towards scores of 9/10. I'm wavering between the Wilcoxon matched pairs test or McNemar test, which sh...
Is it recommended to check for autocorrelation in a Bayesian Structural Time Series model (using CausalImpact)? If so, could I use the Durbin Watson significance table for models with no intercept to determine the lower and upper bounds for the critical values? https://www3.nd.edu/~wevans1/econ30331/Durbin_Watson_table...
Why do I not get the same p-value when comparing the marginal means for 3rd and 2nd person using the pairs() or contrast() function? (see code below)
I have 32 months of historical data and I am testing forecasting methodologies. I assume that only 12 months of data are available, I forecast months 13-32, and then compare actuals for months 13-32 with my forecasts for months 13-32. The data at hand shows the number of monthly deaths, starting with a fixed population...
I'm interested in constructing a risk index by indexing a large number of identified risk factors into a composite measure (that ideally then has sub-dimensions that can be explored further if one so chooses --- especially potentially linking these sub-dimensions in the form of cascading risks). I'm wondering if you al...
I have built a linear regression model with three predictor variables: the model predicts forest growth (y = stand volume) with stand age, stand basal area and site type (x1, x2 and x3 respectively). However, my goal is to predict the forest volume so that I only know the forest age and site type. Is there any way to m...
I have data where 400 participants rated a set of 8 given scenarios on the scales "valence" and "emotional arousal". The scenarios were designed in a 2 (setting: Europe vs. Asia) x 2 (complexity: low vs. high) x 2 (density: low vs. high) design (experimental manipulation). I would like to model the fixed effects of com...
I have two Bayes models, and let's say that model A is more complex than model B. I know a priori that model A is a good model for the data. I want to make the claim that model B is applicable as well. One idea that comes to mind is the use of WAIC. Is there any acceptable score classification that says that if the WAI...
In my dataset, all the variables are highly correlated (correlation coefficient > 0.95). However, the correlation with the dependent variables is very low (<0.35). I checked the variation inflation factor (VIF), but it's 'inf' for some variables and very high (around 6 figures) for other variables. So cannot filter wit...
Dataset I am working on a dataset collected from more than 20 hospitals. I used the glmer command to estimate a mixed-effects logistic regression model with the following as patient-level predictors: age (patient's age; a continuous variable), cci (Charlson Comorbidity Index; a continuous variable), sex (patient's sex...
Background I investigated if sex differences over time (gender:time) in treatment response (PPA) were dependent on smoking status (gender:time:smoking_status), accounting for correlations between repeated measurements within subjects (1|ID) and between subjects within countries (1|country) using linear mixed model anal...
I have a quick (perhaps very naive) question here. Suppose I have a Cox Regression model in which I have modeled a spline curve on a Predcitor. I want to plot the results of this regression (i.e., predicted Hazard Ratios across the Predictor spectrum). I have to option: to plot the y-axis in linear scale (as following...
I ran a multiple linear regression model for a study where I try to predict different companies' emission levels using a few predictors. Two of my predictors are categorical and I performed one hot encoding on my dataset. To check if my regression model violates the assumptions of linear regression, I plot residuals ag...
I'm wondering why I should or should not use Cohen's $\omega$ (omega) for effect size over Cramer's V for a chi-square goodness-of-fit test? What would be the advantage or disadvantage of favoring Cohen's $\omega$? I am using the rcompanion package with the cohenW() and cramerV() functions.
I am wondering what is best practice for reporting a chi-square goodness-of-fit test. Should a result be significant, would a follow up of an Odds Ratio be required if there are more than 2 categories?
I have a BERT model that's fine-tuned so that given a sentence in my X column, the model gives a vector that approximates the corresponding sentence in my multidimensional Y array. I'd like to use the model-generated outputs as inputs to a KNN model that predicts which of the sentences in Y best corresponds to the gene...
I'm estimating a basic OLS model, y ~ x, and I want to know the difference in the slope between two groups. Here is a simulated example in R: set.seed(123) x <- runif(50, 0, 10) slope_a <- 1 slope_b <- 3 df <- data.frame( x = x, y = c(slope_a*x + rnorm(50), slope_b*x + rnorm(50)), group = rep(c('a', ''), e...
Let consider two observables, $x$ and $y$. Suppose that $y$ depends on the independent variable $x$ through the model $m(x; \boldsymbol{\theta})$, where $\boldsymbol{\theta}$ is a vector of model parameters. I want to estimate the Cramer-Rao bound of one of these parameters, for forecasting purposes. To this aim, I hav...
I'm learning about time series forecasting. I have a dataset whose autocorrelation plot looks like this: Here, the $X$ axis represents the lag in days, and the $Y$ axis represents the autocorrelation coefficient for each lag. I plotted the autocorrelation in hopes that it would show that my data set can be modeled acc...
My goal is to extract the seasonality of a product's grocery sales time series. I know standard time series decomposition when a time series is expressed as $_=_+_+_$, the sum (for an additive model) of a trend component, a seasonal component and the remainder. Currently in Python, I use the seasonal_decompose function...
I cannot understand why total SS=explained SS+unexplained SS because geometrically the sum of two small squares is not equal to a big square. I wish someone could explain that to me. Thank you.
What is the purpose of model comparison? Is it to make the same predictions about the response variable, using the same regression formula of predictor variables, but with varying specifications (like transformed or not data, different probability distributions) in order to see what assumptions give the best fit? Or is...
I am wondering if sensitivity analysis for causal inference is only applicable when doing backdoor adjustment/selecting on observables. Conventionally, sensitivity analysis evaluates the threat of an unknown confounder to a causal estimate in observational studies. In studies where we select on the observables, this ty...
I have three linear regression models in R: 1. lm(Y~X1) 2. lm(Y~X2) 3. lm(Y~X2+X3) Of note, in this data mathematically X1=(X2+X3). Model 1 gives Adjusted R^2=0.100 and p=0.023. Model 2 gives Adjusted R^2=0.096 and p=0.025. Here's the confusing part to me. Model 3 shows that only X2 is significant and the model as ...
I was reading about weight initialization in neural networks (He et. al, 2015) when I came across this statement: "If we let $w_{l-1}$ have a symmetric distribution around zero and $b_{l} = 0$, then $y_{l-1}$ has zero mean and a symmetric distribution around zero." Where $y_{l-1}$ is given by $w_{l-1}x_{l-1}$, the prod...
I’m having a statistical problem (a rather major one) and I was wondering if you could help. I’m researching microbial chemotaxis and analysing colony perimeters by scanning their fluorescence. Chemotaxis is the ability of a microbial cell to swim towards an attractant, in this case succinate. I’ve a set of ~10 scans (...
Reproducible example: require(finalfit) require(dplyr) set.seed(42) a <- c(32,291,545, 44,3,792,352, 20,615,169, 61,156, 88,863,255, 33,132,5, 63,8,964,831, 55,133, 12, 54,261,867, 17, 12,699,233,251,446, 43,223, 374, 75, 34, 69,120, 84,134,8,806,8, 48, 86,211, 2436, 61, 81, 87, 12, 838, 34, 1...
I was trying to learn how to estimate exchangable correlation matrix. I asked ChatGPT to give me an example so that I can learn the steps and ChatGPT gave me this example Lines <- "ID Time Z 1 1 -1.5 1 2 -1.5 1 3 0.5 1 4 0.5 2 1 -0.5 2 2 -0.5 2 3 1....
I have for a matrix $A\in R^{d\times p}$ having i.i.d. standard normal entries and for fix $u \in R^p$, then we have that $\frac{\Vert Au\Vert_2^2}{\Vert u\Vert_2^2} \sim \chi_d^2$. If we denote $a_i$ being the $i$th row of $A$, then we have that $\frac{a_i^\top u}{\Vert u\Vert_2}\sim N(0,1)$, but I think I can use som...
I chose an exchangeable var-cov mmatrix for my geeglm library(geepack) data("muscatine") gee2 <- geeglm(numobese ~ gender + occasion, id = id, data = muscatine, family = binomial(), corstr = "exchangeable") summary(gee2) The variance covariance matrix that I get after fitting this mode...
I am trying to determine how a doctor's expertise (either expert:1 or not an expert:0) affects their diagnostic accuracy of medical images. Additionally, I'd like to examine how the hospital at which the images were taken affects the diagnostic accuracy, both for expert and non-expert doctors. I have thousands of medi...
I am trying to understand theorem 5.2.1 of Bickel and Doksum's Mathematical Statistics book. The theorem states that if $\mathcal{P} = \{(p_1, p_2, \ldots,p_k): 0 \leq p_j \leq 1, 1 \leq j \leq k, \sum_{j = 1}^k p_j = 1\}$. I understand the uniform continuity aspect of the problem, but I do not understand how we achi...
I have set up a gamsel like this ( X has ~ 60 different independent variables). I am struggling to interpret the summary and plots: gamsel.out <- gamsel(X,y, bases = bases, family = "binomial") summary(gamsel.out) gamsel.cv <- cv.gamsel(X,y,bases = bases, family = "binomial) plot(gamsel.cv) Can anyone help me in u...
In model assisted survey estimation, one typically uses the generalized difference estimator: $$ \hat{t}_{ma} = \sum_{k \in U} \hat{m}(\mathbf{x}_k) + \sum_{k \in S} \frac{y_k - \hat{m}(\mathbf{x}_k)}{\pi_k}, $$ where $U$ is the target population, $S$ is a probabilistic sample where each unit $k \in U$ has a probabilit...
In a fixed power prior model, the model is set up as: $$ \pi(p_i \mid \alpha,\mathcal{D}_0) \propto L(p_i\mid \mathcal{D}_0)^{w} \pi(p_i) $$ Suppose that the event follows a Bernoulli distribution with probability $p_i$, what I want is to raise the Bernoulli likelihood to the power of $w$ in jags: mod1<-function(){ f...
I have a case in which I have two sets of ranks. To compare these two ranks, I use once wilcox test and once ks test. The reason why I am using both returns to the special cases of shapes of data which cannot be detected by using only one of these tests. At the moment, I am getting the minimum p-value from these two te...
I created the following random-effects model, and am hoping to -for now anyway- generate a very basic forest plot, using the forest function from metafor. This is the code I used: `res <- rma(yi=Effect.Size, vi=var, data=full) forest(x=res, vi, sei=se, ci.lb=low, ci.ub=hi)` This is the error code I received: Error in f...
Given the model: > Durée <- c(6, 5, 3.5, 3, 5, 3, 2, 8, 2.5) > Note <- c(18, 16, 14, 10, 15, 13, 8, 19, 12) > model <- lm(Note ~ Durée) I was tasked, among other things, to verify whether homoscedasticity is true. After running plot(model) I was able to visualise the following graphs: From the Residuals vs Fitt...
Is there a name for a function which is like $f(x)=-\log(-\log(x))$ where $0<x<1$? Or, is there any name for this function $g(x)=x+\log(\frac{1}{x})$ where $0<x$? Exchanging $x=-\log k$ in $g(x)$ gives $f(k)$ and I would like to know about those functions any deeper, but I am having trouble searching about them. I know...
Is there a proof that for the sequence $x_{n+1}=4x_n(1-x_n)$, the lag-$m$ autocorrelation for $m=1,2$ and so on, is zero if you start with a random seed $x_0$, or say $x_0=\frac{1}{3}$? It is defined as follows: $$ \rho(m) = \lim_{n\rightarrow\infty} \frac{1}{8n}\sum_{k=1}^n \Big(x_k-\frac{1}{2}\Big)\Big(x_{k+m}-\frac{...
I am analyzing a association between a frailty index and care needs using the cox model. I use R and use rms package to fit restricted cubic spline. This is my R code. rcs_dt <- datadist(dt.care2020[, c( "care","care.py", "QQ")]) options(datadist = 'rcs_dt') rcs_model <- cph(Surv(care.py, care) ~ rcs(QQ, 3), ...
I have some data for multiple users and I want to generate some marginal effects for each user using GAM modelling. If I do this exercise for just a single user (John) as: model_1 = mgcv::gam(y ~ s(speed) + s(length) + s(price), data1) with data1 having data only for John, then I can get the speed-effect with predictio...
I am trying to answer the following question from my quantum mechanics textbook and my probability theory is admittedly rusty (this is not schoolwork as should be clear from my post history on Phys and Math SE): The probability density for the decay of a radioactive nucleus is $P(t) = \alpha e^{-t\alpha}$ where $t > 0...
I always struggled to get imputation for missing values right, and it doesn't help that you can find contradictory opinions online about it. Say I have data X that I split into X_train and X_test, and I want to use a machine learning algorithm that does not handle missing values (say logistic regression or a neural net...
I have a co-occurrence matrix about hashtags usage (The value in the cell means the number of times two hashtags appear together in a single tweet), it is transformed from a 2-mode matrix. Now I want to use Ucinet to normalize this matrix because I have 4 matrices like this in different periods. Indeed, I want to compa...
Hang Nguyen writes the following in "Machine learning basics (part 14): Linear Discriminant Analysis": If there are two classes then the LDA draws one hyperplane and projects the data onto this hyperplane in such a way as to maximize the separation of the two categories. This hyperplane is created according to the two...
I have one year-long air pollutant concentration dataset of each 365 days of the year. I want to find if there is any seasonal trend in that data. Can you suggest to me if the Seasonal Kendall's test be applied to this data to find the seasonal trend? In other words, can Seasonal Kendall's test be applied to one year-l...
I am reading an article on the effect of income on energy choice (e.g., choice between traditional sources such as charcoal and modern ones such as electricity). The authors instrument income with rainfall, the intuition behind which I understand (i.e., b/c of both reverse causality and OVB issues). What I don't unders...
Suppose that I have N items that were rated by a first group of annotators on a scale from 1 to 5 (each item was rated only once). I want to compute an inter-annotator agreement score using Fleiss kappa, so I take a subset of the N items and ask different annotators to rate the items again. So, in the end, each item in...
I have a dataset which looks like this > train year OECD_ind steel_ind_2 freight_ind target 1: 2006 1.000000 1.000000 1.0000000 1.0000000 2: 2007 1.035426 1.133137 2.2235587 0.7303400 3: 2008 1.094234 1.177008 2.0097157 1.6466652 4: 2009 1.216508 1.249144 0.8228253 1.0142539 5: 2010 1.30...
I am trying to understand how I can test whether the factor loadings (Beta) in CAPM for different stocks are statistically different between each other. I.e. I have 3 stocks with different CAPM betas. How can I test that those 3 betas are statistically different between each other? Do you have an approach to do so and ...
I have an expression of this form $W_i = a * X_i * (1 - Y_i * (1 - Z_i))$, where $a$ is a constant, $X_i \sim Bernoulli({p_x}_i)$, $Y_i \sim Bernoulli({p_y}_i)$, and $Z_i \sim N(\mu_i, \sigma)$ Background: So, I have three models for X, Y and Z, and these are models for probability of survival, probability of death, an...
I'm currently writing my first empirical term paper and would like to model the following relationship. I'm mainly interested how government spending, which regions are mostly only eligible to if their regional gdp falls below a certain threshold, affects regime approval. The latter is measured as a binary variable in ...
I have a time series data (5000 entries) of a vector quantity. (i.e. 3 components, which are recorded after every fixed time interval of 240 seconds). I want to calculate the Autocorrelation function of this quantity $\langle \vec{A(t)}\cdot\vec{A(t+\tau)}\rangle $, where $\langle\cdot\rangle$ denotes the process of av...
What are some algorithms for determining the seasonal frequency (or equivalently, the length of the seasonal period) from the values of the time series alone? That is, the values of the time series are given, but the time stamps are missing. However, we know the data has been sampled at equal time intervals. (Further n...
Let $X_1,...X_n$i.i.d.~$Pois(\theta)$ with unknown $\theta>0$, I want to find the UMVUE for $g(\theta)=\theta^2$. I know that $T(x)=\Sigma_{i=1}^{n}x_i$ is complete and sufficient for $\theta>0$. $\mathbf{E}_\theta[T(x)]=\mathbf{E}_\theta[\Sigma_{i=1}^{n}x_i]=\Sigma_{i=1}^{n}\mathbf{E}_\theta[x_i]=n\theta$ $\mathbf{E}_...
Let us say we have a cheater's six-sided die, which we can assume to be unfair with an unknown probability distribution. We want to know the most likely roll with this die, and so we roll it $N \gg 6$ times and find that the frequency of rolling a 5 is higher than the frequencies of other rolls. How can we quantify our...
I have the following preset; A data frame on the format as follows: df <- data.frame(prevArrivalTime = c(1676193057, 1676193112, 1676193180, 1676193277, 1676193358, 1676193469, 1676193581, 1676102575, 1676102613), hours = c(1, 2, 3, 1, 2, 3, 1, 2, 3)) dummy <- model.matrix(~factor(hours) - 1, data = ...
TLDR: I need to determine the minimum sample size for measuring the energy consumption of code. Hello, I'm trying to determine how many samples (N) I need in an experiment to be confident that my data's mean and standard deviation are representatives of the population. Note, I'm not well versed in statistics, hence wh...
What is the base for the logarithm used in the cross entropy loss (while doing multiclass classification's backpropagation)? Is it e, 2, or 10?
I want to compare the medians of an interrupted time series, for example, years 2019-2020 with 2021-2022. The data is not normally distributed and the distribution of the data is not similar. Would quantile regression be appropriate here? Should I expect to see similarities between mood median test and quantile regress...
I am interested in understanding the asymptotic distribution of Likelihood ratio (LR) test statistic for model specification. I am focusing on the case in which the null hypothesis is of the form (i.e. to assess model specification): $$ \mathcal{H}_0:\theta_j=0, \qquad \text{For any} \; \theta_j \in \theta \\ \mathcal{...
I would appreciate if you could let me know to conclude about the modified Diebold and Mariano test when our alternative hypothesis is less? How about greater? library(forecast) forecast <- ts(c( 96, 99,102, 96,105, 99, 99,103, 98,106)) observed <- ts(c( 96,101,107,108, 93,103, 99,105,103, 98)) forecast2 <- ts(c(105, 9...
The definition of the hypoexponential distribution (HD) requires that: $$f(x)=\sum_i^d \left(\prod_{j=1,i\neq j}^{d}\frac{\lambda_j}{\lambda_j-\lambda_i}\right)\lambda_i e^{(-\lambda_ix)},\quad x>0 $$ is well-defined, which imposes that all $\lambda_i \neq \lambda_j$. As such, it seems to impose a significant limitatio...
I am estimating a time series 2SLS, ECM model, for electricity consumption. The system has a demand equation: The price is endogenous in the demand equation, and therefore, I also estimate a price equation using instruments: A paper I have been reading makes an interesting point about this setup. The price function ...
Suppose that we have observations $x_1,\dots,x_n$ for some process. We want to fit an AR(k) model to these observations. I do not understand why the naïve OLS approach to estimate our AR(k) coefficients would be inappropriate when the process has a unit root. From some simulations it seems to recover the coefficients n...
I am working on a project with a call center. Long story short, I am analzying the data revolved around the incoming calls to this call center in order to eventually use a queueing model. A queueing model is one which you provide with certain values such as the average service time of calls (average value of how long c...
One of the benefits of DAGs is that they openly state the causal assumptions a researcher is making, allowing for greater transparency. This is nice in theory. However, in practice, the DAGs I have personally created are a tangled web of nodes and arrows. Visually speaking, when the complexity of a DAG increases, I fin...
I am trying to predict a binary outcome. My sample size is very small (n=160) and has a high-class imbalance (80:20). All the variables are highly correlated, and the dataset is high dimensional (the number of variables is 96, and the minority class has 32 samples only). Can I only use repeated or nested cross-validat...
I would like to know how small of a beta coefficient my meta-regression is powered to detect. Thank you for any help.
I have a continuous response variable (leaf length), which has been repeatedly measured in 45 experimental plots over several growing seasons. My goal is to properly estimate at which day of the year (DOY) certain events happened in each year (e.g., the passing of 20% or 80% of annual leaf growth). I fitted different s...