Questions tagged [matlab]
A programming language/environment. Use this tag for any on-topic question that (a) involves MATLAB either as a critical part of the question or expected answer, & (b) is not just about how to use MATLAB .
1,291
questions
1
vote
0
answers
12
views
in matlab, is a matrix of condition number of 1e20 definitely more ill-conditioned than a matrix of condition number of 1e19?
I am working with some ill-conditioned matrices, trying to find the relationship between the matrix's ill-conditioning and the results. However, I have noticed that the condition numbers of these ...
6
votes
2
answers
165
views
(Mixed-)model specification and comparison for testing hypotheses concerning continuous ratings
In a behavioral study following a within-subjects design, subjects of various levels of musicality (years of education) gave continuous liking ratings of three audio stimuli, each under three ...
4
votes
5
answers
282
views
Is it valid to exhaustively test all possible combinations of features to find the best combination?
I have about 1000 labelled observations from about 50 subjects responding physiologically under different situations and am trying to classify the situation (usually into three classes of roughly ...
0
votes
0
answers
26
views
How to improve prediction quality of LSTM model
I am trying to train an LSTM-based model in MATLAB to predict 365 next values given 365 previous values of a time series. Input shape is (1000, 365) and output shape is (1000, 365) i.e. there are 1000 ...
1
vote
0
answers
24
views
How to combine confidence interval (or standard error, or standard deviation) for the sum of 2 fitted parameters
I am fitting a linear mixed model with the equation:
$$
y = \beta_0 + X_1 * \beta_1 + \text{random effects} + \epsilon
$$
I use the model to compare difference of means between two groups, $X_1$ is a ...
2
votes
1
answer
61
views
Why does factor appear significant in 2-way ANOVA but not by inspection (mean +/- sd or error plot)?
I am puzzled about the result of a 2-way ANOVA analysis. The factors are categorical and non-random and the sum of squares used is constrained type III (the choice of categorical or SS type does not ...
0
votes
0
answers
45
views
Heteroscedastic residuals of a VECM estimated by MLE
I have estimated an VEC model in Matlab, and it turns out the residuals are heteroscedastic.
Now, does anyone know how to apply HAC errors to a VEC Model in Matlab?
Alternatively, given the model is ...
0
votes
0
answers
36
views
Simulate bivariate bernoulli responses with predefined beta coefficients
I have a specific data matrix with features (mainly categorical). I want to simulate a multivariate bernoulli response, for example bivariate, but with a predefined vector of beta coefficients (most ...
1
vote
1
answer
74
views
Determining a mix of clusters by using naive Bayes classifiers
I have the following question which I cannot seem to find an easy answer to: given that we have two groups (let's call them 1 and 2), is it possible to determine a mixed percentage of the groups by ...
0
votes
0
answers
28
views
How do I calculate the weighted average of a 2D data set for a 3D structure?
I have a 2D data array indicating a chemical percentage content (PC) in a chemical droplet.
I am trying to calculate the average PC in the droplet.
The image of one of these arrays is shown below (the ...
0
votes
0
answers
18
views
Bootstrapped Confidence Intervals controlling for FWER?
I'm currently using the bootci package in MATLAB to compute bootstrapped confidence intervals. I have data for two variables and I'm interested in comparing differences in means of these variables. ...
1
vote
1
answer
53
views
Number of simulated statistics more extreme than most extreme real data statistic
I have a distribution of $n_{obs}$ "real" data observations drawn from a normal distribution $X \sim N(\mu,\sigma^2)$, and a number $Q$ of simulated realizations of the same distribution, ...
1
vote
1
answer
30
views
AdaBoost in Matlab - Only get 88% accuracy with Fisher's Iris data set while 100% in one layer Neural Network
I have made AdaBoost in Matlab. I get 88% in accuracy when I use Fisher's Iris flower set data.
Here is the working example:
...
1
vote
0
answers
82
views
Creating and Using a Skewed Gaussian Distribution in Matlab [closed]
I am very new to matlab, and only used it to do some fairly basic math to visualize a method. Here is an example of what I've done with a normal distribution:
...
0
votes
0
answers
26
views
Query regarding MI and NMI in the context of image fusion
I am exploring Mutual Information (MI) and Normalized Mutual Information (NMI) in the context of image fusion. While reviewing various sources, it's often mentioned that Mutual Information's value ...
3
votes
1
answer
80
views
What is the correct implementation of MCMC
I am learning Markov Chain Monte Carlo (MCMC) simulation as of the moment. My background is civil engineering and please excuse my ignorance if some of the questions are quite obvious.
I want to learn ...
1
vote
0
answers
38
views
Is a permutation test with max statistics appropriate to account for multiple comparisons when searching for correlations between two questionnaires?
I'm trying to understand if the max statistic method for permutation test is appropriate to use and how i should apply it in my situation:
I have a sample of 38 individuals who performed a task and we ...
1
vote
1
answer
57
views
Does an algorithm exist that generate copula when marginal distributions are available and stable distributed and correlation is not simple?
I have simulated data of a 4-dimensional random variable $(X_1,X_2,X_3,X_4)$. The individual pdfs of these random variables, i.e., $X_i$ where $i\in\{1,2,3,4\}$ turns out to be stable distributed with ...
0
votes
0
answers
46
views
How to compute the FGLS estimator for simulated data in Matlab (or any other language really)?
first time posting here so please let me know if I can improve my question.
As an exercise, I have to simulate 1000 iterations of a sample of 500 observations from a linear model:
$$ y_i = \beta_0 + \...
1
vote
1
answer
54
views
How to project kernel PCA?
I have an $m\times n$ matrix $X$. To apply a Kernel PCA to my $X$ matrix I need to warp it into a function $K = \Phi(X)$.
The problem here is that $K$ get the size $m \times m$. If I'm doing ...
0
votes
0
answers
84
views
How to obtain the standard deviation of several data sets with multiple measurements within each set?
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 ...
6
votes
0
answers
76
views
Posthoc pairwise test on the output of a linear mixed-model (MATLAB or R/Python)
I have observations from three groups of participants (A, B, C), that each represent ratings on three different measures (measure 1, 2, and 3). I would like to know if it is the case that, regardless ...
1
vote
0
answers
85
views
Posthoc (planned) comparisons as contrasts between different levels of a regressor, in fitlme (Matlab)
I have participant data for 5 different rating dimensions (A to E), and I have fitted linear mixed-effects models, separately for each rating, with several fixed- and random-effects predictors:
...
1
vote
2
answers
364
views
Statistical test or distance metric for comparing different distributions?
I want to compare the distributions of two different groups to determine if they are statistically different. Here is an example:
...
0
votes
0
answers
22
views
I have two data signals with respect to time how can I plot them against each other and eliminate time if the data points are not equal?
I have two signals each have been plotted against time is there any way to eliminate the time and plot the signal1 vs signal2. The problem I am facing is the number of data points is not equal signal ...
3
votes
1
answer
277
views
Python's `acf` and Matlab's `xcorr` apparently give different magnitude (but same pattern) answers for some data
I have an experiment with time series data (spike rates).
A Python script calculating their autocorrelation with statsmodels.tsa.stattools.acf was apparently giving ...
1
vote
1
answer
45
views
small dataset for a regression task
I am trying to train a NN model in MATLAB to predict the amount of overflow for flooded junctions in an urban runoff system and I have 45 samples and 15 features. The issue is, I don't think 45 ...
1
vote
0
answers
86
views
How is variance explained of a classical mds model calculated (in matlab)
I've tried to research this question but have had to rely on answers to only somewhat similar scenarios which have led me in different directions. For example, I've been advised to calculate variance ...
2
votes
0
answers
27
views
Predicting nested categorical variables from a set of continuous predictors
My dataset contains multiple continuous predictors (responses from n neurons) from which I would like to predict two categorical variables (A and B), where B is nested under A. A can take 8 different ...
1
vote
1
answer
165
views
Testing goodness of fit for a Zipf distribution (in Matlab)
I have several ranking distributions and would, for each one, like to fit a [Zipf distribution][1], and estimate the goodness of fit relative to some standard benchmark.
With the Matlab code below, I ...
1
vote
0
answers
24
views
Identifying groups/patterns in a random dataset using Matlab [closed]
I have the datasets which may contain multiple patterns. The data needs to be classified based on grouping in the data. The figure below shows an example of the data. The circles around the data are ...
0
votes
1
answer
32
views
what type of machine learning or neural net algorithm would i use for predictions about the shape of a plot
if a data set is set up such that it has 5 independent variables and an array of 201 elements of "smooth continuous" data as the dependent variable. I was wondering if there was a model ...
1
vote
0
answers
30
views
Calculating descriptive stats for aggregate/binned data [duplicate]
I have several datasets that I wish to analyse and summarize - and I'm starting with the basic median, and percentile/quartiles to begin with (unless there are other approaches I should be considering)...
1
vote
1
answer
275
views
Getting different results from 2-way ANOVA in Matlab vs Python
I'd like some advice on a two-way ANOVA that I am trying to do. It is an unbalanced design. Here is the full dataset:
Var1
Var2
Result
3
1
5.166096057
3
2
1.873452551
3
4
2.435296493
3
5
4....
4
votes
1
answer
234
views
How to select the best performing model when using nested cross-validation?
I am having some doubts about understanding nested cross-validation. I'm conducting research with a small dataset and would like to get the nested cross-validation design correctly. My dataset is $50\...
1
vote
1
answer
290
views
area under precision recall curve = 0 while AUCROC=1
I have the following data:
predictions = [8;8;8;5;4;3;2;1];
true_target = [1;1;1;0;0;0;0;0];
When I compute the area under the precision recall curve using Matlab (...
1
vote
2
answers
78
views
What kind of distribution might this be? [closed]
I have ran a series of experiments on a theoretical system. For a relatively small number of runs (~30) the data is normally distributed, but for longer runs (~200), a tail develops on the right... ...
0
votes
1
answer
454
views
Should I always pick the parameters with the best CV accuracy for GridSearch?
I’m currently training an SVM for multi classification, and to choose the C and gamma parameters, I'm using Grid search combined with k-fold CV.
I get a cross validation accuracy of 99.8%. I am not ...
0
votes
1
answer
737
views
Ridge regression, large lambda results in smaller RMSE of the training data
I am training the ridge regression on a one-day sensor data using the closed-form solution where
$$ \beta=(X^TX+\lambda*I)^{-1}X^TY $$ and Matlab.
The $X$ is 15 polynomial time matrix. I created a ...
2
votes
1
answer
114
views
Application of Classical Multidimensional Scaling in Matlab on new data
I would be happy if someone gives me a hint for two following questions in Machine Learning - related application of Classical Multidimensional Scaling in Matlab:
1.) It is recommended (but in my ...
0
votes
0
answers
125
views
Sample size for each trial vs Number of trials conducted for Monte Carlo Simulation
I am running some Monte Carlo Simulations on Matlab. I am wondering if running more Monte Carlo Simulation trials and taking the average value of these trials is the same as running a single trial ...
0
votes
0
answers
79
views
Average of random variables from two Poisson distributions?
I'm lost with a very simple question of finding the average of random variables from two Poisson distributions. I know that if $X\backsim Pois(L1)$ and $Y\backsim Pois(L2)$, then $X+Y\backsim Pois(L1+...
3
votes
0
answers
45
views
Different software (scipy, matlab) giving different p-values (KendallTau)
I'm working on a software codebase transfer between Python (scipy) and Matlab, and am wondering if anyone has any insight as to why I'd be getting different p-values when calculating the p-value for ...
0
votes
0
answers
27
views
Drawing efficiently from independent Normal Inverse Wishart distributions [duplicate]
I need to take independent draws from Normal Inverse Wishart distributions with different parameters. In practise I want to draw:
$x_i|\Sigma_i \sim \mathcal{N}(\mu_i, \Sigma_i \otimes \Psi_i )$
$\...
0
votes
0
answers
66
views
Chi-squared values differ heavily when calculated by hand and via MATLAB
(Question duplicated from math.stackexchange as per suggestion in the comments)
In my assignment, I have to approximate a curve based on $N = 15$ data points, then test what distribution the absolute ...
2
votes
1
answer
29
views
How can I use matrix operation to represent the following result?
I need to derive a pairwise offset matrix from the two known data array $X_{n \times p}$ and $Y_{m \times p}$, in which the offset are derived from values at corresponding locations $x_{ij}$ and $y_{...
1
vote
1
answer
46
views
how to add offset for Poisson-GPR using GPML package? [closed]
I'm using the popular GPML package in MATLAB for both Poisson and NB regression. Is there any way to add offset as easily as glmfit()?
Specifically, assume there are N obesrvations, I want $\log(\mu)=\...
1
vote
1
answer
53
views
AR And MA Order
I have a time series which has sequence as follows
Upon eye balling this series , it sounds me a series which has 20 cycles where frequency/counts of event increase from 0 and then decrease after ...
1
vote
0
answers
315
views
Feature selection via RFE, MRMR, embeded methods and categorical features' impact
I am using ensemble-tree for regression (in Matlab) for my research. I have 22 features that includes 16 continuous (numerical) and 6 categorical variables. Categorical variables are based on time, ...
2
votes
1
answer
461
views
Generate a truncated lognormal distribution given mean, variance, lower bound and upper bound?
Basically, I would like to generate a sample of truncated lognormal distribution given mean, variance, lower bound and upper bound. Note that the mean and variance here are the mean and variance of ...