instruction
stringlengths
9
38.7k
I don't know how to interpret the ordinal variable 'Stress' in my binary logistic regression analysis.'Stress' was measured on a 10 point scale where 1 is 'Least stressed' and 10 is 'Most stressed'. The outcome variable is prosocial behaviour. Edit: I now understand that the variable 'Stress' is not significant (p>.05)...
I recently read a paper describe their result with MA-contour plots, I did some searches, but most of the information I could get was about the results of contour plots, which seemed to be different from the data in the article. Is this a variant of MA-plot? See Figure 2g of https://doi.org/10.1101/2023.08.21.554109
Here is regression model without penalty: $$y = \beta_0 + \beta_1 x + \epsilon$$ Here is regression model with penalty: $$y = \beta_0 + \beta_1x + \epsilon + \lambda\beta_1^2$$ Here is the error term for the model without penalty: $$E = \sum_{i=1}^{n}(y_i - (\beta_0 + \beta_1x_i))^2$$ Here is the error term for the mod...
Suppose there is some data and all assumptions for regression are met. I fit 2 regression models now: Case 1: Regression model where all coefficients have significant $p$ values but overall the model has high error. Case 2: Regression model where all coefficients have non-significant $p$ values but overall the model h...
I've determined there is a difference in factor levels on a dependent variable. I'd now like to determine which level differs from other levels. I know I can use contrast coding, specifically deviation coding (described here) to compare each level against the grand mean. However, problems are: Comparison of one level ...
I have a dataset containing observations at time t and t+1 of ratings A (best) to E (worst) and Default. I want to use transition matrices to predict future ratings t+2, t+3, etc The transition matrix of the full portfolio is monotonic (transition to a further state is less probable than a transition to a nearer state)...
I start with Binomial distributed random values with known $N$ and success probability $p$. I can easily estimate PMF and CDF of such distribution. Now assume these Binomial distributed random values go through a filter, for example moving average. Is the PDF of the new distribution well defined? Context: my goal is to...
I'm reading the paper "The Fully Convolutional Network" and I don't understand this passage in 3.1: Typical recognition nets, including LeNet [21], AlexNet [19], and its deeper successors [31, 32], ostensibly take fixed-sized inputs and produce nonspatial outputs. The fully connected layers of these nets have fixed di...
I'm following the third recipe of this answer to estimate the Shannon entropy of my samples using histograms. My expectation was, increasing the sample size should lead to a better estimation of the true entropy. To test that, I sampled from a Gaussian distribution $N(0, \sigma^2)$ with known entropy $H(X) = 0.5[1 + \...
I have been told that the heteroskedasticity-robust standard error of $\hat{\beta}_1$ from an OLS regression with a binary $X_i$: $Y_i = \beta_0 + \beta_1 X_i + u$ should be the same as the conservative estimator of the sample average treatment effect (SATE) SEs when treatment is randomly assigned (such as in a randomi...
I am doing research and interested in the following question: What are the evaluation metrics for chunking, retrieval and synthesis steps for Q&A, when I do NLQ with LLMs? I am looking for scientific approach, not just human verification. I am familiar with this article for retrieval, but cannot find anything on on met...
I'm struggling to grasp Gaussian Process Regression (GPR). I am familiar with the weight-based methods since we can use a basic linear regression to understand about how it works. While I understand weight-based methods like neural networks, I find it challenging to find straightforward explanations or simple examples ...
Suppose we have random variables $$X \sim N(0, \sigma_X^2) \\ U \sim N(0, \sigma_U^2) \\ V \sim N(0, \sigma_V^2), $$ where $X$, $U$ and $V$ are independent. And $$ S = X + U \\ T = X + V. $$ Is it possible to define a linear combination of $S$ and $T$ such that conditioning on $$R := aS + bT, \ \ \ a, b \in \mathbb...
While working on a meta-analysis, I found different types of Chi-Square tests in the literature. I wonder if all these different types can be handled the same way when converting χ² to Pearson correlation r or Cohens' D. Type A: The Chi-square test according to Pearson (Pearson's chi-square statistic) includes the squ...
I just learned about permutation tests through self-study. According to Wikipedia we have : (1) "The null hypothesis is that all samples come from the same distribution $H_{0}:F=G$." and : (2) "Under the null hypothesis, the distribution of the test statistic is obtained by calculating all possible values of the test s...
One of the R plots for a diagnostic of linear model lm() is a plot Cook's distance vs. $\dfrac{h_{ii}}{1 - h_{ii}}$. My question is: why don't we plot Cook distance against $h_{ii}$? What's the gain from $\dfrac{h_{ii}}{1 - h_{ii}}$? Obviously it is a monotonic transformation $[0,1) \mapsto [0, +\infty)$.
What are the similarities and differences between Spiked tensor decomposition and canonical polyadic (CP) decomposition? My understanding is that CP decomposition aims to find a low-rank approximation of the full tensor. Spiked tensor decomposition aims to recover a planted low-rank structure within a full tensor. Are ...
I am doing the above exercise in Jim ALbert's "Bayesian Computation with R", Chapter 5. I have made a normal approximation of the paramater $\eta$, which is the logit of $\theta$. I understand that for the problem (a), I can simply get a 95% credible interval for $\eta$, and them apply the inverse transformation to ge...
Suppose that there are $J$ markets, and prices in every market $j$ follow a random walk. That is, for any time $t$, the price $p_t$ is the sum of shocks up to $t$: $$p_t = \sum_{i=1}^t \epsilon_i^j$$ where $\epsilon_t^j \sim N(0, \sigma^2)$ for all $t, j$. Intuitively, one expects the cross sectional variation across t...
To test cointegration relationship for multiple time series, one usually writes the VAR(k) as $$ \Delta y_t = \Pi y_{t-1} + \sum_{j=1}^{k-1}\Gamma_j\Delta y_{t-j} + e_t $$ See, e.g., https://www.uh.edu/~bsorense/coint2022.pdf According to the above lecture note and many textbooks, if $\Pi$ has full rank, then all $y_t$...
I have a complex dataset, collected through a survey, with both continuous (such as Age, Body mass index, etc..) and categorical variables (i.e. Gender, Education, etc..). I want to estimate their multivariate distributions and then sample from it. I was looking at nonparametric techniques and copula functions suitable...
I am running a test across two groups over a period of time and want to understand if the Change in proportions for my test group is significantly different to the change in proportions in the control group. Most of what I have found compares one proportion to another either over group or over time but not both. If I h...
I want to run an experiment with 4 variants (3 and a control), comparing the 3 variants to the control. I want to correct the alpha for multiple comparisons. I have 2 ways: Benjamini-Hochberg procedure Bonferroni correction What are the trade-offs of using any of the two?
Using Amelia II for multiple imputation in R, I cannot find elaborate explanations of whether to set variables to being ID or nominal (perhaps a Stata forum post comes closest). How to choose? In my case I have concatenated, or appended, some data drawn from the same world and made an ID variable representing (a) each ...
It is easy to recover the total distance using optmatch::fullmatch, e.g., library(optmatch) data(plantdist) fm1 <- fullmatch(plantdist) sum(unlist(matched.distances(fm1, plantdist, pres = T))) How would one accomplish this using the MatchIt package? There doesn't seem to be a way to recover the individual pairwise dis...
What is the best way to compare performances between editions of the same running event? In this case, distance and elevation varies slightly from year to year. Compare differences between editions for all runners who participated in both? But then age is a factor that may needs to be considered (such as the World Mas...
Problem I have $K$ sets of conditions (index by $k\in\{1,..,K\}$), and each set has $N_k$ conditions. For example, if $K=2$ and $N_1=N_2=2$, we could call the conditions (A,B) and (C,D). I have paired data from every possible combination, in the form of a $N_1\otimes N_2\otimes\dots\otimes N_K$ tensor. For the $K=2$, ...
I learned that Random Forest classification is particularly useful for identifying the importance of explanatory variables within a classification dictated by the categories of a response variable. However, if said response variable was constructed based on the explanatory variables, does it still make sense to run the...
I am conducting machine-learning in R using mlr3. I would like to assess the performance of my model by conducting a benchmark of my model using real and also randomized data. Here is an example: library(dplyr) # generate task data and randomized data df <- palmerpenguins::penguins df_randomized <- df %>% mutate(acro...
I'm modeling recruitment curves using a Hierarchical Bayesian model. There is a key parameter in my recruitment curve, let's call it $P$. I have two groups (A and B) of participants of respective size $N_A$ and $N_B$. After I have finished fitting recruitment curves, I get estimates for the parameter $P$: $P_A$ of size...
I am trying to meta-analysis the OR of a variable (troponin) for a dichotomous outcome (mortality). There are several multivariate logistic regressions out there, but none of them share the exact same set independent variables (some of the models present Individual Patient Data, most of them just Aggregate Data). Are y...
I have two sets of correlation data and my variable of interest and I am wondering if/when o apply FDR to the obtained P-Values. On one hand, I have correlations with gene expression data, so a great many deal of correlations (over 60k). lets call this dataset 1. On the other hand, I have correlations with of my variab...
I am testing random intercept models using the glmer() function in R. I learned from my stat class I need to use FIML, not REML to compare nested models. However, glmer() do not use either FIML or REML for model estimation, to my knowledge. Then can I just use anova() to compare the different models? I wonder if there ...
I need to determine the ACF for a SARIMA(0,0,1)(0,0,1)12 model with $\Theta=0.7$ and $\theta=0.4$. However, I am unsure what parameters to use.
I am trying to joint model longitudinal data with informative observation times. Taking the simpler case, where the outcome and time processes are associated through a random intercept, I already wrote the code to get the EM-algorithm estimates. Now, I want to calculate the standard errors and p-values of the fixed eff...
I am trying to draw an ellipse that bounds a bivariate distribution by the shared 1 sigma in 2D space (i.e. points that fall within one standard deviation of both populations). The function in R I am using takes the mean of both populations, the covariance matrix, and a parameter alpha, which is the probability of poin...
Given a dynamical system of many variables, described by an ordinary differential equation, is there some way to use machine learning to efficiently sample from the limit set (or maybe more accurately a limit distribution, since states that the system is more likely in should be sampled with a higher probability densit...
I have a dataset containing lizard home range estimates and several environmental variables. My end goal is to create a model that uses the best combination of environmental variables to predict home range size. Recently I have come across an issue in my analysis that I am confused on. I am trying to build a model in t...
Let's say I have test condition A and B, and a binary classification model. I have paired samples in conditions A and B, and I want to test if these conditions are different in classifier performance. My understanding is that McNemar's test is most appropriate here. However, what if I have multiple replicates, creating...
I am working on a black-box optimization that involves surrogate modeling. Some of my decision variables are integers, but I doubt a MIP approach would work for my case. My advisor told me that it is okay to treat these variables as continuous values for now, as this makes it easier to build surrogate models. After obt...
Suppose I have $m$ cultures of each of two strains of bacteria. I subject each culture of bacteria to different growth conditions, and measure the cell viability at the end of the experiment. This leads to $2m$ data points where growth conditions are measured categorically whereas cell viability is measured numerically...
In section 5.2 error decomposition (p.404) from the book "Shai et al., Understanding Machine Learning: From Theory to Applications", the authors wrote: As we have shown, for a finite hypothesis class, $\epsilon_{est}$ increases (logarithmically) with $|\mathcal{H}|$ and decreases with $m$. Where $\epsilon_{est}$ deno...
For some work I am doing, I want to determine how similar a set of linear equations are to y=x The other linear equations are determined through linear regression of different datasets (all of which have very high R^2 values, hence wanting to compare the lines of best fit to the ideal y=x). My first thought would be to...
I am working with two quite large datasets (9000 obs and 3800 obs). Each observation has been grouped into 1 of 12 categories and I am looking to test if the frequency of categories in the smaller dataset follows the same distribution as in the larger dataset. I can visually see that it does, but I'm having issues stat...
I've recently been reading about ordinal regression with a focus on the proportional odds model in the book regression modelling strategies. The author states "A basic assumption of all commonly used ordinal regression models is that the response variable behaves in an ordinal fashion with respect to each predictor. As...
I have national level data for 4 questions. The questions are Likert scale 1-5 (strongly disagree, disagree, and so on..) Im trying to calculate confidence intervals for munnicipalities for the proportions that have anserwed 4 or 5 to those specific questions. I used prop.test in R like this: angry2.5 = prop.test(sum(!...
The situation Imagine an archaeological site, 10.0m deep. For my study, I construct an "age-profile" for this site, i.e., I produce a model of age as a function of depth. There are various modelling tools to achieve this (eg., OxCal, Bacon, bchron). As I understand it, these procedures model age and depth using Bayesia...
This is a question I got on my recent intro-stats exam which I still can't comprehend. "What's the power of a hypothesis test with significance level 0.05, if the probability of picking 5 or more things from a box of 15 is larger than 50% when the probability is actually 75%?" I think you can interpret this in differen...
I'm trying to run a synthetic control model, and have a general question. My data contains 201 localities over 9 years - 8 pre-treatment and 1 post-treatment. In the model, I include several socio-demographic variables (e.g., total population, mean age, male ratio, mean income, etc.), as well as the outcome variable, w...
I have quite the specific question over a model for which I am asked to compute a posterior. Here are all the details : Bayesian model . For clarity purposes, let $X=[x_1^{\top}, \ldots, x_T^{\top}]^{\top}\in \mathbb R^{T\times k}$, $\varepsilon = [\varepsilon_1, \ldots, \varepsilon_T]^{\top}\in \mathbb R^{T}$, $Y=[y_1...
I consider the normal distribution truncated to the half-interval $[0,\infty)$, $$ P(x) = \sqrt{ \frac{2}{\pi\sigma^{2}} } \frac{1}{\operatorname{erfc}\left( -\frac{\mu}{\sqrt{ 2\sigma^{2} }} \right)} \exp\left( -\frac{(x-\mu)^{2}}{2\sigma^{2}} \right) $$ for $x\geq0$, while $P(x)=0$ for $x<0$. Given some observations ...
Every resource I found online doesn’t say what to do if the constraints aren’t satisfied. If my updated parameters is given by: $$\theta_{k+1} = \theta_k - (JJ^T + \lambda I)^{-1}Jr, $$ where J is the gradient, $\lambda$ is the damping factor and $r=C-C^*$ is the minimiser function ($C^*$ is the real value we are calib...
I´m trying to fit a linear mixed model to test if my dependent variable (B) is different between my treatments (A with 2 levels A&B). The study was conducted at severals sampling sites. To account for the paired data (measurements within one site) I would take sampling site as random effect into the model: lmer(B ~ A +...
I am getting into and trying to learn how to use principal component analyses (PCA), and got stuck on a few things that I thought someone here might be able to help me with. What I am trying to do: I have a data set of a number of animal individuals. For each individual I have six different measurements (eg. weight, he...
I am trying to understand the shannon entropy better. By definition, the shannon entropy is calculated as H = -sum(pk * log(pk)). I am using the scipy.stats.entropy formula and I am running the calculation against a constant signal and a high variance signal. However, the constant signal gives me an entropy of 2.7 whic...
I have done a series of one-way ANOVA tests. For each test I have calculated the corresponding alternative hypothesis F-statistic and confidence intervals, based on the degrees of freedom involved and the corresponding non-centrality parameter. To calculate the value of the non-centrality parameter for each test, I hav...
The definition of sub-gaussian from a book I work with is: $X\in\mathbb{R}^n$ is $(\Sigma,C)$ sub-gaussian if $$\mathbb{P}(\lvert X^\top u\rvert>t)<Ce^{-t^2/(2u^\top\Sigma u)}, \qquad u\in\mathbb{R}^n\setminus\{0\}, t>0.$$ And I wonder how I can show that $X\sim N(\mu,\Sigma)$ is $(\Sigma,C)$ sub-gaussian.
I transformed one of my independent variables into natural logarithm form in a fixed effect panel data. This is because the data of this independent variable (i.e., EXT) is heavily skewed. This is the distribution before transformation. And this is the distribution after log transformation This transformation changed...
Let's say I am interested in identifying associations between a blood protein and disease activity, but I have multiple measurements per subject. Based on a literature review, I expect sex differences in protein levels. Is it necessary to include the effect of sex in my mixed models if I have already included the subje...
I am doing some work where I am meant to apply Mclust() to my data set, with 50000 samples. I previously used PCA in order to reduce the dimension, which left me with 20 principal components (from 35 initial variables). Should I apply Mclust directly to my dataset or the transformed one from the pricipal components?
I modelled some dummy data in glmmTMB package in R: set.seed(1234) area <- sample(1:1000, size = 55) mydata <- data.frame("species" = c("A1", "A1", "A1", rep(c(paste0(LETTERS[1:26], 1:26), paste0(1:26, LETTERS[1:26])))), "ar...
I'm assessing the effect of an exposure variable on cancer risk. I am not necessarily trying to build the model that best predicts cancer risk, I am instead trying to best isolate the effect on cancer risks due to this specific exposure variable. I'm doing this with a Cox PH model with the exposure variable as a covari...
Appreciate your guidance on calculating standard errors from mixed models. There are some other questions on this subject, but mine is specifically for the random effect intercepts. I am not a statistician by training, so I am looking for an applied perspective. It seems there are two strategies. methods that trace th...
I am trying to fit a mixed model that can account for heterogeneous variance using lmer() function in lme4 package. Right now, my model structure in lme4 looks like this: lmer(log_biomass ~ Group + Time + Group*Time + (1|Field:Group) + (1|Field:Group:Time), data = uav_data_soy,REML = FALSE) The package...
Let's denote the asymptotic variance under heteroscedasticity as: $$\hat{\text{Avar}}(\hat{\beta}) = 1/N * \left(\frac{1}{N} \sum_{i}{x_i x_i'}\right)^{-1} \left(\frac{1}{N} \sum_{i} \hat{u}^2_i x_i x_i'\right) \left(\frac{1}{N} \sum_{i}{x_i x_i'}\right)^{-1}$$ But I would like to have that in matrix terms. First I thi...
I'm currently working on a large prospective cohort with the basic demographic characteristics and various socioeconomic factors collected at baseline. This cohort was follow up since baseline entry for about 10 years, and disease incidence and cause-specific deaths were recorded. The aim is to estimate the causal effe...
I want to determine whether my assumption that the dataset I'm using is i.i.d. is in fact valid (for an arbitrary dataset, perhaps made of images). I have done quite a bit of research already, looked through various papers on google scholar, but haven't found what I'm looking for. Is there any half-decent measure of in...
I want to analyze the difference between 4 groups on one dependent variable while controlling for my covariate, age, and 3 different independent variables (sex, cancer type, metastasis) in SPSS. Can I use an ANCOVA with this many independent variables and if so, do I need to create dummy variables? Alternatively, what ...
I am not used to time series econometrics. If I understand well, before conducting a linear regression (the most basic possible), we need to ensure the stationarity of our data - particularly with (Augmented) Dickey-Fuller tests. Then, we need to fit the optimal ARMA(p,q) model to our stationary data. Once we've fitted...
I am reading material that reports the area under a ROC curve. I am curious to know what the performance would be in precision-recall space. From the sensitivity and specificity values in the ROC curve and knowing the prior probability (prevalence) of event occurrence, I can calculate the precision, derived here. $$ \t...
The Fundamental Theorem of Statistical Learning from the book "Shai et al., Understanding Machine Learning: From Theory to Algorithms, Cambridge Press University", is written as follows: Let $\mathcal{H}$ be a hypothesis class of functions from a domain $\mathcal{X}$ to $\{0, 1\}$ and let the loss function be the 0−1 ...
I am building a mixed effects logistic regression model to explore whether or not someone is diagnosed late with a specific infectious disease. My outcome is late diagnosis (yes/no). My data includes a number of patient-level predictors (e.g., age, sex, route of transmission, etc.) as well as data on the clinic where t...
I'm trying to teach myself an intuitive understanding of basic statistics and have encountered the following problem in a textbook: Q: Seven observers were shown five dishes containing mustard seeds. The observers were asked to estimate the number in each dish. The mean guesses per observer across al five dishes were: ...
I have two distance matrices: one produced based on cosine distances and another produced with Gower distance. I have used these separately for clustering, but I would like to combine them somehow to feed into a single clustering model. I have read about two options to combine distance matrices: do a weighted sum (w*D1...
Given the estimator for $\hat{\beta}_1$ in the Frisch-Waugh-Lovell Theorem: $$\hat{\beta}_1 = \left(X_1^\prime{} M_2 X_1\right)^{-1} X_1' M_2 y$$ I can arbitrarily use either the $y$ in the auxiliary regression or the residual of a regression of $y$ on $X_2$. This can be seen from (just using the fact that $M_2$ is sym...
I need to do a regression in R, I want to predict CHI from TETA, first I've made a plot of my data and I obtained my data are CHI<- c(19.2430 , 14.4949, 11.6516, 9.7592, 8.4091, 7.3973, 6.6104, 5.9807, 5.4650, 5.0345, 4.6695, 4.3558, 4.0830, 3.8434, 3.6310, 3.4414, 3.2708, 3.1163...
Consider the following two statistical principles: 1) an exact test's $p$-value gives the exact frequency with which the observed random sample appears by chance, i.e., under a true null hypothesis; and 2) the Fisher information in a statistic is an inverse function of the estimator's standard error, the extent to whic...
I have two datasets that have the same type of predictors. For dataset A there is a biological manipulation and for dataset B there is not (B is the control for A). I have collected each dataset at different parameter values (let's say C1, C2, C3, ...) and see that there is a "qualitative" difference between the data f...
The variance of residuals in a linear regression is given by : $$Var(e_i)=(1-h_{ii})\sigma^2$$ This means that residuals have a lower variance than the error terms, and the variance of residuals is smaller for observations with higher leverage. I see that from the equation above but I can't get an intuitive explanation...
How do epidemiologists convert hazard ratios to difference in life expectancy? For example, let's say I find that the hazard ratio of all-cause mortality in City A is 1.25 compared to City B. I want to find out how to calculate how much shorter life expectancy is predicted to be in City A compared to City B based on th...
Let $f_1$, $f_2$ be two discrete probability distributions. By Pinsker's inequality, the Kullback-Leibler divergence $D(f_1||f_2)$ sets an upper bound on the total variation distance between the two distributions, and thus on the difference between the probabilities that $f_1$, $f_2$ can assign to the same event. Is th...
I'm working on Wooldridge's “Econometric Analysis of Cross Section and Panel Data” and I don't fully get why this test would not work. I'll share my work with screenshots so it's clearer hope that's okay. I start with: $$y_1=z_1\delta_1+\alpha_1y_2+z_2\lambda_1+\gamma q+a_1\qquad(1)$$ Because the exercise states that ...
I've got a dataset of patients with AVM (neurosurgical disease) where you can receive endovascular treatment, surgical treatment or both (usually because endovascular treatment failed). My outcome is post-operative modified rankings scale (MRS). I've dichotomized it by allocating 0-1 to 0 and 2-6 to 1. I've shown that ...
I was trying to apply BIC to my dataset to find the ideal number of clusters and model that best fits my data, in order to use EM algorithm, but it´s not reaching a maximum, even if I increase the max number of components to 20. They keep increasing slowly but they don´t decrease. I have previously performed k-means an...
Let $P(x)$ and $Q(x)$ be two pdfs. Let us say that $P(x)$ is the original baseline distribution and $Q(x)$ is the model (or estimate) distribution. I wanted to take the KL Divergence (or the 'distance') between the two distributions. Which one should I perform: $KL(P,Q)$ or $KL(Q,P)$? I am using the definition: $KL(p,q...
When I fit an "AAN" ETS model with alpha and beta both equal to 0.5, the level is correct as per the Level equation, but the slope as independently calculated by the Trend equation is not. I have tested this with different data sets. In the code below I have used Rob Hyndman's example from the video on Holt's Linear Tr...
I am trying to do a research article on morbidity, which is categorical, i.e., yes or no. I also consider fixed and random effects, given that all of the fixed effect covariates are categorical. Here is the model. twoRIM <- glmer(morbidity ~ co_fuel + wealth + san_class + residencey + education + marital + age + parity...
I don't have any data, so I'm trying to extract a partial R-squared for one of the predictors from a linear multiple regression, in order to calculate the sample size for a regression study I would like to conduct. The partial R-squared will be fed into Gpower to calculate f2, and then the sample size. I have these val...
What characteristics differentiate a classic GNN and a sparsely connected feedforward NN (basically a modified fully-connected NN), where the sparse connectivity is given by a user-defined sparsity matrix?
I have a longitudinal dataset, and I want to create a composite score by including five healthy lifestyles to measure the overall lifestyle over time (use as predictor). Each lifestyle is a binary variable (e.g., 1 = Yes, 0 = No). A problem here is that each individual lifestyle more or less has some missing data durin...
I apologize if the question is considered too broad, but I'm hoping to get at least a basic starting point as I'm somewhat stuck with how to approach this. I am working with community ecological data-counts of species collected. The main goal of the project is to see if there is a difference between diversity across ho...
Is there a name for the following probability density function: $$ P(x) \propto \exp\left(-\frac{x^2}{2}\right) \cosh(\gamma x) $$ where $\gamma \ge 0$ and $x\in\mathbb{R}$? Eventually my goal is to draw efficiently samples from $P(x)$. If this distribution does not have a name, any suggestions on how I can draw sampl...
When you use the method of least squares you estimate the parameters in the following way: $$\min_{\mathbf{b}} (\mathbf{y} - \mathbf{X}\mathbf{b})^T(\mathbf{y} - \mathbf{X}\mathbf{b})$$ Where $\mathbf{y}_{n \times 1}$, $\mathbf{X}_{n \times (p + 1)}$ and $\mathbf{b}_{(p+1) \times 1}$ If you solve the problem you obtain...
Given a standard normal random variable $U$ , is there a general formula to compute the expected value of the absolute value of $U$ to any power? For example given a non negative constant $r$ (i.e $r\gt 0$) how to get $\mu_r = E[|U|^r]$ where $U\sim N(0,1)$?
I am estimating a system-GMM model using the pgmm function from the plm package in R: pgmm(Y ~ lag(Y, 1) + X1 + X2 + X3 + x4 | lag(Y, 2:99) + factor(Industry), data = df.dat, index = c("Firm", "Year"), effect = "individual", model = "twosteps", collapse = TRUE, transformation = "ld", robust ...
After read this textbook chapter on fixed effects panel regression by Nick Huntington-Klein, a few questions remain: Is fixed effects regression essentially OLS after normalising the data by subtracting the mean of each individual? For clarity, this data: Individual Year Exercise (hours/week) Cholesterol (y-varia...
I am trying to calculate the confidence band about a regression line using the top answer here: Understanding shape and calculation of confidence bands in linear regression I don't entirely understand the answer, but I am calculating the confidence interval as: $\sqrt \frac{\Sigma_i^n (Y_i - \hat{Y})^2}{n-2} \sqrt{\fra...
Given a probability density function (PDF), we want to use numerical integration to find a quantile at $\alpha \in (0,1)$. Are there standard algorithms for determining a sufficient and optimal range over which to perform the integration? Below is an example for a non-negative random variable parameterized by (a, b). ...
I am attempting to fit a multiple linear regression equation to a continuous, real-valued outcome variable, $Y$, using a number of predictive variables, $(X_1, X_2, ... X_n)$, i.e., $$ Y = \beta_0 + \beta_1 X_1 + \beta_2 X_2 ... \beta_n x_n + \varepsilon $$ One predictive variable under consideration is the standard de...
My question: Let's say I have some data on the cumulative number of infections per day since the start of a pandemic at $t=0$. Since clearly the infection rate changes over time, I want to calibrate a non-homogeneous Poisson process $N(t)$ on this data, with a cumulative arrival rate $\Lambda(t)$ that I need to estimat...