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 .

Filter by
Sorted by
Tagged with
1 vote
0 answers
277 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, ...
Smoa's user avatar
  • 11
3 votes
1 answer
370 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 ...
Hongbo W's user avatar
0 votes
0 answers
149 views

Mean squared error in 2D, divide by pixel area or not?

I am comparing 2D histograms using mean squared error (MSE, mean of the squared differences). These histograms have varying pixel or bin sizes. I want to compare the MSE results across these different ...
Liet Kynes's user avatar
1 vote
1 answer
89 views

Why does a neural network perform poorly in case of small loss?

Background I'm building a convolutional neural network (CNN) to predict the response factor (continuous variable) of organic molecules. As input, I use 86x86 onehot-encoded matrices that represent the ...
DanPav22's user avatar
1 vote
1 answer
569 views

Number of epochs and weight updates in deep models

Does training any model from scratch require more or less updates compared to fine-tuning a pre-trained model? For cancer disease classification, I have built a network from scratch, with batch size ...
Noha's user avatar
  • 47
1 vote
1 answer
267 views

Applying k-means over PCA

I have a dataset containing 20 columns and 200 rows. This is an unlabeled dataset and I applied PCA to this dataset for dimensionality reduction. After successfully using PCA, I received a dataset ...
Krishna's user avatar
  • 19
1 vote
1 answer
247 views

Validation in deep learning networks

https://es.mathworks.com/help/deeplearning/ref/trainnetwork.html?s_tid=doc_ta#bu6sn4c-traininfo In the above link, there is an example for train network with augmented images. The number of iterations ...
Noha's user avatar
  • 47
0 votes
0 answers
312 views

Maximum number of epochs and validation frequency in deep learning networks

I read in one article that the number of epochs in a deep learning network are varied according to a validation frequency of 300. I am not sure what it means. Does it mean after every 300 weight ...
Noha's user avatar
  • 47
0 votes
1 answer
102 views

what if range of normalized of data in machine learning goes beyond?

Normalization in machine learning is the process of translating data into the range 0 -> 1 or -1 -> 1. What if the values goes above 1 or below -1. What does that mean? Is it again an outlier? ...
Krishna's user avatar
  • 19
3 votes
1 answer
131 views

Building a bootstrapped distribution to test reliability of empirical data

I have data from a study where subjects (considered as "generations" in a Telephone-like game) sang short melodies from one to the next, starting from a randomly-generated melody (seed) ...
z8080's user avatar
  • 2,370
0 votes
1 answer
150 views

Wilcoxon Signed Rank

I have 4 matrices of size 686810 each. To understand better, we can represent each matrix as a graph of 68 nodes. For each node I compute betweeness centrality, strength, clustering coefficient, and ...
Lou's user avatar
  • 1
1 vote
1 answer
26 views

Product of elements of a vector which has very large values and very low values ordered in decreasing order (MATLAB)

I have to compute the product of the elements in a vector V. The elements of my vector are in decreasing order and go from very large numbers (eg 5e^5) to very small numbers (e.g 1.8e^-8). I am using ...
Giorgetto's user avatar
  • 319
1 vote
2 answers
191 views

Goodness-of-fit tests for discrete distributions

I have data where only values at large x should fit to a particular distribution whose parameters I wish to determine. I want to do a goodness-of-fit test to find the value of x where the data fit to ...
user avatar
0 votes
1 answer
49 views

Finding the region in sample data that fits to a known distribution

Given sample data that have a known probability distribution for large x and an unknown probability distribution for small x, what is the best way to find the value of x where the known probability ...
user avatar
2 votes
3 answers
304 views

Overconfidence of Bayesian linear regression models

I have encountered a problem with Bayesian linear regression models, which I describe in the following. I hope that someone can give me a better understand of Bayesian models or has a possible fix. ...
Looper's user avatar
  • 307
1 vote
0 answers
191 views

Visualizing linear mixed model interaction result with continuous variables

I have data from 400 participants, each person is in one of the five treatment levels, 80 people per treatment. Within each person I have 5 measurements of my outcome variable. I want to see whether ...
Maria's user avatar
  • 415
1 vote
0 answers
493 views

How to insert a constraint on coefficients of logistic regression model?

I want to build a logistic regression model on my data, which contains three continuous predictors and a logical response. I need to constrain the regression coefficients to be not less than 0 and sum ...
tunar's user avatar
  • 511
2 votes
0 answers
92 views

What are the references for different active set selection methods for sparse Gaussian processes?

I am comparing the different sparse Gaussian process approaches within the fitrgp function in Matlab, but I am struggling to find references for the different choices within the function for the ...
MitchRR's user avatar
  • 21
1 vote
0 answers
364 views

Plot multiple lines in transparent gray such that overlapping parts are darker [closed]

