Entering,Saving,and Analysis /Fitting X Y Data on the Prime



#8

The students in my Physics Lab class did the Simple Pendulum Lab using a Vernier LabPro Interface and Photo-gate today.
For me it was about time to use my Prime to analyze the data.
I entered the Period vs Length using the Statistics 2 Variable App.
I then used the Symbol key to choose the best fit regression equation to fit the data to. I then plotted the data to see the best fit line.
Is this the best way of doing this?
It took me about 10 minutes with a few fits a starts along the way.(It took me about two minutes to do the same thing on my 50G.)
When I use the Matrix Writer on the 50G, I can save the data matrix using a recognizable name, can I do the same on the Prime?
M1,M2,etc seem awfully generic IMHO.


#9

Custom names are allowed. Any matrix with a name other than M0-M9 will appear under User Variables (accessed by the Vars key).

Using custom names for matrices in programs must be local and initialized.


Edited: 25 Oct 2013, 9:47 a.m.


#10

Quote:
Custom names are allowed. Any matrix with a name other than M0-M9 will appear under User Variables (accessed by the Vars key).

Using custom names for matrices in programs must be local and initialized.


To clarify Eddie's post:

EXPORT MYPROG()
BEGIN
LOCAL mymatrix=[[0]]; // initializes a real matrix;
mymatrix(50,50):=0; // sets the size; completely optional because matrices can be expanded dynamically

... code ...
END;

Matrices can be global variables, though. If you already created a matrix named MYMATRIX, then it can be used in your program without any variable delcaration. If MYMATRIX does not exist, then the program editor will complain with a Syntax Error -- you can then just exit the program editor and create a dummy MYMATRIX and this will fix the syntax error. Lastly, one may also have MYPROG() create a global variable as well (both visible and invisible).

EXPORT MYMATRIX; // export creates a global variable named MYMATRIX; initially value is 0
initMyProg; // create a flag; initially set to 0 (note lack of EXPORT)
EXPORT MYPROG()
BEGIN
if (initMyProg == 0) then
MYMATRIX:=[[0]]; // initializes the variable to 1x1 real matrix
initMyProg:=1;
end;

... more code ...
END;

Anytime a program file is edited (or even just viewed) it will get recompiled. So the flag initMyProg will determine whether or not to re-initialize the MYMATRIX or leave it intact to be reused by MYPROG().

Using EXPORT makes a global variable visible to the user, whereas leaving it out means the variable (while still global) is not visible to the user. Since we don't want users to be tinkering with the flag -- it should only be visible to the MYPROG() program -- then we do not export it.

#11

Hello,

I'm new at using HP PRIME as well but have found that for STATS 2VAR App you can:

Create lists (in HOME view) and sto> in a List (L0-9) or sto> as a user variable.

For example, say you store L1 and Test_List as lists. In STATS 2Var SYMB view, you can refer to L1, Test_List or any of the C1-C4 Columns associated with the App. PLOT and NUM views seem to work fine.

You can also refer to a range of Spreadsheet cells directly in the STATS SYMB view (ie. Spreadsheet.A1:A10).


Best,
Carl


#12

Also, a lot don't realize the column definitions in the stat symb screen are actually formulas. Thus things like LN(my_list)+1 are perfectly acceptable there.

TW

#13

Quote:
The students in my Physics Lab class did the Simple Pendulum Lab using a Vernier LabPro Interface and Photo-gate today.
For me it was about time to use my Prime to analyze the data.
I entered the Period vs Length using the Statistics 2 Variable App.
I then used the Symbol key to choose the best fit regression equation to fit the data to. I then plotted the data to see the best fit line.
Is this the best way of doing this?
It took me about 10 minutes with a few fits a starts along the way.(It took me about two minutes to do the same thing on my 50G.)
When I use the Matrix Writer on the 50G, I can save the data matrix using a recognizable name, can I do the same on the Prime?
M1,M2,etc seem awfully generic IMHO.

I found all the responders answers to this question very helpful,but I forgot to ask another question or two.
Where is the regression coefficient or the RMSE displayed when using the 2 Variable Statistics APP?
Also where is the covariance displayed?
They are shown when using the 50G. RMSE maybe not?

#14

It is a numerical value or calculation, so it will be somewhere in the NUM view. Pres STATS (F6). Toggle between X or Y specific values using the menu keys.

TW


Possibly Related Threads…
Thread Author Replies Views Last Post
  Sheet data importer for HP Prime Marek Russ 4 1,916 11-15-2013, 04:55 AM
Last Post: debrouxl
  HP PRIME: How to change the column headers and reset data Joseph Ec 5 2,277 10-18-2013, 02:26 PM
Last Post: Joseph Ec
  HP Prime data sharing Alberto Candel 5 1,896 10-06-2013, 07:49 PM
Last Post: Alberto Candel
  HP-Prime: issues in entering expressions fhub 30 8,234 10-02-2013, 12:32 AM
Last Post: Tim Wessman
  [HP-Prime CAS] list[x,y,z], vector[x, y, z ] ... data type operation? CompSystems 1 1,250 08-22-2013, 03:30 PM
Last Post: Joe Horn
  Advanced User's Manual and solution to the ambiguity of data types [HP-Prime xCAS] CompSystems 15 5,708 08-20-2013, 03:37 PM
Last Post: Thomas Klemm
  [HP-prime] Parallel Processing, vectors, matrices as a only data type =( CompSystems 1 1,223 08-08-2013, 04:48 PM
Last Post: peacecalc
  Printing HP 9825 data Norman Pillsbury 3 1,604 06-01-2013, 10:08 PM
Last Post: David Ramsey
  HP85 Waveform Analysis inaki 1 1,134 04-23-2013, 01:20 PM
Last Post: Paul Berger (Canada)
  Trouble entering a HP35s program line Arno 2 1,590 04-05-2013, 06:28 PM
Last Post: Arno

Forum Jump: