Answered
How to plot a probability density function on a histogram?
Your code appears to use a variable "score" without defining it. You can create the histogram by calculating it yourself as y...

13 years ago | 1

| accepted

Answered
plotting multiple boxplots in the same figure window
Here's how to do that with three vectors of different lengths: x1 = rand(10,1); x2 = 2*rand(15,1); x3 = randn(30,1); x =...

13 years ago | 20

| accepted

Answered
using logistic regression on matlab for given x and y
Here's a way to fit a logistic curve to continuous data using Curve Fitting: >> x = rand(100,1); >> y = 1./(1+exp(-3*(x-...

13 years ago | 0

Answered
How do you choose values from a distribution according to their respective probabilities?
Consider the randsample function if you have the Statistics Toolbox, or look here: <http://www.mathworks.com/matlabcentral/an...

13 years ago | 0

Answered
I got 3 square cluster from 12 (x,y) points. How can I find out which points it is taking for making the clusters?
I may not follow your request. The variable T indicates which row of X belongs to each cluster. If you want to show that on the ...

13 years ago | 1

| accepted

Answered
how to code to solve for coefficient using linear regression?
It is hard to know what method you should use without understanding the problem more. One method is this. Suppose x and y are co...

13 years ago | 1

Answered
How do I obtain regression coefficients from a large data set?
Perhaps you can build on this. Here I set up some fake data with a known relationship with a single outcome variable. Then I loo...

13 years ago | 0

| accepted

Answered
coefTest and one tailed T-test
You are right that the result from coefTest is an F-test. There is no built-in way to carry out a one-sided t test. Here are ...

13 years ago | 1

| accepted

Answered
How to derive a CDF from a given PDF?
If you have the Symbolic Toolbox, you might try replacing normcdf by an erf function and see what you get. Otherwise you coul...

13 years ago | 0

Answered
Is there a way to restrict interactions to a subset GeneralizedLinearRegression.stepwise
Yes, it is possible to specify 'Upper' as a model that is the upper bound of all terms to consider. For example: y = 1 + x1...

13 years ago | 0

| accepted

Answered
Problem using trapz for obtaining probabilities
I don't quite understand what you are trying to do. I suggest you consider d=0 and step through your code to see why the first n...

13 years ago | 0

Answered
Matlab function for the calculation of G-efficiency and D-efficiency coefficients of D-optimal DoE ?
The D-optimal design maximizes the determinant of X'*X where X is the design matrix. If you have the Statistics Toolbox you coul...

13 years ago | 1

Answered
check whether regression slopes are different between 3 groups
Your code looks right to me. If you have a recent version of the Statistics Toolbox, your job would be somewhat simpler if yo...

13 years ago | 0

| accepted

Answered
There exists, logspace, linspace, what about probability space?
You haven't said what probability distribution you want. If it's the standard normal distribution, you could try norminv(.1...

13 years ago | 0

Answered
K-means clustering ignoring zero values
In that demo clustering is performed on the variable ab, then the result are reshaped and put into the variable pixel_labels. ...

13 years ago | 0

Answered
Weighted Least Squares, Need Help!!
Well, y.*w multiplies each element of y by the corresponding element of w. To do this with a matrix x having multiple columns, t...

13 years ago | 0

Answered
Corrcoef and R^2 definition give different R^2 values
I would expect your formula to work if simulation is a set of predicted values from fitting ydata using least squares as a funct...

13 years ago | 0

Answered
Understanding output of perfcurve
Could it be that you have relatively few distinct values of classpredict?

13 years ago | 0

| accepted

Answered
Why is bootci not terminating?
The default bootci 'type' is bca. This requires doing a jackknife and it can take a long time if the number of data rows is larg...

13 years ago | 0

| accepted

Answered
sampling from a mixture of 2 multivariate Gaussian distributions
If you have the Statistics Toolbox, type "help gmdistribution". You can use it to construct a mixture of two Gaussians, then use...

13 years ago | 0

Answered
unable to fit Gaussian mixture model
I don't know much about analyzing images. But gmdistribution expects its input data to be samples drawn from a Gaussian mixture ...

13 years ago | 0

Answered
nnmf function usage problem
Most Statistics Toolbox functions aren't written to operate on integer data types. Try nnmf(double(resim),100) to convert to dou...

13 years ago | 1

| accepted

Answered
Boxplot (with several groups/days) + Plot (for each group/day)
Sorry, your frustration led me to try it myself. Here's what I did: a = rand(3,4); b = 10*rand(3,4); figure(1); bar(a...

13 years ago | 0

| accepted

Answered
Boxplot (with several groups/days) + Plot (for each group/day)
Here's how you can set the color of the first group: h = bar(Y, 'group'); set(h(1),'FaceColor','r') If you are conten...

13 years ago | 0

Answered
wald test or test of equality of means
In an older release, check out "help linhyptest". It can perform a hypothesis test on coefficients given estimates and a covaria...

13 years ago | 0

Answered
integrating the product of two pdf's
Here's an example that you may be able to adapt to your problem. Suppose [x1;x2] have a multivariate normal distribution with...

13 years ago | 2

Answered
integrating the product of two pdf's
What is the "space" variable intended to represent? Based on your integral expression, I'd expect the result to be a function...

13 years ago | 0

Answered
Integration of multivariate normal cumulative distribution function
I assume you really want to integrate the cdf, rather than compute the cdf which is the integral of the pdf. The dblquad func...

13 years ago | 0

| accepted

Answered
wald test or test of equality of means
I assume you mean you want to test the equality of two regression coefficients. This will work in the current release of the Sta...

13 years ago | 0

Answered
ovlay cdf plot on histogram
It's there but it's on the histogram scale and it is obscured by the bars. Try this instead to put the cdf on a separate y axis:...

13 years ago | 1

| accepted

Load more