Unfortunately I cannot remember where I saw it, so I cannot provide a picture of how the plot should look like. I can just describe it: Do you know a way in MATLAB or R to plot multiple time series in ...
stollenm's user avatar
  • 842
0 votes
2 answers
703 views

Why do I get a lower R-squared value when I add more variables to my multiple linear regression?

I'm using the Regression Learner tool in MATLAB to do robust linear regression on a set of variables. However, with only one variable I get a higher R-squared value than when I'm adding one or two ...
user avatar
1 vote
2 answers
517 views

Dealing with multicollinearity across dependent variables

In an experiment, participants rated each of several musical stimuli on 5 dimensions (ratings A to E). For each of the ~3,000 trials, the independent variables were (* = critical manipulation): *...
z8080's user avatar
  • 2,370
0 votes
1 answer
131 views

Simulation using the fundamental theorem of simulation (MATLAB)

I have a sub-task of an assignment about the parametric bootstrap method. The subtask is to, given a students t-distribution with $5$ degrees of freedom, sample $10000$ draws using the fundamental ...
cittee's user avatar
  • 33
0 votes
0 answers
91 views

Calculating Convolution Only for a Certain Interval Using "conv()" in MATLAB

Below you can see the code for convolution of two continuous functions. There is a function called fx which I took as the square root of a Gaussian distribution. ...
Ali Pedram's user avatar
0 votes
2 answers
195 views

Testing equivalence for consistency validation

I am testing the output of a low-power cell battery and then I measured the output after a while. I did multiple runs and the output was slightly different every time. I would like to check whether my ...
Anwar Elhadad's user avatar
0 votes
1 answer
211 views

Difference logistic regressions results in MATLAB vs R

I am trying to run a binomial logistic regression in both R and Matlab. I wanted to use both to confirm that I have same results. However, I cant even get similar results ... What am I missing?
user avatar
1 vote
1 answer
138 views

Reconciling one-way ANOVA in MATLAB with Results from R

I'm used to work in MATLAB but want to be able to use R as well. Currently, I'm trying to run a one-way ANOVA in R using the following example from MATLAB using the hogg dataset showed here: https://...
Eric HG's user avatar
  • 13
3 votes
1 answer
128 views

Avoid numerical problems with product of probabilities when taking logs or subtracting the maximum is not enough

I have to take draws from the discrete posterior distribution: $ P(X = x_i |y) \propto P(X = x_i)\prod_{t}^N p(Y_t|X)$ where $P(X = x )$ is the probability mass function of a discrete uniform with ...
Giorgetto's user avatar
  • 319
0 votes
1 answer
815 views

RL Critic estimate does not converge but I get good results in simulation

I'm using Reinforcement Learning on a control problem, specifically a TD3 agent. I have an order 3 plant and I want to use RL to find the optimal values for PI gains, so i'm basing on this matlab link....
qseb59's user avatar
  • 11
1 vote
0 answers
80 views

How to create a weighted composite covariance function using GPML toolbox in MATLAB?

I'm trying to create a composite covariance function to model my data. Specifically I want to create a kernel which is weighted between @covSEard & ...
Bhanuteja Aryasomayajula's user avatar
2 votes
1 answer
196 views

How are the weights and the bias in matlab nueral network system arranged in context with using getwb(net)?

Say I have 2 input neurons, 3 hidden neurons and 1 output neuron. The total number of weights that are used are understandably 3*(2+1)+1(3+1)=13. Here there the multiplicative the number of weights is ...
user328858's user avatar
0 votes
0 answers
164 views

Different results in LU decomposition in Matlab and R packages (Matrix and pracma)

I'm trying to understand the algorithm used by Matlab and R in LU-decomposition. Suppose I want to LU-decompose the matrix: $$ A= \begin{bmatrix} 5 & 6 & 5 & 8 \\ 10 & ...
Tommaso's user avatar
  • 573
1 vote
1 answer
394 views

Contour plot comparison [closed]

What are the ways to compare two different maps? I was thinking of taking the matrices of each map and then quantify their spatial differences by plotting the map of the differences of the two ...
Random's user avatar
  • 13
3 votes
2 answers
192 views

Logistic regression cost function finding multiple minima in matlab using fminunc

Good afternoon, I am a beginner at machine learning and am trying to implement a basic logistic regression using the formula for the cost function we learned in class: https://miro.medium.com/max/2836/...
Derek's user avatar
  • 33
1 vote
0 answers
245 views

Maximum likelihood parameter estimation for state space model (Kalman Filter)

it´s about a state space model that I want to run using the Kalman filter. However, certain parameters are unknown and must be estimated by the maximum likelihood method. The state space model is as ...
Marv91's user avatar
  • 41
0 votes
0 answers
143 views

