instruction
stringlengths
9
38.7k
I have a daily diary dataset with daily ratings of mood (e.g., daily rating of happiness) between two treatment conditions. The complete number of days of ratings vary widely across participants and there is missing data, i.e., participants forgot to fill out a form on a particular day. I am ultimately interested in wh...
I am currently doing an interactions paper with cox models to assess time to criminal recidivism as an outcome, but am struggling with the interpretations. My two variables that are part of the interaction are continuous count variables: v1 - Ranges from 0-5 v2 - Ranges from 0-2 Here are basic findings from the cox mod...
How would I interpret and report the highlighted boxes? The variables: Injury (0=uninjured, 1=injured) Sex (0=male, 1=female) Diet(1=10%EA, 2=50%EA, 3=100%EA, 4=150%EA, 5=200%EA) (note: the “event” is death; the hazard ratio indicates odds of death)
Consider the standard Cox proportional hazards setting with non-informative censoring. (See https://web.stanford.edu/~lutian/coursepdf/unitcox1.pdf for example.) If our observations are triples $(Z_i, U_i, \delta_i)$, where $Z_i$ is a vector of covariates aka predictors, $U_i$ is the observed time, and $\delta_i = 0$ i...
I'm relatively new to GLMM and am experiencing some difficulty with model convergence. Specifically, I have a data set from 200+ participants, each of whom completed 200 trials of a visual search task. I'm trying to examine whether their RTs changed as functions of trials (from the 1st trial to the 200th trial, centere...
Suppose $x_i \sim N(10,4)$ - ie, the distribution is known. There is a noisy signal $s_i \sim N(x_i, \sigma_e^2)$ and I want to estimate $\sigma_e$. I see some pairs ($s_i, x_i$) but they are not 'random' (there is some selection on $s_i$ - say, I see these values mostly for large values of $s_i$). What approach would ...
I have groups of individuals in a population. These groups have different sizes--for example, group 1 has 50 individuals and group 2 has 1000 individuals. I want to show the differences in the groups' demographics data. I have categorical demographics like gender and location. I've thought about doing simple percentage...
Background I'm a data analyst. The Business unit I'm assigned for needs to segment users based on power vs non-power users so they can target each segment with proper treatments. Goal Segment users (power vs non-power) based on their spending level (revenue generated to the company) on a small sample (20k users) Find...
I have two simple questions about generalized linear models (GLMs) which for some reason I could not find a good reference for: What is the form of the hypothesis/predictor for generalized linear model? i.e., some function $f: x \mapsto \widehat{y}$, $\widehat{y}$ is the prediction of the label of $x$ What is the usu...
I am running a pooled OLS regression as a benchmark model on a panel data set of online forum member activity. The aim of the model is to understand the relationship between exposure to hate speech and its adoption. The pooled model therefore includes exposure to hate speech the previous month as the independent variab...
I’m a bit stuck with what seems like a simple question. I have data from an experiment whereby participants had to provide ‘yes’ or ‘no’ answers (so the response mode was binary). Their scores, however, are not binary as there were multiple conditions and I took the average score for each condition. The final scores in...
The central limit theorem in its most popular form states that (without being too formal) for a set of random variables $X_1,X_2,...,X_n$ independent and identically distributed with mean $\mu$ and standard deviation $\sigma$ we have that $\sqrt{n}(\bar{X}-\mu)$ converges in probability to a normal distribution with me...
I have one categorical IV, one categorical moderator, and a continuous M and Y. I runs a moderated mediation model 7 based on proposed model of my study. The result show that there is a significant index of moderated mediation, but one of the conditional indirect effects are nonsignificant. How should I interpret that?...
We can read in Jaynes' Probability Theory: The Logic of Science that the family of Gaussian densities $$ f_{m}(x) = \frac{1}{\sqrt{2 \pi \sigma^2}}e^{-\frac{(x-m)^2}{2\sigma^2}} $$ with $m\in \mathbb{R}$ is the only translation invariant family such that the MLE of $m$ for iid samples is the empirical mean: $$ \hat m_{...
I use a transformer model to make some predictions similar to time series classification. The model consists of some embedding layers, multihead attention and dense layers. Why does the model loss decrease sharply at the beginning and the validation loss gradually?
I'm new to Inverse Probability of Treatment Weighting and trying to understand the mechanism. From several practical guides I understood, that the weights should add up to the population size for treated and untreated samples (e.g., here or here). Now I have a dataset with unbalanced treatment data and non-normal distr...
Given a model (returning scores between 0.0 and 1.0), and 1000 positives input examples 100000 negative input examples I'd like to calculate the AURPC. Calling the model is costly, so I don't want to invoke it on all 101000 (1000+100000) samples. (~2k samples would be ok.) The "normal" approach would be to evenly sub...
From "An Invitation to Statistics in Wasserstein Space" (Victor M. Panaretos and Yoav Zemel) Theorem 2.2.1 (Convergence in Wasserstein Space) Let $\mu, \mu_n \in \mathscr{W}_p(\mathscr{X})$. Then the following are equivalent: $\mu_n \rightarrow \mu$ weakly and $\int_{\mathscr{X}}\|x\|^p \mathrm{~d} \mu_n(x) \rightarro...
I have seen in many places that the vc-dimension of H, an hypostases class which consists of rectangles parallel to the axis is 4. yet when constructing this 2D constellation of points i can't seem to find any label assignment which can't be labeled by some rectangle...
I'm sorry for such a silly question, but I would like to ask about post hoc comparisons that I could use to follow up on a significant, although hard to interpret, three-way interaction. I ran a mixed-effects logistic regression model with glmer() predicting categorization responses from the speech cue weighting task w...
I'm currently reading James1997 - Generalizations of the Bias/Variance Decomposition for Prediction error. My ultimate goal is to see how, in the special case of squared loss, bias-effect and variance-effect reduce to the commonly known bias (squared) and variance. There is an arithmetic trick being used that I somehow...
I am working with fishery data. I have a data vector called SFL that contains the sizes of the fish caught. Here is some sample data: # Two normal distributions c1 <- rnorm(1000,2,0.5); c1 <- c1[c1 > 0] c2 <- rnorm(1000,6,2); c2 <- c2[c2 > 0] # Sorted SFL vector SFL <- sort(c(c1, c2)) Here my histogram: # Histogram ...
In the first training epoch, the Adam optimiser seems to reset the weights of my model if I have use_ema=True. I am compiling a keras model and loading weights from a file using model.load_weights(<path_to_weights>) To make sure that this is the case I set the learning rate of the optimiser (from tensorflow.keras.opti...
I'm currently dealing with a Gibbs sampler of the matrix variate generalized inverse Gaussian distribution. In order to check the correctness of the Gibbs sampler, I'd like to know what are the distributions of the entries, or at least their expectations.
I would like to rank clusters according to their importance. From 113 demand time series data I extract the following 6 features from each time series. "Average Demand", "n95 demand", "max's deviation from n95", "Zero demand counts", "kurtosis", "skewness" n95 is 95th percentile. I cluster the 113 time series based o...
Here is the documentation for the test of granger non causality. They return OLS estimates for the restricted and unrestricted model. However, on the wikipedia description of granger causality they describe fitting an autoregression model so I'm unsure on how I'm supposed to use the linear regression results discussed ...
I have a dataset of customers, with variables refering to ABSOLUTE FREQUENCIES (counts). For example, I have the number of times he makes a purchase in weekend, the number of purchases in laborable days, the number of purchases in the morning, afternoon, evening, night... etc. I want to create custers using kmeans. Whi...
I was reading in Brown book the theory of a random effect model and then I started searching about how can I apply it in R. I read that when I am modeling a mixed model using R, I am referring to random effects as random intercepts and as random slopes. Also we now have random intercepts model and random slopes model. ...
I am trying to build a logistic regression with staggered DiD (for not yet treated) that incoporates unit and time fixed effect. I am stuck with the logic of building the model as I am trying to understand which time periods should be compared across the two groups. My context is project funding success and I have two ...
For research purposes, I need or would like to understand the EBLUP calculation of random effect. Marginally, y follows : $$y_i \sim N(X_i\beta + Z_iu_i, Z_iDZ_i^\top + \sigma^2_eI_{n_i})$$ and the random effects, $$\textbf{u}_i \sim N(\boldsymbol{0}, D)$$ and they have a multivariate normal distribution with $DZ^\top$...
I collected pulse rate over the same time period by two different methods. My hypothesis is that the two different methods are statistically the same. My data looks like this:
I've been spending a lot of time trying to get survey propagation to work and I'm unsure whether I have a bug in my code or if I need to do more to my algorithm. I get a bit lost in all the heavy math involved in a lot of the papers I read about survey propagation, so maybe I've missed something. I have a CNF that is k...
I fitted a poisson and negative binomial GLM on count data (=larva) and try to explain it as a function of a factor (=modality). However, as the traps used to trap larvae from inflorescences were exposed to different number of inflorescences, I than added an offset (=inflo) to the models for count normalization (in thi...
I'm currently training a decision tree ML model. Everywhere I look, people say that the Gini impurity has a range of 0 to 0.5. However, when I calculate the gini impurity on a set of data with 3 possible values, the gini impurity I get is 0.544. The probabilities of each class are as follows: 0.0 0.497562 1.0 0.4...
Learning about the ReLU, I keep finding variants or approximations that attempt to smooth out the function (eg. squarreplus). Why (and when) is smoothing desirable?
I have a data set that contains cyclists traffic, the independent variables are: day of week, high temp, humidity the dependent variable is: total number of cyclists for that day. Is it possible to predict what day of the week it is based on a given number of cyclists for that day? If so, what method should be used? es...
I am running a linear mixed effect model to see how certain country level factors (i.e. malnutrition, income per capita, etc.) have affected country level TB case fatality ratio over the past 20 years. My data is longitudinal with repeat measures from countries. Because a case fatality ratio is bound between 0-1 I deci...
does anyone has some advice for testing a research model with two parallel mediators in multilevel data? I know how to calculate the mediating effect with one mediating variable. However, my assumption is that there are two mediating variables (intrinsic motivation and introjected motivation). Does anyone know on how t...
I'm currently looking at a study where Ordinal scales are used to compare the effects of drugs on Alzheimer at different time points throughout treatment https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5974972/pdf/main.pdf I've always understood that one can't meaningfully calculate a Mean for Ordinal data since the diffe...
Note after answer is posted: The issue here was actually about formatting the data of the dependent variables in the formula when using (beta-)binomial families. Not about predict(). See the answer. The output of predict(...,type="response"), when I'm using gamlss(...,family=BB), does not match the proportion in the da...
In my team, we are conducting clinical trials using stratified block randomization with random block size. Depending on the user, the randomization list will be generated using custom SAS macros or R functions. As an illustration, here are the 10 first lines of the output for 3 stratification groups with R: We would l...
Assume that $y_i \sim N(50,10)$. I observe a signal with additive Gaussian noise $s_i \sim N(y_i, \sigma_d^2)$ I observe $n$ such signals, each corresponding to a different $y_i$. I want to estimate $\sigma_d$. I am not exactly sure how to since most of the textbooks / posts discuss how to estimate the parameters of th...
I am trying to model bird migratory departure dates using linear or mixed effects models (although open to other model suggestions). I am interested in knowing whether latitude, sex, wing length (a proxy for body size) or body mass have any impact on departure dates. My data (departure dates and morphometric data for i...
Let $n$ be an integer $>1$. Suppose a sample $(x_{k})_{k\in[[ 1;n]]}$ is taken from a known distribution on $\mathbb{R}$. Given $x_1$ and supposing $\exists k\in[[2,n]], x_k>x_1$, what is the most likely minimum of $\{x_k \mid k\in [[ 1;n]] \land x_k>x_1\}$ ? The default question implies no particular order on $(x_k)$ ...
I am analyzing experimental data and would like to know the most appropriate approach. For sake of simplicity, the setup can be described as follows: the data is for students who are either high-income and low-income, and there are two treatment conditions: whether students are monitored during an activity in which the...
According to Elements of Statistical Learning Ch 8.8, we can apply least sqaures at the population level to show that for a regression ensemble $f_1(x), f_2(x), \ldots , f_M(x)$ where $f_j: \mathbb{R}^p \to \mathbb{R}$ the full ensemble has smaller error than any single model: $$ \mathbb{E}[y - \sum_{j=1}^{M}\hat{w}_jf...
I am trying to simulate competing risks data for a power analysis. Based on historical data, we know that after 12 months: 40% had experienced the event of interest 20% had experienced the competing event 40% had not experienced either of the events after 12 months. I have figured out that I can simulate the distribu...
I have a functional response $Y(t)$ (i.e., a stochastic process) which I regress on a set of scalar explanatory variables $X_1$ ($=1$, i.e., $X_1$ is a constant term), $X_2$, and $X_3$. The equation I am considering is thus $$Y(t) = \alpha(t) + \beta(t)X_2 + \gamma(t)X_3 + \varepsilon(t).$$ I am using the R package fda...
Plenty has been discussed on Cross Validated about the drawbacks of classification accuracy when it comes to evaluating classification models. One good answer is here, for instance. Under what conditions would classification accuracy be the correct performance measure? Two interesting examples can be found here and her...
The data that I have contain the time of arrival of the vessel (TA) and also the time spent to berth (ETB) for every vessel during the last year. I want to predict the ETB using LSTM in a deep hybrid model (I'm using different models outputs as an input for other models), but I'm still trying to fully understand if the...
I am trying to fit a two way anova from an experiment with a split-split-plot design. The experimental design is as follows: I have 6 sites (fixed factor). Inside each site I have a random effect of Plot nested within Site and Subplot nested within plot. Within each subplot, I measured PW variables (such as salinity) e...
I have two time series features, $A$ and $B$: both returns. When $A$ is at 0 (as it is for the vast majority of the dates), you cannot say anything about $B$; it's just noise. However, when $A$ increases, $B$ increases (usually with a day lag) and similarly, when $A$ decreases, $B$ decreases. (I also observed the lag t...
I have large sample of data that is approximately from a Pareto distribution with unknown parameters. Unfortunately the distribution is sufficiently heavy tailed that just taking the sample mean is not a good estimate. What is a good way to estimate the mean and variance in this case?
Let $(X,Y)$ be a pair of random variables with joint pdf $f_{XY}$. Let $(U,V)$ be two random variables obtained from $(X,Y)$ by $U = u(X,Y)$ and $V = v(X,Y)$ where $u$ and $v$ are, say, nice invertible functions. Then there is a method to compute the pdf of $(U,V)$ using Jacobians, as stated, for instance, as Theorem 2...
If I have the following regression model: Where wage is a continuous dependent variable and working hours is a sole continuous independent variable. Sex is a categorical variable (two categories: male and female) =1 if male and 0 if female Marital status is a categorical variable (three categories: divorced, single and...
I have a very small dataset (n = 18) of patients with certain key data as well as imaging. I have performed a clustering analysis (via PCA and hierarchical clustering) to cluster these patients based on their key data, and then have created a random forest model using their imaging to predict this key cluster with good...
I'm working on an unassessed course problem, Consider the time series $y_t$ generated by the state space model with $x_t=1$, $F_t=\lambda$, $\sigma_2$, $Z_t=Z$, where the variances $\sigma^2,Z$ and the constant $\lambda$ are all known. Define the time series $$z_t=y_t-\lambda y_{t-1}.$$ (a) Write down the observation ...
I'm trying to calculate the annualized volatility of a single-asset trading strategy that is either 100% long or 100% cash. Imagine a risk-free asset with a guaranteed and fixed daily return of 0.1%. For some unreasonable reason, we decide to hold this asset 50% of the time, and just hold cash for the remaining 50% of ...
I am looking at the effect of altitude on a trait and I want to include the effect of the interaction between latitude and altitude, using a PGLS. Can I include altitude (measured in metres) as one explanatory variable and latitude (measured in degrees) as another? Or would the fact that the two variables are measured ...
I am reading Chapter 4 (Testing and Confidence Regions: Basic Theory) of Mathematical Statistics by Bickel and Doksum. In Example 4.1.1, the authors use the study of sex bias in graduate admissions at Berkeley as an example to illustrate the difficulty of specifying a stochastic model and formulating a task as a statis...
The following is a question based on the paper Graphical Models for Extremes by Engelke and Hitz. For our purposes, exponent measure is a measure defined on $[0,\infty)^d - \{0\}$ with a density $\lambda$ that satisfies $\lambda(ty) = t^{-(d+1)}\lambda(y)$ for $t>0$, $y \in [0,\infty)^d - \{0\}$. $\int_{y \in [0,\inf...
As a learning exercise, I am trying to learn how to fit and simulate from Continuous Time Markov Chains. Suppose I have a Stochastic Process that can assume 3 States: S1, S2 or S3. Lets say I have observe this process making 100 state transitions and I record the time that each transition was made at. I simulated this ...
I have been reading Blundell and Costa-Dias (2009) to try and understand the exact mechanics why standard IV breaks when heterogenous treatment effects are involved. On page 62 there is an almost helpful explanation: The concept itself, that people with higher benefits from treatment may self-select into treatment and...
Let $Z_i$ for $1 \leq i \leq n$ be a sample from the $N(ap, bp(1-p))$ density, where $a \gt 0, b \gt 0$ are known but $p \in (0,1)$ is an unknown parameter. I have shown that $T = (\sum^n_{i = 1} Z_i, \sum^n_{i = 1} Z^2_i)$ is a two-dimensional minimal sufficient statistic for the unknown parameter $p$. I want to show ...
I am fitting a nonlinear model to observations by using least squares to estimated the model parameters. Theoretically, the covariance matrix of the parameters can be estimated by inverting the Hessian (of the objective function: RMS of residuals in my case) at the converged point (optimal solution). However, the metho...
I have an array of values and a value that lies outside of array's max value: arr = [10, 15, 20, 30] value = 150 and I want to make that value less of an outlier, by applying some sort of function to it. Let's say that I want to make that value no more than maximum value of array (limit for outliers is max(arr). I thi...
I am a novice in statistics so pardon my rather simple question. I have a retrospective case-control study, I would like to show the rate of admissions (ie number of admissions per year) of my cases and controls. I have individual level data on a = total number of admissions of a given patient during follow up period y...
I'm trying to compute the D-optimal value by hand (on R) Based on this video I could get the D value by library(AlgDesign) dat <- gen.factorial(3, 2) mat1 <- model.matrix(~(X1 + X2), dat) mat2 <- mat1[c(1, 8, 6), ] det((t(data.matrix( mat2 )) %*% data.matrix(mat2))) However, when I'm trying to get the D value from t...
I am studying computational neuroscience, particularly the modeling of neuronal spikes. Abstractly, we may think of a spike plainly as some event that either occurs or fails to occur in time. It has been established that the probability that $n$ events (spikes) occur in a trial of time $T$ follows a Poisson distributio...
I know that my question has big scope but I would like to get your perspective especially from statistical point of view. I want to establish A/B framework specially for our feature tests. We are taking a decision based on data. However we would like to do it in a more significant way. In our tests, we are taking accou...
I want to implement offline inductive conformal prediction for a bianry classificstion task but I have an issue with finding an appropriate nonconformity measure. Shafer proposes the Nearest neighbor A(B, z) : = distance to z’s nearest neighbor in B with the same label / distance to z’s nearest neighbor in B with a di...
Suppose one had performed a competing risk analysis and the 10 year cumulative incidence for the event of interest is 60%. Am I correct in thinking that we CANNOT conclude that the event-free survival is 40% since, in competing risk situations, the survival and cumulative incidence are no longer inversely related? If t...
I am running a three-level meta analysis with about 250 included studies and ~1200 contrasts. I try to get a glimpse on the heterogeneity by running moderation analyses. However, I know that most of my moderators are statistically dependent which is a problem for interpretability (Lipsey, 2003). What would you think wo...
I have done an experiment and repeated the set of measurements 3 times, totalling 3 data sets. In each set of measurements the machine acquired 30 data sets. Meaning that in total I have 90 data arrays (1000 data points per array). In other words, I have a 30x1000x3 3D matrix. How do I calculate the standard devia...
Say I have a time series deep learning model where I am trying to predict whether an event will end tomorrow and I am using binary classification to do this. If I change the target (or add another one) and predict the duration to the end of the event, which I think is a harder task, or if I use multiclass classificatio...
Let's say I want to test the effect of a treatment, and since seasonalities and other factors are too complicated to model I am using synthetic control. In order to be confident enough that the relationship found between my donors and the treated unit is stable, I leave a period between training and treatment evaluatio...
Let $Y$ be a positive random variable with density $g$ and cdf $G$. Let $c := \mathbb E Y$. Define a random variable $X$ with density $f(x):= \frac1{c}\mathbb P(Y > x)$. Not a surprise that this defines a density. However, given an algorithm to sample from $X$ (or from $Y$) is there a good way to sample from $Y$ (or $X...
I need some tips and tricks to figure out what would be an appropriate econometric method to find causal relationships between $x₁$ and $Y$ in my model $Y = α + β₁x₁ + β₂x₂ + \dotsm + βᵣxᵣ + ε$ where x₁ is the predictor variable, which addresses exclusion restriction and exogeneity criteria. However, x₁ doesn't change...
I am trying to create a logistic regression model that will allow me to give weights to several categorical variables related to inquiries about sales of high value products. An example of the same vein would be vacation rentals, predicting whether or not there will be a purchase so that the inquiries can be ranked for...
Suppose if a dependent variable is having a disease (1) and not having a disease (0). similarly , independent variable is smoking and not smoking. here , not smoking as reference group. Again, if logistic coefficient of smoking is - 0.3. odd ratio = exp (-0.3) = 0.74 Can we interpret it as , reciprocal of odd ratio= 1/...
I can’t figure out the stats to use for my problem. I have 2 groups, each with 100 patients. These groups each have a different primary treatment of interest. I have 3 different secondary treatments within these groups. I also have an outcome which is expressed as positive outcome/number of trials. The data is somethin...
I am using an HMM model, the specifics of which I cannot disclose. However, my objective is to detect significant transitions in the model's output probability distribution. This probability corresponds to the likelihood of observing a 1 or a 0 at each index value. In an ideal scenario, we would only observe probabilit...
Let’s say that you have coin with heads probability of 50% and a coin with heads probability 55%. What is the number of coin tosses it will take you, in expectation, until you are 95% confident you have one or the other? My efforts so far: trying to use hypothesis testing, however that would mean we want to have both $...
I'm reading an article about expected value in betting, I got stuck at the very beginning: Let’s use a coin toss as an example of calculating expected value. Assuming the coin and the toss are fair, each outcome (heads or tails) has an equal probability of 50% - therefore the odds offered on a fair market would be 2.0...
I am conducting a population-based study on the changes and stability of sexual identity (e.g., heterosexual, homosexual) over time. The study is based on a cohort of participants who were followed up over 11 years (three waves of surveys in 2010, 2014 and 2021). However, there are missing values in reporting sexual id...
I try to specify / calculate a longitudinal IRT latent growth model to compare learning gains between three school years in a large data set. The test were administered by a computer adaptive testing approach, so each test taker solved a potentially different set of items. I followed this discussion and this tutorial t...
I have a distance matrix that I want to performed hierarchical clustering with, and find the optimal number of clusters by maximizing the Calinski-Harabasz (CH) score. However, I only know how to calculate the CH score when you have a (object x features) data. I am not sure how I could use a distance matrix to calculat...
I am wondering whether it is valid to fit spline interactions between time and predictor variables (either categorical or continuous) in a Cox model. I am having difficulties specifying this model, which makes me think that it might not be appropriate. Here is my attempt so far (R code below), which produces estimates ...
Lets suppose we have two realizations from two stochastic processes. If we look at the values at y-axis as samples, both of these realizations have the same variance, but the second one is clearly more variant than the first (if we consider time as a factor). Is there a statistic that can describe this kind of variati...
I am implementing accelerated Langevin Dynamics (LD) for posterior estimation with prior presented with deep autoregressive network from paper [1]. I have a question about the prior smoothing operation. The paper says that for the acceleration of LD, we need progressively to smooth the pdf, starting from high noise val...
I am building a recommender system of ads based on a feedforward neural network, where I rank ads by their probability of receiving certain user feedback (e.g. clcik, install, etc). To do so, I use context and user features (time, country, etc), as well as the embedding vector of the ad being ranked. The model target i...
Let $d,k\in\mathbb N$; $\sigma\in C^1(\mathbb R^d,\mathbb R^{d\times k})$ be Lipschitz and $\Sigma:=\sigma\sigma^\ast$; $(W_t)_{t\ge0}$ be a $k$-dimensional Brownian motion; $\lambda$ denote the Lebesgue measure on $\mathbb R$; $p\in C^1(\mathbb R^d)$ be positive with $$c:=\lambda^{\otimes p}<\infty p$$ and $$\mu:=\fr...
I am trying to model CO2 fluxes (fco2) using a number of environmental parameters using a GAM in mgcv. Specifically, I have leaf temperature (tl), vapour pressure deficit (vpd), and transpiration (tr). m <- gam(co2 ~ ti(vpd, tr) + s(tl) + s(tr, k=3), data=df, method='REML', select=T) I am getting the best model AIC an...
I have implemented what I believe to be a sampler from a distribution over the integers. Its a specific discretization of the normal distribution so I know stuff like mean and variance of the theoretical distribution, and I can compute an approximate of the theoretical pmf but it's expensive so I can't do it for a lot ...
Let Z = X + Y. The linearity of $\mathsf E$ implies that $\mathsf E [Z] = \mathsf E [X] + \mathsf E [Y]$. The left-hand side should be $\int (x+y)p_{x+y}(x+y)d(x+y)$. The right-hand side should be $\int x p_{x}(x) dx + \int y p_{y}(y) dy$. Then how to make left-hand side equals to right-hand side? (Prove these two int...
I wonder if I'm not actually totally barking up the wrong tree. I have a longitudinal dataset with 10 measurement time points ("mtp"), the subject variable is "id" and I want to measure if happiness predicts whether a child will be born or not ("newborn", binary outcome). To do this, I have longitudinally lagged happin...
I am trying to pull the estimation sample used in my model. Sadly, I cannot share the data or the detailed makeup of the data as I am working in a cloud system for an online research database. But I don't think you really need to know the data for this question. Basic summary stats: I have 5,306 people with longitudina...
I am currently working on a regression prediction task using machine learning. As with most studies of this nature, I have been plotting prediction vs observation graphs to evaluate the predictive performance of my model. Ideally, the scatter points should concentrate around the line y=x. However, I have come across se...
I am new to Python and pieced some code together to construct a monthly forecast. The data is seasonal but the trend does not seem to be well defined. I've read a lot of posts on the reasons why the forecasted line is straight but still hope to find a way to improve my model. Thanks in advance import warnings import it...
Consider $N$ to be the total number of fair coin tosses such that $N \sim \mathrm{Pois}(\lambda) $. Then for the events (sorry) random variables defined as, $A:$ No. of heads observed and $B:$ No. of tails observed. And A, B independent i.e., $P(A)P(B)=P(A \cap B)$. My questions are: Is that line of logic bidirectiona...