How to Add two white random gaussian noises from different noise sources?

I have generated two different white gaussian random noises in MATLAB using two different seeds. For example: Asn1 = sqrt(noisepow1/2)* (randn(size(As))+1i*(randn(size(As)))); Asn2 = sqrt(...
Arin Dutta's user avatar
1 vote
1 answer
78 views

Estimate pdf on a large vector

I have a vector of 10,000 observations and I need to estimate the pdf at each point of the vector. The code I have is the following (Matlab): ...
kernel_estimator's user avatar
1 vote
1 answer
222 views

Why was the reconstructed error for one-hidden layer autoencoder much smaller than that of stacked autoencoders?

I want to compare the reconstructed error from the traind autoencoder and stacked autoencoder within MATLAB. The following is my MATLAB code using the 'Deep Learning' toolbox: ...
tunar's user avatar
  • 511
4 votes
1 answer
220 views

Reconstruction error PCA using all eigenvectors not zero

I'm doing a project in MATLAB where I need to do dimensionality reduction and reconstruction using PCA. This is going fine however I noticed that when trying to reconstruct an image using all ...
donjon's user avatar
  • 41
0 votes
0 answers
98 views

How to interpret ACF and PACF and how to pre-process data

I have these data, related to value of pH over time: I want to generate a stochastic model (ARMA, ARMAX, and so on), and I want to decide the order of this model, so I did the plots of ACF and PACF, ...
CasellaJr's user avatar
  • 123
1 vote
1 answer
125 views

How to set a constraint for a non-linear least squares problem [closed]

I am trying to fit some data where the cost function is $ax^2 + bx + c$ and I need to have $a+b+c = 1$. How do I set such a constraint in MATLAB or Python?
SEU's user avatar
  • 111
1 vote
1 answer
3k views

Data fitting to multivariate distribution

Data fitting is the process of fitting models to data and analyzing the accuracy of the fit. The models consist of common probability distribution (e.g. normal distribution). The data are two-...
MOSTAJKIR's user avatar
2 votes
2 answers
491 views

Issue with Kolmogorov - Smirnov test implementation in Matlab?

I observed a strange behavior of the 2 sample Kolmogorov - Smirnov test in Matlab and I'm not sure if I missing the obvious or if there is indeed an issue with implementation of the test? Below is a ...
curiousCuriosity's user avatar
2 votes
1 answer
75 views

Comparisons of distributions: How to deal with discrepancies between visual impression and statistical tests (K-S, ranksum)?

I'm having some doubts how to properly compare my data (because of visual discrepancies), represented as histograms. Here's an minimal and representative example, illustrating the data: I measure BMI ...
user2305193's user avatar
0 votes
0 answers
27 views

Fitting when variables have different variances?

I am trying to fit a function y = f(x1,x2,x3). The function is non-linear and variables x1,x2, and x3 have different variances. In such a case how do I weigh different variables while performing a ...
SEU's user avatar
  • 111
0 votes
1 answer
494 views

PCA and eigendecomposition: Calculating loading vector in Python

For an assignment the Matlab code has to be rewritten into Python code. ...
Ramón Wilhelm's user avatar
6 votes
1 answer
2k views

How to propagate measurement uncertainty in predictors *and* responses for multidimensional, non-parametric regression (and software to do it)?

Background Errors-in-variables models are defined as: regression models that account for measurement errors in the independent variables. In contrast, standard regression models assume that those ...
Sterling's user avatar
1 vote
0 answers
204 views

Computing the marginal expected shortfall (MES)

I found the following Matlab code to compute the Marginal Expected Shortfall (MES). I understand the code but the mathematical part is not clear to me. More specifically, I don't understand these two ...
Suzy's user avatar
  • 11
1 vote
0 answers
213 views

State space representation of VECM-GARCH

Can someone help me write a state-space representation for the VECM-GARCH model to estimate the time-varying parameters using Kalman Filtering in Matlab? I am struggling with specifying the GARCH ...
Raghav Goyal's user avatar
1 vote
1 answer
360 views

Computational cost of the function knnsearch in Matlab

I want to know which is the computational cost of the $\texttt{knnsearch}$ algorithm in Matlab. $\texttt{[~, distX] = knnsearch(X,X,'K',N,'Distance','chebychev');}$ where N is length of X.
Massimiliano Romana's user avatar
0 votes
0 answers
107 views

How to rearrange a ratio of Gamma functions to code it

I have to evaluate the following ratio: $\frac{\Gamma(\frac{x}{2} - \frac{1}{2})}{\Gamma(\frac{x}{2})}$ I am coding in MATLAB and I have this equation inside a loop. $x$ takes values between 2 and 400....
Giorgetto's user avatar
  • 319

1
2
3 4 5
26